/* dialkit.css — DialKit controls, recoloured with the Interfaces (Artifact) tokens.
   Component rules below the token block are a verbatim port of joshpuckett/dialkit v2.0.1
   src/styles/theme.css (MIT © Josh Puckett), with two substitutions: the sans stack is our
   --font-sans (Inter) and Geist Mono is our --font-mono. Geometry, states and motion are his.
   Colour: DialKit is one ink at five opacities on one ground. Here the ink is --gray-1200 and
   the ground is --gray-background, so the panel follows the app theme (light and dark). */
:root { --dial-pop-bg: #ffffff; --dial-pop-shadow: 0 0 0 1px #0000000f, 0 8px 24px -6px #0000001f, 0 2px 6px -2px #0000000f; }
:root[data-theme="dark"] { --dial-pop-bg: #1a1a1a; --dial-pop-shadow: 0 0 0 1px #ffffff14, 0 8px 24px #00000066; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --dial-pop-bg: #1a1a1a; --dial-pop-shadow: 0 0 0 1px #ffffff14, 0 8px 24px #00000066; } }
.dialkit-root, .dialkit-select-dropdown, .dialkit-image-popover {
  --dial-ink: var(--gray-1200);
  --dial-glass-bg: var(--gray-background);
  --dial-dropdown-bg: var(--dial-pop-bg);
  --dial-surface: color-mix(in srgb, var(--dial-ink) 5%, transparent);
  --dial-surface-hover: color-mix(in srgb, var(--dial-ink) 9%, transparent);
  --dial-surface-active: color-mix(in srgb, var(--dial-ink) 11%, transparent);
  --dial-surface-subtle: color-mix(in srgb, var(--dial-ink) 6%, transparent);
  --dial-text-root: var(--gray-1200);
  --dial-text-section: var(--gray-1100);
  --dial-text-label: var(--gray-1100);
  --dial-text-focus: var(--gray-1200);
  --dial-text-primary: var(--gray-1200);
  --dial-text-secondary: var(--gray-1000);
  --dial-text-tertiary: var(--gray-900);
  --dial-border: color-mix(in srgb, var(--dial-ink) 10%, transparent);
  --dial-border-hover: color-mix(in srgb, var(--dial-ink) 15%, transparent);
  --dial-focus-ring: color-mix(in srgb, var(--dial-ink) 58%, transparent);
  --dial-row-height: 36px; --dial-row-gap: 6px; --dial-radius: 8px; --dial-backdrop-blur: 20px;
  --dial-shadow: var(--dial-pop-shadow); --dial-shadow-dropdown: var(--dial-pop-shadow);
  --dial-shadow-toggle-thumb: none;
  font-family: var(--font-sans); font-feature-settings: var(--font-features);
}

/* Dialkit Theme - Dark glassmorphic design */
.dialkit-root {
  position: relative;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.dialkit-panel {
  position: fixed;
  z-index: 9999;
  max-height: calc(100vh - 32px);
  overflow: visible;
}

/* Folder */
.dialkit-folder {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--dial-surface-subtle);
}

.dialkit-folder:last-child:not(.dialkit-folder-root) {
  padding-bottom: 0;
  margin-bottom: 0;
}

.dialkit-folder-root {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.dialkit-panel-header {
  padding-bottom: 6px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--dial-surface-subtle);
}

.dialkit-panel:not([data-mode="inline"]) .dialkit-panel-inner:not([data-collapsed="true"]) > .dialkit-folder-root > .dialkit-panel-header {
  cursor: grab;
}

.dialkit-panel:not([data-mode="inline"]) .dialkit-panel-inner:not([data-collapsed="true"]) > .dialkit-folder-root > .dialkit-panel-header:active {
  cursor: grabbing;
}

.dialkit-panel:not([data-mode="inline"]) .dialkit-panel-inner:not([data-collapsed="true"]) .dialkit-panel-icon {
  color: var(--dial-text-label);
  opacity: 0.6;
}

.dialkit-panel:not([data-mode="inline"]) .dialkit-panel-icon {
  cursor: pointer;
}

.dialkit-folder-header {
  cursor: pointer;
  user-select: none;
}

.dialkit-folder-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 8px 0;
}

.dialkit-folder-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--dial-text-section);
  letter-spacing: -0.01em;
  transform: translateY(-0.5px);
  transition: color 0.15s;
}

.dialkit-folder-title-root {
  font-size: 15px;
  font-weight: 600;
  color: var(--dial-text-root);
  transform: translateZ(0);
}

