.mh-action-trigger.mh-theme-trigger {
  display: flex;
  gap: 7px;
  width: auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  height: auto;
  /* The public site loads this file without the controls' tokens. */
  min-height: var(--mh-control-md, 40px);
  padding: 0 10px;
  color: rgb(var(--mh-vellum));
  font: var(--mh-text-body) / 1.4 var(--mh-font-ui);
}

.mh-theme-picker {
  padding: 14px;
}

.mh-theme-picker fieldset {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

.mh-theme-picker fieldset + fieldset {
  margin-top: 16px;
}

.mh-theme-picker legend {
  margin-bottom: 12px;
  font-size: var(--mh-text-body);
  font-weight: 600;
}

.mh-theme-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mh-theme-option {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgb(var(--mh-graphite));
  border-radius: 7px;
  cursor: pointer;
  touch-action: manipulation;
}

@media (hover: hover) {
  .mh-theme-option:hover {
    border-color: rgb(var(--mh-vellum));
  }
}

.mh-theme-option:has(input:checked) {
  border-color: rgb(var(--mh-blueprint));
  box-shadow: 0 0 0 1px rgb(var(--mh-blueprint));
}

.mh-theme-option:has(input:focus-visible),
.mh-theme-option[data-keyed]:has(input:focus) {
  outline: 2px solid rgb(var(--mh-blueprint));
  outline-offset: 3px;
}

.mh-theme-preview {
  display: block;
  height: 86px;
  overflow: hidden;
  background: rgb(var(--mh-paper));
  border-bottom: 1px solid rgb(var(--mh-graphite));
}

.mh-chart-theme-preview {
  display: block;
  width: 100%;
  height: 62px;
  border-bottom: 1px solid rgb(var(--mh-graphite));
}

.mh-theme-preview-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 17px;
  padding: 0 7px;
  background: rgb(var(--mh-charcoal));
  border-bottom: 1px solid rgb(var(--mh-graphite) / 0.4);
}

.mh-theme-preview-bar > span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgb(var(--mh-eraser));
}

.mh-theme-preview-page {
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 12px 14px;
}

.mh-theme-preview-page > span {
  display: block;
  height: 3px;
  border-radius: 1px;
}

.mh-theme-preview-title {
  width: 60%;
  background: rgb(var(--mh-moon));
}

.mh-theme-preview-line {
  width: 90%;
  background: rgb(var(--mh-eraser) / 0.65);
}

.mh-theme-preview-line + .mh-theme-preview-line {
  width: 75%;
}

.mh-theme-preview-page > .mh-theme-preview-accent {
  width: 24px;
  height: 8px;
  background: rgb(var(--mh-blueprint));
}

.mh-theme-option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 8px 10px;
}

.mh-theme-option-label input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: rgb(var(--mh-blueprint));
}

.mh-theme-option-label input:focus {
  /* The full card carries the keyboard focus indicator. */
  outline: none;
}

.mh-theme-option-label strong,
.mh-theme-appearance {
  display: block;
}

.mh-theme-option-label strong {
  font-weight: 600;
}

.mh-theme-appearance,
.mh-theme-scope {
  color: rgb(var(--mh-vellum));
  font-size: var(--mh-text-meta);
}

.mh-theme-scope {
  margin-top: 12px;
}

@media (pointer: coarse) {
  .mh-action-trigger.mh-theme-trigger {
    min-height: 44px;
  }
}

@container desk (max-width: 600px) {
  .mh-action-trigger.mh-theme-trigger {
    gap: 5px;
    padding: 0 6px;
    font-size: var(--mh-text-meta);
  }
}

@container desk (max-width: 360px) {
  .mh-app-toolbar .mh-theme-trigger {
    min-width: 44px;
    padding: 0 3px;
  }

  .mh-app-toolbar .mh-theme-trigger > svg {
    display: none;
  }
}

.mh-theme-trigger:active,
.mh-theme-trigger[aria-expanded="true"] {
  background: rgb(var(--mh-graphite) / 0.12);
  color: rgb(var(--mh-moon));
}
@media (hover: hover) {
  .mh-theme-trigger:hover {
    background: rgb(var(--mh-graphite) / 0.12);
    color: rgb(var(--mh-moon));
  }
}
.mh-theme-trigger:focus-visible {
  outline: 2px solid rgb(var(--mh-blueprint));
  outline-offset: -2px;
}
.site-theme .mh-theme-picker {
  position: fixed;
  inset: auto;
  margin: 0;
  width: min(304px, calc(var(--desk-width) - 24px));
  overflow: auto;
  color: rgb(var(--mh-moon));
  background: rgb(var(--mh-charcoal));
  border: 1px solid rgb(var(--mh-graphite) / 0.42);
  border-radius: var(--mh-popover-radius);
  box-shadow: var(--mh-popover-shadow);
  font: var(--mh-text-body) / 1.45 var(--mh-font-ui);
}
.site-theme .mh-theme-picker:not(:popover-open) {
  display: none;
}
.site-theme .mh-theme-picker * {
  box-sizing: border-box;
}
