.theme-color-dialog {
  inline-size: min(calc(100% - 2rem), 27rem);
  max-block-size: calc(100dvh - 2rem);
  max-inline-size: none;
  margin: auto;
  padding: 0;
  border: 1px solid color-mix(in srgb, currentColor 19%, transparent);
  border-radius: 1.35rem;
  background: var(--card);
  color: var(--account-card-ink, var(--ink));
  --accent: var(--account-card-accent, var(--account-primary));
  box-shadow: 0 .65rem 2.65rem #0005;
  overscroll-behavior: contain;
}
.theme-color-dialog::backdrop { background: rgb(0 0 0 / .52); }
.theme-color-frame { display: grid; gap: .65rem; padding: .8rem; }
.theme-color-sheet-heading, .theme-color-footer, .theme-color-picked, .theme-color-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
}
.theme-color-dialog .theme-color-sheet-heading h2 { font-size: 1.15rem; margin: 0; }
.theme-color-close {
  inline-size: 44px;
  min-block-size: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.theme-color-close .app-icon { inline-size: 1.02rem; block-size: 1.02rem; }
.theme-color-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .14rem;
  padding: .17rem;
  border-radius: .65rem;
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.theme-color-tabs > button {
  min-block-size: 44px;
  padding: .25rem .12rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  font-size: .88em;
  line-height: 1.45;
}
.theme-color-tabs > button[aria-pressed=true] {
  background: var(--card);
  box-shadow: 0 1px 4px #0002;
  font-weight: 700;
}
.theme-color-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  isolation: isolate;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: .6rem;
}
.theme-color-grid > button.theme-color-cell {
  display: grid;
  position: relative;
  place-items: center;
  min-inline-size: 0;
  min-block-size: clamp(28px, 7vw, 37px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--chip);
  forced-color-adjust: none;
}
.theme-color-cell .app-icon { inline-size: .85rem; block-size: .85rem; visibility: hidden; }
.theme-color-cell[aria-pressed=true] .app-icon { visibility: visible; }
.theme-color-grid > button:is(:hover, :focus-visible, [aria-pressed=true]) {
  box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px #111;
  z-index: 1;
}
.theme-color-grid > button:first-child { border-start-start-radius: .5rem; }
.theme-color-grid > button:nth-child(10) { border-start-end-radius: .5rem; }
.theme-color-grid > button:nth-last-child(10) { border-end-start-radius: .5rem; }
.theme-color-grid > button:last-child { border-end-end-radius: .5rem; }
.theme-color-spectrum-panel, .theme-color-sliders { display: grid; gap: .45rem; }
.theme-color-spectrum {
  position: relative;
  min-block-size: clamp(8rem, 26dvh, 12rem);
  border-radius: .65rem;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  background: linear-gradient(transparent, #000), linear-gradient(90deg, #fff, var(--spectrum-hue));
  cursor: crosshair;
  touch-action: none;
  forced-color-adjust: none;
}
.theme-color-spectrum > span {
  position: absolute;
  inline-size: 1.18rem;
  block-size: 1.18rem;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #111;
  pointer-events: none;
}
.theme-color-dialog input[type=range] {
  appearance: none;
  min-inline-size: 0;
  min-block-size: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  direction: ltr;
  cursor: pointer;
  --track: linear-gradient(90deg, var(--channel-start), var(--channel-end));
}
.theme-color-dialog input.theme-color-hue { --track: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.theme-color-dialog input[type=range]::-webkit-slider-runnable-track { height: 13px; border-radius: 20px; background: var(--track); }
.theme-color-dialog input[type=range]::-moz-range-track { height: 13px; border-radius: 20px; background: var(--track); }
.theme-color-dialog input[type=range]::-webkit-slider-thumb {
  appearance: none; height: 23px; width: 23px; margin-top: -5px; border: 2px solid #fff; border-radius: 50%; background: #f7f7f8; box-shadow: 0 0 0 1px #0009;
}
.theme-color-dialog input[type=range]::-moz-range-thumb {
  height: 19px; width: 19px; border: 2px solid #fff; border-radius: 50%; background: #f7f7f8; box-shadow: 0 0 0 1px #0009;
}
.theme-color-channel, .theme-color-code {
  display: grid;
  grid-template-columns: minmax(3em, max-content) minmax(0, 1fr) 4em;
  gap: .5rem;
  align-items: center;
  font-size: .9em;
}
.theme-color-channel input[type=text], .theme-color-code input {
  width: 100%;
  min-width: 0;
  padding: .32rem .25rem;
  font: .87rem ui-monospace, monospace;
  text-align: center;
  background: var(--card);
  border-color: color-mix(in srgb, currentColor 35%, transparent);
}
.theme-color-code { grid-template-columns: auto minmax(0, 1fr); }
.theme-color-validation { margin: 0; font-size: .84em; }
.theme-color-footer { flex-wrap: wrap; border-block-start: 1px solid var(--divider); padding-block-start: .5rem; }
.theme-color-comparison { display: flex; overflow: hidden; direction: ltr; border: 1px solid var(--divider); border-radius: 2rem; }
.theme-color-comparison span { inline-size: 1rem; block-size: 1.28rem; forced-color-adjust: none; }
.theme-color-value { font: .82rem ui-monospace, monospace; }
.theme-color-actions { margin-inline-start: auto; }
.theme-color-actions > button { padding-inline: .5rem; font-size: .84em; }
@media (max-width: 47.99rem) {
  .theme-color-dialog {
    inline-size: min(100%, 31rem);
    max-block-size: calc(100dvh - max(1rem, env(safe-area-inset-top)));
    margin-block: auto 0;
    border-end-start-radius: 0;
    border-end-end-radius: 0;
  }
  .theme-color-frame { padding-block-end: max(.8rem, env(safe-area-inset-bottom)); }
  .theme-color-code input { font-size: 16px; }
}
@media (forced-colors: active) {
  .theme-color-dialog input[type=range] { appearance: auto; }
  .theme-color-spectrum { outline-offset: 3px; }
}