.dialkit-folder-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
}

.dialkit-folder-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}

.dialkit-folder-copy svg {
  width: 14px;
  height: 14px;
  color: var(--dial-text-section);
}

.dialkit-folder-icon {
  width: 20px;
  height: 20px;
  padding: 2px;
  box-sizing: border-box;
  flex-shrink: 0;
  color: var(--dial-text-label);
  opacity: 0.6;
}

.dialkit-panel-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 16px;
  height: 16px;
  color: var(--dial-text-focus);
  z-index: 1;
}

.dialkit-folder-content {
  will-change: transform;
}

/* Clip layout overflow as well as paint while a folder folds. A clip-path alone
   leaves its full contents in the outer scroll range until they unmount. */
.dialkit-folder:not(.dialkit-folder-root) > .dialkit-folder-content {
  overflow-y: clip;
}

.dialkit-folder-inner {
  display: flex;
  flex-direction: column;
  gap: var(--dial-row-gap);
  padding-bottom: 10px;
}

/* Non-root folders - top & bottom HR dividers */
.dialkit-folder:not(.dialkit-folder-root) {
  border-top: 1px solid var(--dial-surface-subtle);
  border-bottom: 1px solid var(--dial-surface-subtle);
  margin-top: 4px;
  margin-bottom: 4px;
  padding-bottom: 0;
}

.dialkit-folder:not(.dialkit-folder-root):last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* Adjacent non-root folders collapse gap and share a single divider */
.dialkit-folder:not(.dialkit-folder-root) + .dialkit-folder:not(.dialkit-folder-root) {
  margin-top: -10px;
  border-top: none;
}

/* Non-root folder header - match row height */
.dialkit-folder:not(.dialkit-folder-root) > .dialkit-folder-header {
  height: var(--dial-row-height);
  padding: 0;
}

.dialkit-folder:not(.dialkit-folder-root) > .dialkit-folder-header > .dialkit-folder-header-top {
  padding: 0;
  height: 100%;
}

/* Root folder inner needs no extra bottom padding */
.dialkit-folder-root > .dialkit-folder-content > .dialkit-folder-inner {
  padding-bottom: 0;
}

/* A sole group that comes first can share the panel header's divider. */
.dialkit-folder-root > .dialkit-folder-content > .dialkit-folder-inner > .dialkit-folder:first-child:not(:has(~ .dialkit-folder)) {
  border-top: none;
  margin-top: 0;
}

.dialkit-panel[data-multiple="true"] .dialkit-panel-inner:not([data-collapsed="true"]) {
  padding: 0 12px;
}

.dialkit-panel[data-multiple="true"] .dialkit-panel-inner:not([data-collapsed="true"]) .dialkit-panel-icon {
  top: 14px;
}

.dialkit-panel[data-multiple="true"] .dialkit-folder-root > .dialkit-panel-header {
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

.dialkit-panel[data-multiple="true"] .dialkit-folder-root > .dialkit-panel-header > .dialkit-folder-header-top,
.dialkit-panel[data-multiple="true"] .dialkit-folder-root > .dialkit-folder-content > .dialkit-folder-inner > .dialkit-folder > .dialkit-folder-header > .dialkit-folder-header-top {
  height: 44px;
  padding: 0;
}

.dialkit-panel[data-multiple="true"] .dialkit-folder-root > .dialkit-folder-content > .dialkit-folder-inner > .dialkit-folder > .dialkit-folder-header {
  height: auto;
}

.dialkit-panel[data-multiple="true"] .dialkit-folder-root > .dialkit-folder-content > .dialkit-folder-inner {
  gap: 0;
}

.dialkit-panel[data-multiple="true"] .dialkit-folder-root > .dialkit-folder-content > .dialkit-folder-inner > .dialkit-folder {
  margin: 0;
  padding-bottom: 0;
  border-top: 1px solid var(--dial-surface-subtle);
  border-bottom: none;
}

.dialkit-panel[data-multiple="true"] .dialkit-folder-root > .dialkit-folder-content > .dialkit-folder-inner > .dialkit-folder > .dialkit-folder-header .dialkit-folder-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  color: var(--dial-text-root);
  transform: translateZ(0);
}

.dialkit-panel[data-multiple="true"] .dialkit-folder-title-root {
  line-height: 20px;
}

.dialkit-panel[data-multiple="true"] .dialkit-folder-root > .dialkit-folder-content > .dialkit-folder-inner > .dialkit-folder:first-child {
  border-top: none;
  margin-top: 0;
}

