html[data-theme=dark] {
  --cv-action-fill: rgb(255 255 255 / 14%);
  --cv-action-hover: rgb(255 255 255 / 22%);
}

html[data-theme=light] {
  --cv-action-fill: rgb(24 34 47 / 11%);
  --cv-action-hover: rgb(24 34 47 / 17%);
}

/* Use the same action face in static market pages and the account shell. */
html[data-theme] #root #converge-shell :is(
  .c-btn-primary, .cv-course-button:not(.cv-course-button-secondary),
  .c-scanner-dialog-apply, .c-order-submit, [data-journal-compose],
  .cv-profile-workspace button[type=submit], .c-manual-position-dialog button[type=submit],
  button[value=save]
),
html[data-theme] body > dialog :is(.c-btn-primary,button[type=submit],button[value=save]) {
  --cv-common-control-fill: var(--cv-action-fill);
  background: var(--cv-common-control-fill) !important;
  color: var(--color-text) !important;
  border-color: var(--cv-common-rim) !important;
  box-shadow: none !important;
}

html[data-theme] #root #converge-shell :is(
  .c-btn, .c-tool-button, .cv-course-button, .c-scanner-dialog-footer button,
  .cv-plan-soon, .cv-journal-menu button, .c-manual-position-dialog button,
  .cv-profile-workspace button, .cv-auth-card button, .cv-magnetic-face,
  [data-motion-group] > button, [data-motion-group] > a,
  .c-position-tab-track > *, .c-chart-finance-track > *, .c-entry-order-types > *,
  .cv-profile-tabs > *, .c-book-units > *
) {
  background-image: none !important;
}

html[data-theme] #root .cv-account-loading > div > span {
  background: var(--cv-action-fill) !important;
  box-shadow: none !important;
}

html[data-theme] #root #converge-shell :is(
  .c-btn-primary, .c-scanner-dialog-apply, .c-order-submit, [data-journal-compose],
  .cv-profile-workspace button[type=submit], .c-manual-position-dialog button[type=submit]
):is(:disabled,[aria-disabled=true]) {
  background: var(--cv-common-button) !important;
  color: var(--color-muted) !important;
}

@media (hover:hover) {
  html[data-theme] #root #converge-shell :is(
    .c-btn-primary, .cv-course-button:not(.cv-course-button-secondary),
    .c-scanner-dialog-apply, .c-order-submit, [data-journal-compose],
    .cv-profile-workspace button[type=submit], .c-manual-position-dialog button[type=submit],
    button[value=save]
  ):hover:not(:disabled,[aria-disabled=true]) {
    --cv-common-control-fill: var(--cv-action-hover);
  }
}

html[data-theme] #root #converge-shell[data-view=scanner] .c-scanner-filter-dialog .c-filter-markets {
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  grid-template-areas: "market all mode" "venues venues venues";
  align-items: end;
}

html[data-theme] #root #converge-shell[data-view=scanner] .c-filter-markets .c-scanner-route-choice {
  justify-self: end;
  text-align: end;
}

html[data-theme] #root #converge-shell[data-view=scanner] .c-filter-markets .c-scanner-all-tile {
  justify-self: center;
}

.cv-filter-apply-count [data-scanner-match-count] {
  inline-size: 5ch;
  font-variant-numeric: tabular-nums;
}

@media (max-width:600px) {
  html[data-theme] #root #converge-shell[data-view=scanner] .c-scanner-filter-dialog .c-filter-markets {
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    grid-template-areas: "market mode" "all all" "venues venues";
    column-gap: 8px;
  }
}

html[data-theme] #root #converge-shell[data-view=terminal] .focus-coin-slot #terminal-coin-trigger,
html[data-theme] #root #converge-shell[data-view=terminal] .focus-coin-slot #terminal-coin-trigger > .cv-magnetic-face {
  --cv-common-control-fill: transparent;
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

html[data-theme] #root #converge-shell #cv-header .cv-product-account {
  position: relative;
}

html[data-theme] #root #converge-shell #cv-account-menu-panel .cv-account-menu-summary {
  display: none;
}

html[data-theme] #root #converge-shell #cv-account-menu-panel :is(a,button,.cv-magnetic-face) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: var(--color-text) !important;
}

html[data-theme] #root #converge-shell #cv-account-menu-panel :is(a,button):is(:hover,:focus-visible) {
  background: var(--cv-common-hover) !important;
}

html[data-theme] #root #converge-shell .cv-market-account-panel {
  inset: calc(100% + 8px) 0 auto auto;
  min-inline-size: 136px;
}

html[data-theme] #root #converge-shell .cv-lesson-figure.is-thumbnail {
  padding: 0;
  display: grid;
  place-items: center;
}

html[data-theme] #root #converge-shell .cv-lesson-figure > img {
  margin: 0 auto;
  max-inline-size: 100%;
  object-fit: contain;
  object-position: center;
}

html[data-theme] #root #converge-shell .cv-lesson-figure.is-thumbnail > img {
  inline-size: 100%;
  block-size: 100%;
  min-block-size: 0;
}