.dialkit-panel[data-multiple="true"] .dialkit-folder-root > .dialkit-folder-content > .dialkit-folder-inner > .dialkit-folder + .dialkit-folder {
  margin-top: 0;
}

.dialkit-panel[data-multiple="true"] .dialkit-folder-root > .dialkit-folder-content > .dialkit-folder-inner > .dialkit-folder > .dialkit-folder-content > .dialkit-folder-inner {
  padding-top: 0;
  padding-bottom: 12px;
}

/* Only registered panels stick; ordinary folders remain part of the content. */
.dialkit-panel .dialkit-folder.dialkit-folder-section > .dialkit-folder-header {
  position: sticky;
  top: var(--dial-panel-header-height, 0px);
  z-index: 2;
  height: auto;
  background: var(--dial-glass-bg);
}

.dialkit-folder-section {
  --dial-section-header-height: calc(44px + var(--dial-row-height) + 10px);
}

/* Keyboard navigation must reveal controls below both pinned header rows. */
.dialkit-folder-inner :is(button, input, textarea, [tabindex]) {
  scroll-margin-top: calc(var(--dial-panel-header-height, 0px) + var(--dial-section-header-height, 0px) + var(--dial-row-gap));
}

.dialkit-folder.dialkit-folder-section > .dialkit-folder-header > .dialkit-folder-header-top {
  height: var(--dial-row-height);
}

.dialkit-panel-section-toolbar-clip {
  overflow-y: clip;
}

.dialkit-folder-section > .dialkit-folder-header > .dialkit-panel-section-toolbar-clip > .dialkit-panel-section-toolbar {
  padding-top: 4px;
  padding-bottom: var(--dial-row-gap);
  box-sizing: content-box;
}

.dialkit-panel-toolbar:empty,
.dialkit-panel-section-toolbar:empty {
  display: none;
}

/* Content spacing handled by folder-inner gap */

/* Slider */
.dialkit-slider-wrapper {
  position: relative;
  height: var(--dial-row-height);
}

.dialkit-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  background: var(--dial-surface);
  border-radius: var(--dial-radius);
  touch-action: none;
}

.dialkit-slider-hashmarks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dialkit-slider-hashmark {
  position: absolute;
  top: 50%;
  width: 1px;
  height: 8px;
  border-radius: 999px;
  transform: translateX(-50%) translateY(-50%);
  background: rgba(255, 255, 255, 0);
  transition: background 200ms;
}

.dialkit-slider-active .dialkit-slider-hashmark {
  background: var(--dial-border-hover);
}

.dialkit-slider-active .dialkit-slider-value {
  color: var(--dial-text-focus);
}

.dialkit-slider-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--dial-surface-active);
  transition: background 0.15s;
  pointer-events: none;
}

.dialkit-slider-active .dialkit-slider-fill {
  background: var(--dial-border-hover);
}

.dialkit-slider-handle {
  position: absolute;
  top: 50%;
  width: 3px;
  height: 20px;
  border-radius: 999px;
  background: var(--dial-text-primary);
  pointer-events: none;
}

.dialkit-slider-label {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(calc(-50% - 0.5px));
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-label);
  pointer-events: none;
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
}

.dialkit-slider-value {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(calc(-50% + 0.5px));
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--dial-text-label);
  pointer-events: auto;
  transition: color 0.15s, border-color 0.15s;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

.dialkit-slider-value-editable {
  border-bottom-color: var(--dial-text-label);
}

.dialkit-slider-input {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4ch;
  min-width: 3ch;
  max-width: 6ch;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-mono);
  color: var(--dial-text-label);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--dial-text-label);
  padding: 0 0 1px 0;
  outline: none;
  text-align: right;
}

.dialkit-slider-input:focus {
  color: var(--dial-text-focus);
}

/* Segmented Control */
.dialkit-segmented {
  position: relative;
  display: flex;
  padding: 2px;
  background: transparent;
  border-radius: var(--dial-radius);
}

.dialkit-segmented-pill {
  position: absolute;
  top: 2px;
  bottom: 2px;
  background: var(--dial-surface-active);
  border-radius: 6px;
  z-index: 0;
  pointer-events: none;
}

.dialkit-segmented-button {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
}

.dialkit-segmented-button[data-active="true"] {
  color: var(--dial-text-primary);
}

.dialkit-segmented-button[data-active="false"] {
  color: var(--dial-text-label);
}

/* Toggle */
.dialkit-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--dial-surface);
  border-radius: var(--dial-radius);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.dialkit-toggle:hover {
  background: var(--dial-surface-hover);
}

.dialkit-toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-label);
  transition: color 0.15s;
}

.dialkit-toggle[data-checked="true"] .dialkit-toggle-label {
  color: var(--dial-text-primary);
}

.dialkit-toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--dial-surface-active);
  transition: background 0.2s;
  position: relative;
}

.dialkit-toggle[data-checked="true"] .dialkit-toggle-track {
  background: var(--dial-border-hover);
}

.dialkit-toggle-thumb {
  position: absolute;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--dial-text-primary);
}

/* Button Group */
.dialkit-button-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dialkit-button {
  flex: 1;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-secondary);
  background: var(--dial-surface);
  border: none;
  border-radius: var(--dial-radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dialkit-button:hover {
  background: var(--dial-surface-hover);
  color: var(--dial-text-primary);
}

.dialkit-button:active {
  background: var(--dial-surface-active);
}

/* Labeled Control Row (label + control side by side) */
.dialkit-labeled-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--dial-row-height);
  padding: 2px 10px 2px 12px;
  background: var(--dial-surface);
  border-radius: var(--dial-radius);
}

.dialkit-labeled-control-label {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-label);
  flex-shrink: 0;
  line-height: 17px;
}

.dialkit-labeled-control .dialkit-segmented {
  flex-shrink: 0;
  margin-right: -6px;
}

.dialkit-action-button {
  width: 160px;
  flex-shrink: 0;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-secondary);
  background: var(--dial-surface);
  border: none;
  border-radius: var(--dial-radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dialkit-action-button:hover {
  background: var(--dial-surface-hover);
  color: var(--dial-text-primary);
}

.dialkit-action-button:active {
  background: var(--dial-surface-active);
}

.dialkit-actions-group {
  align-items: flex-start;
}

.dialkit-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 160px;
}


/* Panel Wrapper (contains panel + toolbar) */
.dialkit-panel-wrapper {
  display: inline-flex;
  flex-direction: column;
}

/* Panel Toolbar */
.dialkit-panel-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--dial-row-height);
  margin-bottom: 6px;
  min-width: 0;
  overflow: hidden;
}

.dialkit-panel-section-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: var(--dial-row-height);
  min-width: 0;
  overflow: hidden;
}

.dialkit-toolbar-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--dial-row-height);
  height: var(--dial-row-height);
  padding: 0;
  flex-shrink: 0;
  background: var(--dial-surface);
  border: none;
  border-radius: var(--dial-radius);
  cursor: pointer;
  transition: background 0.15s;
}

.dialkit-toolbar-add:hover {
  background: var(--dial-surface-hover);
}

.dialkit-timeline-toolbar-toggle[data-active] {
  background: var(--dial-surface-active);
  color: var(--dial-text-root);
}

.dialkit-toolbar-add svg {
  width: 16px;
  height: 16px;
  color: var(--dial-text-label);
}

.dialkit-timeline-toolkit-only {
  height: var(--dial-row-height);
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--dial-radius);
  background: var(--dial-surface-subtle);
  color: var(--dial-text-secondary);
  font-size: 12px;
}

.dialkit-toolbar-copy {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--dial-row-height);
  padding: 0 12px;
  flex-shrink: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-label);
  background: var(--dial-surface);
  border: none;
  border-radius: var(--dial-radius);
  cursor: pointer;
  transition: background 0.15s;
}

.dialkit-toolbar-copy:hover {
  background: var(--dial-surface-hover);
}

.dialkit-toolbar-copy-icon-wrap {
  position: relative;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.dialkit-toolbar-copy-icon {
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
}


/* Text Control */
.dialkit-text-control {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  height: var(--dial-row-height);
  min-height: var(--dial-row-height);
  /* Hidden overflow still lets caret navigation scroll this animated row. */
  overflow: clip;
  padding: calc((var(--dial-row-height) - 18px) / 2) 12px;
  background: var(--dial-surface);
  border-radius: var(--dial-radius);
}

.dialkit-text-label {
  line-height: 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-label);
  flex-shrink: 0;
}

.dialkit-text-input {
  display: block;
  box-sizing: border-box;
  margin: 0;
  margin-right: calc(-1 * var(--dial-text-gutter, 0px));
  flex: 1;
  width: 0;
  min-width: 0;
  height: 18px;
  line-height: 18px;
  resize: none;
  overflow: hidden;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  scrollbar-color: var(--dial-text-tertiary) transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-label);
  background: transparent;
  border: none;
  padding: 0;
  outline: none;
  text-align: right;
  cursor: text;
}

.dialkit-text-control[data-autosized] {
  transition: height 180ms cubic-bezier(0.2, 0, 0, 1);
}

.dialkit-text-input::-webkit-scrollbar { width: 6px; }
.dialkit-text-input::-webkit-scrollbar-track { background: transparent; }
.dialkit-text-input::-webkit-scrollbar-thumb {
  background: var(--dial-text-tertiary);
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .dialkit-text-control[data-autosized] { transition: none; }
}

.dialkit-text-input:focus {
  color: var(--dial-text-focus);
}

.dialkit-text-input:focus-visible {
  background-image: linear-gradient(var(--dial-focus-ring), var(--dial-focus-ring));
  background-repeat: no-repeat;
  background-position: 4px bottom;
  background-size: calc(100% - var(--dial-text-gutter, 0px) - 4px) 1px;
}

.dialkit-text-input::placeholder {
  color: var(--dial-text-tertiary);
}

/* Select Control - Full-width row */
.dialkit-select-row {
}

.dialkit-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--dial-row-height);
  padding: 0 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-label);
  background: var(--dial-surface);
  border: none;
  border-radius: var(--dial-radius);
  cursor: pointer;
  transition: background 0.15s;
}

.dialkit-select-trigger:hover {
  background: var(--dial-surface-hover);
}

.dialkit-select-trigger[data-open="true"] {
  background: var(--dial-surface-active);
}

.dialkit-select-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-label);
  flex-shrink: 0;
  transform: translateY(-0.5px);
}

.dialkit-select-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dialkit-select-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-label);
  transform: translateY(-0.5px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialkit-select-chevron {
  width: 20px;
  height: 20px;
  padding: 2px;
  box-sizing: border-box;
  flex-shrink: 0;
  opacity: 0.6;
}

/* Select Dropdown (portaled to body) */
.dialkit-select-dropdown {
  margin: 0;
  inset: auto;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--dial-border-hover) transparent;
  background: var(--dial-glass-bg);
  border: 1px solid var(--dial-border);
  border-radius: var(--dial-radius);
  padding: 4px;
  z-index: 10000;
  box-shadow: var(--dial-shadow-dropdown);
}

.dialkit-select-option {
  min-height: 36px;
  display: block;
  width: 100%;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-label);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.dialkit-select-option:hover {
  background: var(--dial-surface-hover);
}

.dialkit-select-option[data-selected="true"] {
  color: var(--dial-text-primary);
  background: var(--dial-surface-active);
}


/* Image selector: shared by React, Solid, Vue, and Svelte. */
.dialkit-image-control {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: var(--dial-row-height);
  padding: 0 6px 0 12px;
  border: 0;
  border-radius: var(--dial-radius);
  background: var(--dial-surface);
  color: var(--dial-text-label);
  font: 500 13px var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.dialkit-image-control:hover { background: var(--dial-surface-hover); }
.dialkit-image-control[data-open="true"] { background: var(--dial-surface-active); box-shadow: inset 0 0 0 1px var(--dial-border-hover); color: var(--dial-text-primary); }
.dialkit-image-label { flex-shrink: 0; }
.dialkit-image-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; color: var(--dial-text-secondary); font-size: 12px; }
.dialkit-image-frame { position: relative; display: block; overflow: hidden; border-radius: var(--dial-radius); background: repeating-conic-gradient(var(--dial-surface) 0% 25%, transparent 0% 50%) 0 / 12px 12px, var(--dial-surface); }
.dialkit-image-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dialkit-image-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dial-text-tertiary); }
.dialkit-image-fallback svg { width: 24px; height: 24px; }
.dialkit-image-thumbnail { flex: 0 0 38px; height: 26px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--dial-border); }
.dialkit-image-thumbnail svg { width: 16px; height: 16px; }
.dialkit-image-popover {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: fixed;
  margin: 0;
  inset: auto;
  z-index: 10002;
  box-sizing: border-box;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--dial-border-hover) transparent;
  border: 1px solid var(--dial-border);
  border-radius: 14px;
  background: var(--dial-glass-bg);
  box-shadow: var(--dial-shadow);
  color: var(--dial-text-label);
  font: 500 13px var(--font-sans);
  animation: dialkit-color-enter 0.16s ease-out;
}
.dialkit-image-popover *, .dialkit-image-popover *::before, .dialkit-image-popover *::after { box-sizing: border-box; }
.dialkit-image-popover > * { flex-shrink: 0; }
.dialkit-image-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.dialkit-image-title { color: var(--dial-text-primary); }
.dialkit-image-clear { margin: -4px -4px -4px 0; padding: 4px; border: 0; border-radius: 4px; background: none; color: var(--dial-text-tertiary); font: inherit; font-size: 11px; cursor: pointer; }
.dialkit-image-clear:hover { color: var(--dial-text-primary); }
.dialkit-image-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--dial-row-gap); }
.dialkit-image-option { position: relative; display: block; width: 100%; padding: 3px; border: 1px solid transparent; border-radius: calc(var(--dial-radius) + 3px); background: transparent; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.dialkit-image-option-preview { width: 100%; aspect-ratio: 4 / 3; border-radius: calc(var(--dial-radius) - 1px); }
.dialkit-image-option:hover { background: var(--dial-surface-hover); border-color: var(--dial-border-hover); }
.dialkit-image-option[aria-pressed="true"] { border-color: var(--dial-text-label); background: var(--dial-surface-active); }
.dialkit-image-upload { display: flex; flex: none; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.dialkit-image-upload svg { width: 15px; height: 15px; }
.dialkit-image-popover[data-dragging="true"] .dialkit-image-upload { background: var(--dial-surface-hover); color: var(--dial-text-primary); }
.dialkit-image-upload[aria-disabled="true"] { opacity: 0.6; cursor: progress; }
.dialkit-image-empty { padding: 28px 12px; border-radius: var(--dial-radius); background: var(--dial-surface); color: var(--dial-text-tertiary); font-weight: 400; text-align: center; }
.dialkit-image-status { font-size: 11px; font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; }
.dialkit-image-popover [hidden], .dialkit-image-frame [hidden], .dialkit-image-file { display: none; }
@media (prefers-reduced-motion: reduce) { .dialkit-image-popover { animation: none; } }

/* Color Control */
.dialkit-color-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--dial-row-height);
  padding: 0 12px;
  background: var(--dial-surface);
  border-radius: var(--dial-radius);
  transition: background 0.15s, box-shadow 0.15s;
}

.dialkit-color-control[data-open="true"] {
  background: var(--dial-surface-active);
  box-shadow: inset 0 0 0 1px var(--dial-border-hover);
}
.dialkit-color-control[data-open="true"] .dialkit-color-label,
.dialkit-color-control[data-open="true"] .dialkit-color-value { color: var(--dial-text-primary); }

.dialkit-color-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-label);
  flex-shrink: 0;
  transform: translateY(-0.5px);
}

.dialkit-color-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Color picker: shared by React, Solid, Vue, and Svelte. */
.dialkit-color-inputs { min-width: 0; flex: 1; justify-content: flex-end; }
.dialkit-color-value {
  min-width: 0;
  width: 100%;
  padding: 4px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--dial-text-label);
  font: 500 13px var(--font-mono);
  text-align: right;
  text-overflow: ellipsis;
}
.dialkit-color-value:focus { color: var(--dial-text-focus); }
.dialkit-color-swatch {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 5px;
  border: 1px solid var(--dial-border-hover);
  background: linear-gradient(var(--dial-color), var(--dial-color)), repeating-conic-gradient(#aaa 0% 25%, #eee 0% 50%) 0 / 8px 8px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%);
  cursor: pointer;
  transition: transform 0.15s;
}
.dialkit-color-swatch:hover { transform: scale(1.08); }
.dialkit-color-popover {
  display: grid;
  gap: var(--dial-row-gap);
  position: fixed;
  margin: 0;
  inset: auto;
  z-index: 10002;
  box-sizing: border-box;
  padding: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  border: 1px solid var(--dial-border);
  border-radius: 14px;
  background: var(--dial-glass-bg);
  box-shadow: var(--dial-shadow);
  color: var(--dial-text-label);
  animation: dialkit-color-enter 0.16s ease-out;
}
.dialkit-color-popover *, .dialkit-color-popover *::before, .dialkit-color-popover *::after { box-sizing: border-box; }
.dialkit-color-plane { position: relative; height: 160px; border-radius: var(--dial-radius); touch-action: none; cursor: crosshair; user-select: none; }
.dialkit-color-canvas { display: block; width: 100%; height: 100%; border-radius: inherit; }
.dialkit-color-plane::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 10%); pointer-events: none; }
.dialkit-color-marker { position: absolute; z-index: 1; width: 12px; height: 12px; margin: -6px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 2px 4px rgb(0 0 0 / 30%); pointer-events: none; }
.dialkit-color-tracks { display: grid; gap: var(--dial-row-gap); }
.dialkit-color-track-row { display: flex; align-items: center; gap: 12px; height: var(--dial-row-height); padding: 0 12px; border-radius: var(--dial-radius); background: var(--dial-surface); font-size: 13px; font-weight: 500; }
.dialkit-color-track-row > span { flex: 0 0 52px; color: var(--dial-text-label); }
.dialkit-color-track {
  -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 100%; padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer; touch-action: none;
}
.dialkit-color-hue {
  --dial-color-thumb-bg: var(--dial-color-thumb);
}
.dialkit-color-opacity {
  --dial-color-track-bg: linear-gradient(to right, transparent, var(--dial-color-opaque)), repeating-conic-gradient(#aaa 0% 25%, #eee 0% 50%) 0 / 8px 8px;
  --dial-color-thumb-bg: linear-gradient(var(--dial-color-thumb), var(--dial-color-thumb)), repeating-conic-gradient(#aaa 0% 25%, #eee 0% 50%) 0 / 8px 8px;
}
.dialkit-color-track::-webkit-slider-runnable-track { height: 16px; border-radius: 4px; background: var(--dial-color-track-bg); }
.dialkit-color-track::-moz-range-track { height: 16px; border: 0; border-radius: 4px; background: var(--dial-color-track-bg); }
.dialkit-color-track::-webkit-slider-thumb { -webkit-appearance: none; box-sizing: border-box; width: 16px; height: 24px; margin-top: -4px; border-radius: 5px; background: var(--dial-color-thumb-bg); background-clip: padding-box; border: 2px solid white; box-shadow: 0 2px 4px rgb(0 0 0 / 30%); }
.dialkit-color-track::-moz-range-thumb { box-sizing: border-box; width: 16px; height: 24px; border-radius: 5px; background: var(--dial-color-thumb-bg); background-clip: padding-box; border: 2px solid white; box-shadow: 0 2px 4px rgb(0 0 0 / 30%); }
/* The same row, buttons, and pill as Enabled, with no label and equal segments. */
.dialkit-color-format-row { padding: 2px; }
.dialkit-color-format-row .dialkit-color-formats { flex: 1; min-width: 0; margin-right: 0; }
.dialkit-color-formats .dialkit-segmented-pill { left: 2px; width: calc((100% - 4px) / 3); transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1); }
.dialkit-color-format { flex: 1 1 0; min-width: 0; white-space: nowrap; }
.dialkit-color-format:hover { color: var(--dial-text-primary); }
.dialkit-color-css-input { display: block; width: 100%; height: var(--dial-row-height); padding: 0 12px; border: 0; border-radius: var(--dial-radius); background: var(--dial-surface); outline: none; color: var(--dial-text-label); font: 500 13px var(--font-mono); }
.dialkit-color-css-input:focus { color: var(--dial-text-focus); }
.dialkit-color-popover input[aria-invalid="true"], .dialkit-color-value[aria-invalid="true"] { color: #ef7777; }
@keyframes dialkit-color-enter { from { opacity: 0; transform: translateY(3px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .dialkit-color-popover { animation: none; }
  .dialkit-color-formats .dialkit-segmented-pill { transition: none; }
}


/* Preset Manager */
.dialkit-preset-manager {
  position: relative;
  flex: 1;
}

.dialkit-preset-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--dial-row-height);
  padding: 0 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-label);
  background: var(--dial-surface);
  border: none;
  border-radius: var(--dial-radius);
  cursor: pointer;
  transition: background 0.15s;
}

.dialkit-preset-trigger:hover {
  background: var(--dial-surface-hover);
}

.dialkit-preset-trigger[data-disabled="true"] {
  cursor: default;
}

.dialkit-preset-trigger[data-disabled="true"]:hover {
  background: var(--dial-surface);
}

.dialkit-preset-trigger[data-open="true"] {
  background: var(--dial-surface-active);
}

.dialkit-preset-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialkit-preset-dropdown {
  margin: 0;
  inset: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  width: max-content;
  background: var(--dial-dropdown-bg);
  border: 1px solid var(--dial-border);
  border-radius: 12px;
  padding: 4px;
  z-index: 10000;
  box-shadow: var(--dial-shadow-dropdown);
}

.dialkit-preset-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--dial-border);
}

.dialkit-preset-item {
  box-sizing: border-box;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  gap: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.dialkit-preset-item + .dialkit-preset-item {
  margin-top: 2px;
}

.dialkit-preset-item:hover {
  background: var(--dial-surface-hover);
}

.dialkit-preset-item[data-active="true"] {
  background: var(--dial-surface-active);
}

.dialkit-preset-name {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialkit-preset-item[data-active="true"] .dialkit-preset-name {
  color: var(--dial-text-primary);
}

.dialkit-preset-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.dialkit-preset-item:hover .dialkit-preset-delete {
  opacity: 0.6;
}

.dialkit-preset-item:focus-within .dialkit-preset-delete { opacity: 0.6; }
.dialkit-preset-item:focus-within { background: var(--dial-surface-hover); }

.dialkit-preset-delete:hover {
  opacity: 1 !important;
}

.dialkit-preset-delete svg {
  transition: color 150ms ease;
  width: 14px;
  height: 14px;
  color: var(--dial-text-focus);
  pointer-events: none;
}

.dialkit-preset-delete:hover svg {
  color: #ff3b30;
}

.dialkit-preset-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--dial-text-label);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dialkit-preset-save-btn:hover {
  background: var(--dial-surface-hover);
  color: var(--dial-text-primary);
}

.dialkit-preset-save-btn svg {
  width: 12px;
  height: 12px;
}

.dialkit-preset-save-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
}

.dialkit-preset-input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--dial-text-primary);
  background: var(--dial-surface);
  border: 1px solid var(--dial-border);
  border-radius: 6px;
  outline: none;
}

.dialkit-preset-input:focus {
  border-color: var(--dial-text-label);
}

.dialkit-preset-input::placeholder {
  color: var(--dial-text-tertiary);
}

.dialkit-preset-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: var(--dial-surface);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.dialkit-preset-confirm:hover:not(:disabled) {
  background: var(--dial-surface-hover);
}

.dialkit-preset-confirm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dialkit-preset-confirm svg {
  width: 14px;
  height: 14px;
  color: var(--dial-text-label);
}


/* Shortcut Pill */
.dialkit-shortcut-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--dial-text-tertiary);
  background: var(--dial-surface-subtle);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 0.02em;
  line-height: 16px;
  white-space: nowrap;
  vertical-align: middle;
  transition: color 0.15s, background 0.15s;
}

.dialkit-shortcut-pill-active {
  color: var(--dial-text-primary);
  background: var(--dial-border-hover);
}


/* Keyboard focus stays inside each control so scrolling never clips its edge. */
.dialkit-root :where(button, input, textarea, [tabindex]):focus {
  outline: none;
}
.dialkit-root :where(button, [role="slider"], [role="button"], .dialkit-color-plane, .dialkit-pad-surface):focus-visible {
  outline: 2px solid var(--dial-focus-ring);
  outline-offset: -2px;
}
.dialkit-folder-header-top[role="button"] { border-radius: 5px; }
.dialkit-panel-inner[data-collapsed="true"] .dialkit-folder-header-top { border-radius: 50%; }
.dialkit-slider:focus-visible .dialkit-slider-value,
.dialkit-slider:focus-within .dialkit-slider-value { color: var(--dial-text-focus); }
.dialkit-slider:focus-visible .dialkit-slider-fill { background: var(--dial-border-hover); }
.dialkit-select-option:focus-visible { background: var(--dial-surface-hover); color: var(--dial-text-focus); }
.dialkit-root :where(.dialkit-slider-input, .dialkit-color-value, .dialkit-preset-input):focus-visible {
  box-shadow: inset 0 -1px var(--dial-focus-ring);
}
.dialkit-color-css-input:focus-visible { outline: none; }
.dialkit-shortcuts-dropdown { margin: 0; inset: auto; overflow-y: auto; }
@media (forced-colors: active) {
  .dialkit-root { --dial-focus-ring: Highlight; }
}

/* Primary panel copy action */
.dialkit-toolbar-primary {
  background: var(--dial-text-root);
  color: var(--dial-glass-bg);
}

.dialkit-toolbar-primary:hover {
  background: color-mix(in srgb, var(--dial-text-root) 88%, var(--dial-glass-bg));
}

.dialkit-toolbar-primary svg {
  color: inherit;
}

.dialkit-preset-check {
  width: 14px;
