/* DGCS Studio components. Every color, space, radius and shadow comes from tokens.css.
   Application UI only: never apply these classes inside customer sign artwork. */

/* ---------- Button base (shared by Button and IconButton) ---------- */
.dg-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  box-sizing: border-box;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-button);
  outline: 2px solid transparent; /* becomes visible in Windows High Contrast */
  outline-offset: 2px;
  transition: background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out, box-shadow 140ms ease-out;
}
.dg-btn__label { display: inline-block; }
.dg-btn__icon { display: inline-flex; flex: none; }
.dg-btn__icon svg { width: var(--icon-size-sm); height: var(--icon-size-sm); display: block; }

/* Sizes: type follows control-label (sm), button-text (md), body-size 500 (lg) */
.dg-btn--sm { min-height: var(--control-height-sm); padding: 0 var(--space-3); gap: var(--space-1\.5); }
.dg-btn--md { min-height: var(--control-height-md); padding: 0 var(--space-4); }
.dg-btn--lg { min-height: var(--control-height-lg); padding: 0 var(--space-5); line-height: 1.25rem; }
.dg-btn--sm .dg-btn__icon svg { width: var(--icon-size-xs); height: var(--icon-size-xs); }
.dg-btn--lg .dg-btn__icon svg { width: var(--icon-size-md); height: var(--icon-size-md); }
.dg-btn--block { display: flex; width: 100%; }

/* ---------- Variants ---------- */
.dg-btn--primary { background: var(--action-primary); color: var(--action-primary-text); }
.dg-btn--primary:hover:not(:disabled):not(.is-loading), .dg-btn--primary[data-state="hover"] { background: var(--action-primary-hover); }
.dg-btn--primary:active:not(:disabled):not(.is-loading), .dg-btn--primary[data-state="pressed"] { background: var(--action-primary-pressed); }

.dg-btn--secondary { background: var(--action-secondary); color: var(--action-secondary-text); border-color: var(--border-default); }
.dg-btn--secondary:hover:not(:disabled):not(.is-loading), .dg-btn--secondary[data-state="hover"] { background: var(--action-secondary-hover); border-color: var(--border-strong); box-shadow: var(--shadow-button-hover); }
.dg-btn--secondary:active:not(:disabled):not(.is-loading), .dg-btn--secondary[data-state="pressed"] { background: var(--action-secondary-pressed); border-color: var(--border-strong); box-shadow: var(--shadow-button-pressed); }

.dg-btn--tertiary { background: transparent; color: var(--text-primary); }
.dg-btn--tertiary:hover:not(:disabled):not(.is-loading), .dg-btn--tertiary[data-state="hover"] { background: var(--action-ghost-hover); }
.dg-btn--tertiary:active:not(:disabled):not(.is-loading), .dg-btn--tertiary[data-state="pressed"] { background: var(--action-ghost-pressed); }

/* Destructive: hover/pressed deepen error-solid; white label stays above 5:1 */
.dg-btn--destructive { background: var(--error-solid); color: var(--error-on-solid); }
.dg-btn--destructive:hover:not(:disabled):not(.is-loading), .dg-btn--destructive[data-state="hover"] { background: var(--error-solid-hover); }
.dg-btn--destructive:active:not(:disabled):not(.is-loading), .dg-btn--destructive[data-state="pressed"] { background: var(--error-solid-pressed); }

/* ---------- Focus (keyboard only) ---------- */
.dg-btn:focus-visible, .dg-btn[data-state="focus"] { box-shadow: var(--shadow-focus); }

/* ---------- Disabled ---------- */
.dg-btn:disabled { background: var(--action-disabled); color: var(--action-disabled-text); border-color: var(--action-disabled-border); box-shadow: none; cursor: not-allowed; }
.dg-btn--tertiary:disabled { background: transparent; border-color: transparent; }

/* ---------- Loading: keeps width, label stays in the accessibility tree ---------- */
.dg-btn.is-loading { cursor: progress; }
.dg-btn.is-loading .dg-btn__label, .dg-btn.is-loading .dg-btn__icon { opacity: 0; }
.dg-spinner {
  position: absolute; top: 50%; left: 50%;
  width: 1.15em; height: 1.15em; margin: -0.575em 0 0 -0.575em;
  box-sizing: border-box; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: dg-spin 800ms linear infinite;
}
@keyframes dg-spin { to { transform: rotate(360deg); } }

/* ---------- Icon-only (circular) ---------- */
.dg-btn--icon { padding: 0; gap: 0; border-radius: var(--radius-icon-button); }
.dg-btn--icon.dg-btn--sm { width: var(--control-height-sm); height: var(--control-height-sm); min-height: var(--control-height-sm); }
.dg-btn--icon.dg-btn--md { width: var(--control-height-md); height: var(--control-height-md); min-height: var(--control-height-md); }
.dg-btn--icon.dg-btn--lg { width: var(--control-height-lg); height: var(--control-height-lg); min-height: var(--control-height-lg); }
.dg-btn--icon.dg-btn--md .dg-btn__icon svg { width: var(--icon-size-md); height: var(--icon-size-md); }
.dg-btn--icon.dg-btn--lg .dg-btn__icon svg { width: var(--icon-size-lg); height: var(--icon-size-lg); }

/* ---------- Toolbar button (rounded square) ---------- */
.dg-tool {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; margin: 0; padding: 0;
  border: 0; border-radius: var(--radius-toolbar-button);
  background: transparent; color: var(--text-secondary);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  outline: 2px solid transparent; outline-offset: 2px;
  transition: background-color 120ms ease-out, color 120ms ease-out, box-shadow 120ms ease-out;
}
.dg-tool__icon { display: inline-flex; }
.dg-tool__icon svg { width: var(--icon-size-sm); height: var(--icon-size-sm); display: block; }
.dg-tool--sm { width: var(--control-height-sm); height: var(--control-height-sm); }
.dg-tool--md { width: var(--control-height-md); height: var(--control-height-md); }
.dg-tool--md .dg-tool__icon svg { width: var(--icon-size-md); height: var(--icon-size-md); }
.dg-tool--lg { width: 36px; height: 36px; border-radius: var(--radius-md); }
.dg-tool--lg .dg-tool__icon svg { width: var(--icon-size-lg); height: var(--icon-size-lg); }
.dg-tool:hover:not(:disabled), .dg-tool[data-state="hover"] { background: var(--action-ghost-hover); color: var(--text-primary); }
.dg-tool:active:not(:disabled), .dg-tool[data-state="pressed"] { background: var(--action-ghost-pressed); color: var(--text-primary); }
.dg-tool[aria-pressed="true"], .dg-tool[aria-pressed="true"]:hover:not(:disabled), .dg-tool[aria-pressed="true"]:active:not(:disabled) { background: var(--action-selected); color: var(--action-selected-text); }
.dg-tool:focus-visible, .dg-tool[data-state="focus"] { box-shadow: var(--shadow-focus); }
.dg-tool:disabled { background: transparent; color: var(--text-disabled); cursor: not-allowed; }

/* ---------- Touch: larger targets on coarse pointers ---------- */
@media (pointer: coarse) {
  .dg-btn--sm:not(.dg-btn--icon) { min-height: 36px; }
  .dg-btn--md:not(.dg-btn--icon) { min-height: var(--target-touch); }
  .dg-btn--lg:not(.dg-btn--icon) { min-height: var(--target-touch-lg); }
  /* Icon and tool buttons keep their visual size; the hit area grows to 44px */
  .dg-btn--icon::after, .dg-tool::after, .dg-btn--sm::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: max(100%, var(--target-touch)); height: max(100%, var(--target-touch));
    transform: translate(-50%, -50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dg-btn, .dg-tool { transition: none; }
  .dg-spinner { animation-duration: 1600ms; }
}

/* =====================================================================
   Inputs family: FieldGroup, TextInput, SearchInput, Textarea, Select, NumberInput
   ===================================================================== */

/* ---------- FieldGroup ---------- */
.dg-fg { display: flex; flex-direction: column; gap: var(--space-1\.5); min-width: 0; font-family: var(--font-sans); }
.dg-fg__label { font-weight: 500; color: var(--text-primary); }
.dg-fg__req { color: var(--error-text); }
.dg-fg__opt { color: var(--text-muted); font-weight: 400; }
.dg-fg__control { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.dg-fg__meta { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.dg-fg__help, .dg-fg__error { margin: 0; }
.dg-fg__help { color: var(--text-muted); }
.dg-fg__error { display: flex; gap: var(--space-1); align-items: flex-start; color: var(--error-text); font-weight: 500; }
.dg-fg__erricon { width: var(--icon-size-xs); height: var(--icon-size-xs); flex: none; margin-top: 1px; }
.dg-fg.is-disabled .dg-fg__label { color: var(--text-disabled); }
/* Inline: compact inspector rows, label left */
.dg-fg--inline { display: grid; grid-template-columns: var(--dg-label-w, 72px) minmax(0, 1fr); column-gap: var(--inspector-field-gap); align-items: start; }
.dg-fg--inline > .dg-fg__label { color: var(--text-secondary); padding-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Field box (shared) ---------- */
.dg-field {
  position: relative; display: flex; align-items: center; box-sizing: border-box; width: 100%; min-width: 0; margin: 0;
  background: var(--surface-panel); color: var(--text-primary);
  border: 1px solid var(--border-strong); border-radius: var(--radius-input);
  font-family: var(--font-sans); font-weight: 400; text-align: left;
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out, background-color 120ms ease-out;
}
.dg-field--sm { min-height: var(--control-height-sm); padding: 0 var(--space-2); gap: var(--space-1\.5); border-radius: var(--radius-inspector-field); }
.dg-field--md { min-height: var(--control-height-md); padding: 0 var(--space-3); gap: var(--space-2); }
.dg-field--lg { min-height: var(--control-height-lg); padding: 0 var(--space-3); gap: var(--space-2); }

.dg-field__input {
  flex: 1 1 auto; min-width: 0; width: 100%; margin: 0; padding: 0; border: 0; outline: none; background: transparent;
  color: inherit; font: inherit; letter-spacing: inherit;
}
.dg-field__input::placeholder { color: var(--text-muted); opacity: 1; }
.dg-field__input[type="search"]::-webkit-search-cancel-button, .dg-field__input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.dg-field--mono .dg-field__input { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.dg-field__icon { display: inline-flex; flex: none; color: var(--text-muted); }
.dg-field__icon svg { width: var(--icon-size-sm); height: var(--icon-size-sm); display: block; }
.dg-field--sm .dg-field__icon svg { width: var(--icon-size-xs); height: var(--icon-size-xs); }

/* Hover / focus / error */
.dg-field:hover:not(.is-disabled):not(.is-readonly):not(:focus-within), .dg-field[data-state="hover"] { border-color: var(--text-secondary); }
.dg-field:focus-within, .dg-field[data-state="focus"] { border-color: var(--focus-ring); box-shadow: 0 0 0 1px var(--focus-ring); outline: 2px solid transparent; }
button.dg-field:focus-visible { border-color: var(--focus-ring); box-shadow: 0 0 0 1px var(--focus-ring); outline: 2px solid transparent; }
button.dg-field:focus:not(:focus-visible):not(.is-open) { border-color: var(--border-strong); box-shadow: none; }
.dg-field.is-invalid { border-color: var(--error-text); }
.dg-field.is-invalid:focus-within, .dg-field.is-invalid[data-state="focus"], button.dg-field.is-invalid:focus-visible { border-color: var(--error-text); box-shadow: 0 0 0 1px var(--error-text); }
.dg-field.is-disabled { background: var(--action-disabled); border-color: var(--action-disabled-border); color: var(--text-disabled); cursor: not-allowed; }
.dg-field.is-disabled .dg-field__input, .dg-field.is-disabled .dg-field__icon { color: var(--text-disabled); cursor: not-allowed; }
.dg-field.is-disabled .dg-field__input::placeholder { color: var(--text-disabled); }
.dg-field.is-readonly { background: var(--surface-sunken); border-color: var(--border-default); }

/* Clear button */
.dg-field__clear {
  display: inline-flex; align-items: center; justify-content: center; flex: none; position: relative;
  width: 20px; height: 20px; margin: 0 -4px 0 0; padding: 0; border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--text-muted); cursor: pointer; outline: 2px solid transparent;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.dg-field__clear svg { width: var(--icon-size-xs); height: var(--icon-size-xs); }
.dg-field__clear:hover { background: var(--surface-hover); color: var(--text-primary); }
.dg-field__clear:focus-visible { box-shadow: var(--shadow-focus); }

/* ---------- SearchInput (pill) ---------- */
.dg-search { border-radius: var(--radius-search); }
.dg-search.dg-field--md, .dg-search.dg-field--lg { padding-left: var(--space-3); padding-right: var(--space-3); }

/* ---------- Textarea ---------- */
.dg-area-wrap { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.dg-area { align-items: stretch; padding-top: var(--space-2); padding-bottom: var(--space-2); }
.dg-area__input { min-height: 64px; line-height: inherit; display: block; }
.dg-area__count { align-self: flex-end; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-muted); }
.dg-area__count.is-near { color: var(--warning-text); }

/* ---------- Select ---------- */
.dg-select { position: relative; display: inline-flex; min-width: 0; }
.dg-select--block { display: flex; width: 100%; }
.dg-select__trigger { cursor: pointer; justify-content: space-between; -webkit-tap-highlight-color: transparent; }
.dg-select__value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-select__value.is-placeholder { color: var(--text-muted); }
.dg-select__chevron { flex: none; width: var(--icon-size-sm); height: var(--icon-size-sm); color: var(--text-secondary); transition: transform 140ms ease-out; }
.dg-field--sm .dg-select__chevron { width: var(--icon-size-xs); height: var(--icon-size-xs); }
.dg-select__trigger.is-open .dg-select__chevron { transform: rotate(180deg); }
.dg-select__trigger.is-open { border-color: var(--focus-ring); box-shadow: 0 0 0 1px var(--focus-ring); }
.dg-select__trigger.is-disabled .dg-select__chevron { color: var(--text-disabled); }


/* ---------- NumberInput ---------- */
.dg-num { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.dg-num.dg-field--sm { gap: var(--space-1); }
.dg-num__input { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: left; }
.dg-num__prefix { flex: none; min-width: 12px; font-family: var(--font-sans); font-weight: 500; color: var(--text-muted); user-select: none; line-height: inherit; }
.dg-num__unit { flex: none; font-family: var(--font-mono); font-weight: 400; color: var(--text-muted); user-select: none; }
.dg-num.has-steppers { padding-right: 2px; }
.dg-num__steps { display: flex; flex-direction: column; flex: none; align-self: stretch; justify-content: center; gap: 0; margin-left: var(--space-0\.5); }
.dg-num__step {
  display: flex; align-items: center; justify-content: center; width: 20px; flex: 1 1 0; max-height: 14px; min-height: 0;
  margin: 0; padding: 0; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.dg-field--md .dg-num__step { max-height: 15px; }
.dg-num__step svg { width: var(--icon-size-xs); height: var(--icon-size-xs); }
.dg-num__step:hover:not(:disabled) { background: var(--surface-hover); color: var(--text-primary); }
.dg-num__step:active:not(:disabled) { background: var(--surface-pressed); }
.dg-num__step:disabled { color: var(--text-disabled); cursor: default; }

/* ---------- Touch ---------- */
@media (pointer: coarse) {
  .dg-field--sm { min-height: 36px; }
  .dg-field--md { min-height: var(--target-touch); }
  .dg-field--lg { min-height: var(--target-touch-lg); }
  /* 16px text stops mobile browsers from zooming into focused fields */
  .dg-field .dg-field__input, .dg-field .dg-select__value { font-size: 1rem; }
  .dg-field--sm .dg-field__input, .dg-field--sm .dg-select__value { line-height: 1.25rem; }
  .dg-num__step { width: 28px; max-height: none; }
  .dg-field__clear::after { content: ""; position: absolute; top: 50%; left: 50%; width: var(--target-touch); height: var(--target-touch); transform: translate(-50%, -50%); }
}
@media (prefers-reduced-motion: reduce) {
  .dg-field, .dg-select__chevron, .dg-field__clear, .dg-num__step { transition: none; }
}

/* =====================================================================
   Inspector controls: Checkbox, Switch, Slider, RadioGroup, SegmentedControl
   ===================================================================== */

/* ---------- Checkbox ---------- */
.dg-check { display: inline-flex; align-items: flex-start; gap: var(--space-2); font-family: var(--font-sans); color: var(--text-primary); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dg-check__ctl { position: relative; display: inline-flex; flex: none; margin-top: 2px; }
.dg-check--sm .dg-check__ctl { margin-top: 1px; }
.dg-check__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.dg-check__box {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 16px; height: 16px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-xs); background: var(--surface-panel); color: var(--action-primary-text);
  transition: background-color 120ms ease-out, border-color 120ms ease-out, box-shadow 120ms ease-out;
}
.dg-check--sm .dg-check__box { width: 14px; height: 14px; }
.dg-check__mark { width: 12px; height: 12px; opacity: 0; transition: opacity 120ms ease-out; }
.dg-check--sm .dg-check__mark { width: 10px; height: 10px; }
.dg-check:hover:not(.is-disabled) .dg-check__box, .dg-check[data-state="hover"] .dg-check__box { border-color: var(--text-secondary); }
.dg-check__input:checked + .dg-check__box, .dg-check__input:indeterminate + .dg-check__box { background: var(--action-indicator); border-color: var(--action-indicator); }
.dg-check__input:checked + .dg-check__box .dg-check__mark, .dg-check__input:indeterminate + .dg-check__box .dg-check__mark { opacity: 1; }
.dg-check:hover:not(.is-disabled) .dg-check__input:checked + .dg-check__box, .dg-check:hover:not(.is-disabled) .dg-check__input:indeterminate + .dg-check__box,
.dg-check[data-state="hover"] .dg-check__input:checked + .dg-check__box { background: var(--action-indicator-hover); border-color: var(--action-indicator-hover); }
.dg-check__input:focus-visible + .dg-check__box, .dg-check[data-state="focus"] .dg-check__box { box-shadow: var(--shadow-focus); }
.dg-check.is-disabled { cursor: not-allowed; color: var(--text-disabled); }
.dg-check.is-disabled .dg-check__box { background: var(--action-disabled); border-color: var(--action-disabled-border); color: var(--text-disabled); }
.dg-check.is-disabled .dg-check__input:checked + .dg-check__box, .dg-check.is-disabled .dg-check__input:indeterminate + .dg-check__box { background: var(--action-disabled-border); border-color: var(--action-disabled-border); }
.dg-check__text { display: flex; flex-direction: column; min-width: 0; }
.dg-check__label { }
.dg-check--sm .dg-check__label { font-weight: 400; }
.dg-check__desc { color: var(--text-muted); }
.dg-check.is-disabled .dg-check__desc { color: var(--text-disabled); }

/* ---------- Switch ---------- */
.dg-switch {
  position: relative; flex: none; display: inline-flex; align-items: center; box-sizing: border-box; margin: 0; padding: 0;
  border: 0; border-radius: var(--radius-full); background: var(--border-strong); cursor: pointer;
  outline: 2px solid transparent; outline-offset: 2px; -webkit-tap-highlight-color: transparent;
  transition: background-color 140ms ease-out, box-shadow 140ms ease-out;
}
.dg-switch--md { width: 32px; height: 18px; }
.dg-switch--sm { width: 28px; height: 16px; }
.dg-switch__thumb {
  position: absolute; top: 2px; left: 2px; border-radius: var(--radius-full); background: var(--brand-white);
  box-shadow: var(--shadow-xs); transition: transform 140ms ease-out;
}
.dg-switch--md .dg-switch__thumb { width: 14px; height: 14px; }
.dg-switch--sm .dg-switch__thumb { width: 12px; height: 12px; }
.dg-switch[aria-checked="true"] { background: var(--action-indicator); }
.dg-switch--md[aria-checked="true"] .dg-switch__thumb { transform: translateX(14px); }
.dg-switch--sm[aria-checked="true"] .dg-switch__thumb { transform: translateX(12px); }
.dg-switch:hover:not(:disabled), .dg-switch[data-state="hover"] { background: var(--text-secondary); }
.dg-switch[aria-checked="true"]:hover:not(:disabled), .dg-switch[aria-checked="true"][data-state="hover"] { background: var(--action-indicator-hover); }
.dg-switch:focus-visible, .dg-switch[data-state="focus"] { box-shadow: var(--shadow-focus); }
.dg-switch:disabled { background: var(--action-disabled-border); cursor: not-allowed; }
.dg-switch:disabled .dg-switch__thumb { background: var(--action-disabled); box-shadow: none; }
.dg-switch-row { display: flex; align-items: center; gap: var(--space-3); font-family: var(--font-sans); color: var(--text-primary); }
.dg-switch-row.is-label-start { justify-content: space-between; }
.dg-switch-row--md { min-height: var(--target-desktop); }
.dg-switch-row--sm { min-height: 28px; }
.dg-switch-row__text { display: flex; flex-direction: column; min-width: 0; }
.dg-switch-row__label { cursor: pointer; }
.dg-switch-row--sm .dg-switch-row__label { font-weight: 400; }
.dg-switch-row__desc { color: var(--text-muted); }
.dg-switch-row.is-disabled .dg-switch-row__label, .dg-switch-row.is-disabled .dg-switch-row__desc { color: var(--text-disabled); cursor: not-allowed; }

/* ---------- Slider ---------- */
.dg-slider-wrap { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; font-family: var(--font-sans); }
.dg-slider__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.dg-slider__label { font-weight: 500; color: var(--text-secondary); }
.dg-slider__value { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.dg-slider__row { display: flex; align-items: center; gap: var(--space-3); }
.dg-slider { position: relative; flex: 1 1 auto; min-width: 64px; display: flex; align-items: center; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.dg-slider--md { height: 28px; }
.dg-slider--sm { height: 24px; }
.dg-slider__rail { position: relative; display: block; width: 100%; height: 4px; border-radius: var(--radius-full); background: var(--border-default); overflow: hidden; }
.dg-slider__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--radius-full); background: var(--action-indicator); }
.dg-slider__thumb {
  position: absolute; top: 50%; box-sizing: border-box; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: var(--radius-full); background: var(--brand-white); border: 2px solid var(--action-primary);
  box-shadow: var(--shadow-xs); outline: 2px solid transparent; cursor: grab;
  transition: box-shadow 120ms ease-out, border-color 120ms ease-out;
}
.dg-slider--sm .dg-slider__thumb { width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.dg-slider:hover .dg-slider__thumb, .dg-slider[data-state="hover"] .dg-slider__thumb { border-color: var(--action-primary-hover); box-shadow: var(--shadow-sm); }
.dg-slider.is-dragging .dg-slider__thumb { cursor: grabbing; border-color: var(--action-primary-pressed); }
.dg-slider__thumb:focus-visible, .dg-slider[data-state="focus"] .dg-slider__thumb { box-shadow: var(--shadow-focus); }
.dg-slider__input { flex: none; width: 76px; }
.dg-slider-wrap.is-disabled .dg-slider { cursor: not-allowed; }
.dg-slider-wrap.is-disabled .dg-slider__fill { background: var(--action-disabled-border); }
.dg-slider-wrap.is-disabled .dg-slider__thumb { border-color: var(--action-disabled-border); background: var(--action-disabled); box-shadow: none; cursor: not-allowed; }
.dg-slider-wrap.is-disabled .dg-slider__label, .dg-slider-wrap.is-disabled .dg-slider__value { color: var(--text-disabled); }

/* ---------- RadioGroup ---------- */
.dg-radio-group { display: flex; flex-direction: column; gap: var(--space-2); font-family: var(--font-sans); border: 0; margin: 0; padding: 0; }
.dg-radio-group__label { font-weight: 500; color: var(--text-secondary); }
.dg-radio-group__items { display: flex; flex-direction: column; gap: var(--space-2); }
.dg-radio-group--horizontal .dg-radio-group__items { flex-direction: row; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.dg-radio { display: inline-flex; align-items: flex-start; gap: var(--space-2); color: var(--text-primary); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dg-radio__ctl { position: relative; display: inline-flex; flex: none; margin-top: 2px; }
.dg-radio-group--sm .dg-radio__ctl { margin-top: 1px; }
.dg-radio__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.dg-radio__dot {
  position: relative; display: inline-block; box-sizing: border-box; width: 16px; height: 16px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-full); background: var(--surface-panel);
  transition: background-color 120ms ease-out, border-color 120ms ease-out, box-shadow 120ms ease-out;
}
.dg-radio-group--sm .dg-radio__dot { width: 14px; height: 14px; }
.dg-radio__dot::after { content: ""; position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: var(--radius-full); background: var(--action-primary-text); transform: scale(0); transition: transform 120ms ease-out; }
.dg-radio:hover:not(.is-disabled) .dg-radio__dot, .dg-radio[data-state="hover"] .dg-radio__dot { border-color: var(--text-secondary); }
.dg-radio__input:checked + .dg-radio__dot { background: var(--action-indicator); border-color: var(--action-indicator); }
.dg-radio__input:checked + .dg-radio__dot::after { transform: scale(1); }
.dg-radio:hover:not(.is-disabled) .dg-radio__input:checked + .dg-radio__dot { background: var(--action-indicator-hover); border-color: var(--action-indicator-hover); }
.dg-radio__input:focus-visible + .dg-radio__dot, .dg-radio[data-state="focus"] .dg-radio__dot { box-shadow: var(--shadow-focus); }
.dg-radio.is-disabled { cursor: not-allowed; color: var(--text-disabled); }
.dg-radio.is-disabled .dg-radio__dot { background: var(--action-disabled); border-color: var(--action-disabled-border); }
.dg-radio.is-disabled .dg-radio__input:checked + .dg-radio__dot { background: var(--action-disabled-border); }
.dg-radio__text { display: flex; flex-direction: column; min-width: 0; }
.dg-radio__label { }
.dg-radio-group--sm .dg-radio__label { font-weight: 400; }
.dg-radio__desc { color: var(--text-muted); }
.dg-radio.is-disabled .dg-radio__desc { color: var(--text-disabled); }

/* ---------- SegmentedControl ---------- */
.dg-seg {
  position: relative; display: inline-flex; align-items: stretch; box-sizing: border-box; padding: 2px; gap: 0;
  border-radius: var(--radius-chip); background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  font-family: var(--font-sans); isolation: isolate; width: fit-content; max-width: 100%;
}
.dg-seg--block { display: flex; width: 100%; }
.dg-seg__indicator {
  position: absolute; top: 2px; bottom: 2px; left: 0; z-index: 0; border-radius: var(--radius-chip);
  background: var(--surface-overlay); box-shadow: var(--shadow-xs);
  transition: transform 160ms ease-out, width 160ms ease-out;
}
.dg-seg__item {
  position: relative; z-index: 1; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1\.5);
  box-sizing: border-box; min-width: 0; margin: 0; border: 0; border-radius: var(--radius-chip); background: transparent;
  font-family: inherit; font-weight: 500; color: var(--text-secondary); white-space: nowrap; cursor: pointer;
  outline: 2px solid transparent; -webkit-tap-highlight-color: transparent;
  transition: color 120ms ease-out, background-color 120ms ease-out, box-shadow 120ms ease-out;
}
.dg-seg--block .dg-seg__item { flex: 1 1 auto; }
.dg-seg--sm .dg-seg__item { min-height: 22px; padding: 0 var(--space-2); }
.dg-seg--md .dg-seg__item { min-height: 26px; padding: 0 var(--space-3); }
.dg-seg__item.is-icon-only { padding: 0 var(--space-2); }
.dg-seg__label { overflow: hidden; text-overflow: ellipsis; }
.dg-seg__icon { display: inline-flex; }
.dg-seg__icon svg { width: var(--icon-size-xs); height: var(--icon-size-xs); display: block; }
.dg-seg--md .dg-seg__icon svg { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.dg-seg__item:hover:not(:disabled):not(.is-selected) { color: var(--text-primary); background: var(--surface-hover); }
.dg-seg__item.is-selected { color: var(--action-selected-text); }
.dg-seg__item:focus-visible { box-shadow: var(--shadow-focus); }
.dg-seg__item:disabled { color: var(--text-disabled); cursor: not-allowed; }
.dg-seg.is-disabled .dg-seg__indicator { box-shadow: none; background: var(--action-disabled); }

/* ---------- Touch ---------- */
@media (pointer: coarse) {
  .dg-check__ctl::after, .dg-radio__ctl::after { content: ""; position: absolute; top: 50%; left: 50%; width: var(--target-touch); height: var(--target-touch); transform: translate(-50%, -50%); }
  .dg-check, .dg-radio { min-height: var(--target-touch); align-items: center; }
  .dg-check__ctl, .dg-radio__ctl { margin-top: 0; }
  .dg-switch-row--sm, .dg-switch-row--md { min-height: var(--target-touch); }
  .dg-switch::after { content: ""; position: absolute; top: 50%; left: 50%; width: max(100%, var(--target-touch)); height: var(--target-touch); transform: translate(-50%, -50%); }
  .dg-slider--sm, .dg-slider--md { height: var(--target-touch); }
  .dg-slider__thumb { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
  .dg-seg--sm .dg-seg__item, .dg-seg--md .dg-seg__item { min-height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .dg-check__box, .dg-check__mark, .dg-switch, .dg-switch__thumb, .dg-slider__thumb, .dg-radio__dot, .dg-radio__dot::after, .dg-seg__indicator, .dg-seg__item { transition: none; }
}

/* =====================================================================
   Navigation, panels, menus & tooltips
   ===================================================================== */
.dg-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dg-ico { width: var(--icon-size-sm); height: var(--icon-size-sm); display: block; flex: none; }

/* ---------- Tooltip ---------- */
.dg-tip {
  position: fixed; z-index: 1000; display: inline-flex; align-items: center; gap: var(--space-2); max-width: 240px;
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-tooltip);
  background: var(--text-primary); color: var(--text-inverse); box-shadow: var(--shadow-tooltip);
  font-family: var(--font-sans); font-weight: 500; pointer-events: none;
  animation: dg-tip-in 120ms ease-out;
}
.dg-tip__kbd { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; opacity: 0.72; }
@keyframes dg-tip-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Menus ---------- */
.dg-mn {
  position: fixed; z-index: 900; min-width: 200px; max-width: 320px; max-height: min(480px, calc(100vh - 16px)); overflow-y: auto;
  box-sizing: border-box; margin: 0; padding: var(--menu-padding); list-style: none; outline: none;
  background: var(--surface-overlay); border: 1px solid var(--border-subtle); border-radius: var(--radius-menu); box-shadow: var(--shadow-menu);
  font-family: var(--font-sans); color: var(--text-primary); animation: dg-tip-in 120ms ease-out;
}
.dg-mn__item {
  display: flex; align-items: center; gap: var(--space-2); min-height: 28px; box-sizing: border-box;
  padding: var(--menu-item-padding-y) var(--menu-item-padding-x); border-radius: var(--radius-menu-item); cursor: pointer; user-select: none; outline: none;
}
.dg-mn__item:focus, .dg-mn__item.is-open { background: var(--surface-hover); }
/* Select's listbox: the same menu surface, anchored to its trigger. Focus stays on the trigger; .is-active marks the highlighted option. */
.dg-mn--listbox { position: absolute; z-index: 50; top: calc(100% + var(--menu-offset)); left: 0; min-width: 100%; width: max-content; max-width: min(360px, 90vw); max-height: 280px; animation: none; }
.dg-mn--listbox.dg-mn--up { top: auto; bottom: calc(100% + var(--menu-offset)); }
.dg-mn--listbox .dg-mn__item.is-active { background: var(--surface-hover); }
.dg-mn--listbox .dg-mn__item.is-selected { color: var(--action-selected-text); font-weight: 500; }
.dg-mn--listbox .dg-mn__item.is-selected.is-active { background: var(--action-selected); }
.dg-mn--listbox .dg-mn__item.is-disabled { cursor: not-allowed; }
.dg-mn__text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.dg-mn__wrap { overflow-wrap: anywhere; }
.dg-mn__desc { color: var(--text-muted); font-weight: 400; }
.dg-mn__check { flex: none; width: var(--icon-size-sm); height: var(--icon-size-sm); }
.dg-mn__item:focus-visible { box-shadow: inset 0 0 0 2px var(--focus-ring); }
.dg-mn__item.is-disabled { color: var(--text-disabled); cursor: default; }
.dg-mn__item.is-disabled:focus { background: transparent; }
.dg-mn__item.is-destructive { color: var(--error-text); }
.dg-mn__item.is-destructive:focus { background: var(--error-bg); }
.dg-mn__icon { display: inline-flex; width: var(--icon-size-sm); flex: none; color: var(--text-secondary); }
.dg-mn__item.is-destructive .dg-mn__icon { color: var(--error-text); }
.dg-mn__item.is-disabled .dg-mn__icon { color: var(--text-disabled); }
.dg-mn__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-mn__kbd { flex: none; margin-left: var(--space-4); font-family: var(--font-mono); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dg-mn__sub { display: inline-flex; color: var(--text-muted); margin-right: -4px; }
.dg-mn__sep { height: 1px; margin: var(--menu-separator-margin) calc(var(--menu-padding) * -1); background: var(--border-subtle); list-style: none; }
.dg-mn__group { padding: var(--space-1\.5) var(--menu-item-padding-x) var(--space-1); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-ctx { position: relative; }

/* ---------- CollapsibleSection / Accordion ---------- */
.dg-acc { display: flex; flex-direction: column; }
.dg-cs { border-bottom: 1px solid var(--border-subtle); font-family: var(--font-sans); }
.dg-cs:last-child { border-bottom: 0; }
.dg-cs__head { display: flex; align-items: center; gap: var(--space-1); }
.dg-cs__trigger {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--space-1\.5); margin: 0; border: 0; background: transparent;
  color: var(--text-primary);  font-weight: 600; text-align: left; cursor: pointer; border-radius: var(--radius-sm);
  outline: 2px solid transparent; -webkit-tap-highlight-color: transparent; transition: background-color 120ms ease-out, color 120ms ease-out;
}
.dg-cs--sm .dg-cs__trigger { min-height: 32px; padding: 0 var(--space-1); }
.dg-cs--md .dg-cs__trigger { min-height: 40px; padding: 0 var(--space-2); }
.dg-cs__trigger:hover { background: var(--surface-hover); }
.dg-cs__trigger:focus-visible { box-shadow: var(--shadow-focus); }
.dg-cs__chev { display: inline-flex; color: var(--text-muted); transition: transform 160ms ease-out; }
.dg-cs__chev .dg-ico { width: var(--icon-size-xs); height: var(--icon-size-xs); }
.dg-cs.is-open > .dg-cs__head .dg-cs__chev { transform: rotate(90deg); }
.dg-cs__icon { display: inline-flex; color: var(--text-secondary); }
.dg-cs.is-active > .dg-cs__head .dg-cs__icon, .dg-cs.is-active > .dg-cs__head .dg-cs__title { color: var(--action-selected-text); }
.dg-cs__title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-cs__count { flex: none; min-width: 20px; padding: 0 var(--space-1\.5); border-radius: var(--radius-chip); background: var(--bg-subtle); color: var(--text-secondary); font-family: var(--font-mono); font-weight: 500; text-align: center; font-variant-numeric: tabular-nums; }
.dg-cs__actions { display: flex; align-items: center; gap: var(--space-0\.5); flex: none; }
.dg-cs__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 160ms ease-out; }
.dg-cs.is-open > .dg-cs__body { grid-template-rows: 1fr; }
.dg-cs__inner { overflow: hidden; min-height: 0; }
.dg-cs__content { display: grid; gap: var(--space-2); }
.dg-cs--sm > .dg-cs__body .dg-cs__content { padding: var(--space-1) var(--space-1) var(--space-3); }
.dg-cs--md > .dg-cs__body .dg-cs__content { padding: var(--space-1) var(--space-2) var(--space-4); }

/* ---------- Tabs / PanelTabs ---------- */
.dg-tabs { display: flex; flex-direction: column; min-width: 0; font-family: var(--font-sans); }
.dg-tabs__list { position: relative; display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border-subtle); overflow-x: auto; scrollbar-width: none; }
.dg-tabs__list::-webkit-scrollbar { display: none; }
.dg-tabs__tab {
  position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1\.5);
  margin: 0; border: 0; background: transparent; color: var(--text-secondary);  font-weight: 500; white-space: nowrap; cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; outline: 2px solid transparent; -webkit-tap-highlight-color: transparent;
  transition: color 120ms ease-out, background-color 120ms ease-out;
}
.dg-tabs--md .dg-tabs__tab { min-height: 36px; padding: 0 var(--space-3); }
.dg-tabs--sm .dg-tabs__tab { min-height: 32px; padding: 0 var(--space-2); }
.dg-tabs--block .dg-tabs__tab { flex: 1 1 0; }
.dg-tabs__tab:hover:not(:disabled) { color: var(--text-primary); background: var(--surface-hover); }
.dg-tabs__tab.is-selected { color: var(--text-primary); }
.dg-tabs__tab.is-selected .dg-tabs__icon { color: var(--action-selected-text); }
.dg-tabs__tab:focus-visible { box-shadow: inset 0 0 0 2px var(--focus-ring); }
.dg-tabs__tab:disabled { color: var(--text-disabled); cursor: not-allowed; }
.dg-tabs__icon { display: inline-flex; }
.dg-tabs__badge { padding: 0 var(--space-1\.5); border-radius: var(--radius-chip); background: var(--bg-subtle); color: var(--text-secondary); font-family: var(--font-mono); font-weight: 500; }
.dg-tabs__ind { position: absolute; left: 0; bottom: -1px; height: 2px; border-radius: var(--radius-full); background: var(--action-indicator); transition: transform 160ms ease-out, width 160ms ease-out; }
.dg-tabs__panel { outline: none; padding-top: var(--space-3); min-width: 0; }
.dg-tabs__panel:focus-visible { box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }

/* ---------- SidePanel ---------- */
.dg-sp {
  position: relative; display: flex; flex-direction: column; flex: none; min-height: 0; box-sizing: border-box;
  background: var(--surface-panel); color: var(--text-primary); font-family: var(--font-sans);
}
.dg-sp--left { border-right: 1px solid var(--border-default); }
.dg-sp--right { border-left: 1px solid var(--border-default); }
.dg-sp.is-embedded { width: 100%; height: 100%; border: 0; background: transparent; }
.dg-sp__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 44px; padding: var(--space-1\.5) var(--space-2) var(--space-1\.5) var(--panel-padding); box-sizing: border-box; border-bottom: 1px solid var(--border-subtle); }
.dg-sp.is-embedded .dg-sp__head { display: none; }
.dg-sp__title { margin: 0; font-weight: 600; color: var(--text-primary); }
.dg-sp__actions { display: flex; align-items: center; gap: var(--toolbar-gap); }
.dg-sp__toolbar { padding: var(--space-2) var(--panel-padding); border-bottom: 1px solid var(--border-subtle); }
.dg-sp__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.dg-sp__foot { padding: var(--space-2) var(--panel-padding); border-top: 1px solid var(--border-subtle); }
.dg-sp__resize { position: absolute; top: 0; bottom: 0; width: 9px; z-index: 5; cursor: col-resize; touch-action: none; outline: none; }
.dg-sp--left .dg-sp__resize { right: -5px; }
.dg-sp--right .dg-sp__resize { left: -5px; }
.dg-sp__resize::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: transparent; transition: background-color 120ms ease-out, width 120ms ease-out, left 120ms ease-out; }
.dg-sp__resize:hover::after, .dg-sp__resize.is-dragging::after { left: 3px; width: 3px; background: var(--focus-ring); }
.dg-sp__resize:focus-visible::after { left: 3px; width: 3px; background: var(--focus-ring); }
.dg-sp.is-collapsed { width: 48px; }
.dg-sp__rail { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); padding: var(--space-2) 0; overflow-y: auto; }
.dg-sp__rail .dg-lib__rail { border: 0; padding: 0; }

/* ---------- AppHeader ---------- */
.dg-hdr {
  display: flex; align-items: center; gap: var(--space-3); box-sizing: border-box; min-height: 48px; padding: var(--space-1\.5) var(--space-3);
  background: var(--surface-panel); color: var(--text-primary); border-bottom: 1px solid var(--border-default); font-family: var(--font-sans); min-width: 0;
}
.dg-hdr__left { display: flex; align-items: center; gap: var(--space-3); min-width: 0; flex: 1 1 0; }
.dg-hdr__center { flex: none; display: flex; justify-content: center; }
.dg-hdr__right { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); flex: 1 1 0; min-width: 0; }
.dg-hdr__brand { display: flex; align-items: baseline; gap: var(--space-1\.5); flex: none; }
.dg-hdr__mark { font-size: 0.9375rem; line-height: 1.25rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); }
.dg-hdr__product { font-weight: 500; color: var(--text-secondary); }
.dg-hdr__div { width: 1px; height: 20px; flex: none; background: var(--border-default); }
.dg-hdr__project { display: flex; flex-direction: column; min-width: 0; }
.dg-hdr--xs .dg-hdr__project { flex-direction: row; align-items: center; gap: var(--space-1\.5); }
.dg-hdr__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-hdr__status { display: inline-flex; align-items: center; gap: var(--space-1\.5); color: var(--text-muted); white-space: nowrap; }
.dg-hdr__dot { width: 6px; height: 6px; border-radius: var(--radius-full); flex: none; background: var(--success-solid); }
.dg-hdr__status.is-saving .dg-hdr__dot { background: var(--info-solid); }
.dg-hdr__status.is-unsaved .dg-hdr__dot { background: var(--warning-solid); }
.dg-hdr__status.is-error { color: var(--error-text); }
.dg-hdr__status.is-error .dg-hdr__dot { background: var(--error-solid); }
.dg-hdr__group { display: flex; align-items: center; gap: var(--toolbar-gap); }
.dg-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; margin: 0; padding: 0;
  border: 0; border-radius: var(--radius-full); background: var(--accent-violet-subtle); color: var(--accent-violet);
  font-family: var(--font-sans); font-weight: 600; cursor: pointer; position: relative;
  outline: 2px solid transparent; transition: box-shadow 120ms ease-out;
}
.dg-avatar:hover { box-shadow: 0 0 0 2px var(--border-default); }
.dg-avatar:focus-visible { box-shadow: var(--shadow-focus); }

/* ---------- ComponentsPanel (library) ---------- */
.dg-lib { display: flex; overflow: hidden; }
.dg-lib__rail { display: flex; flex-direction: column; align-items: center; gap: var(--space-0\.5); flex: none; width: 44px; padding: var(--space-2) 0; box-sizing: border-box; border-right: 1px solid var(--border-subtle); overflow-y: auto; scrollbar-width: none; }
.dg-lib__railbtn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; margin: 0; padding: 0;
  border: 0; border-radius: var(--radius-toolbar-button); background: transparent; color: var(--text-secondary); cursor: pointer;
  outline: 2px solid transparent; transition: background-color 120ms ease-out, color 120ms ease-out;
}
.dg-lib__railbtn .dg-ico { width: var(--icon-size-md); height: var(--icon-size-md); }
.dg-lib__railbtn:hover { background: var(--action-ghost-hover); color: var(--text-primary); }
.dg-lib__railbtn.is-active { background: var(--action-selected); color: var(--action-selected-text); }
.dg-lib__railbtn:focus-visible { box-shadow: var(--shadow-focus); }
.dg-lib__content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.dg-lib__search { padding: var(--space-2) var(--panel-padding) var(--space-2) var(--space-3); }
.dg-lib__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--space-2) var(--space-3) var(--space-2); }
.dg-lib__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: var(--space-2); }
.dg-lib__empty { padding: var(--space-6) var(--space-3); text-align: center; color: var(--text-muted); font-weight: 400; }
.dg-lib__empty p { margin: 0 0 var(--space-1); }
.dg-lib__empty-t { color: var(--text-primary); font-weight: 500; }
/* Library tiles are AssetTile (compact); the panel keeps its tighter spacing. */
.dg-lib__grid .dg-at { gap: var(--space-1); }
.dg-lib__grid .dg-at__name { padding: 0; }
.dg-lib__grid .dg-at__grip { top: 6px; right: 6px; padding: 1px; box-shadow: none; }
.dg-layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.dg-layer { display: flex; align-items: center; gap: var(--space-1\.5); min-height: 32px; padding: 0 var(--space-1); border-radius: var(--radius-sm); color: var(--text-primary); font-weight: 400; }
.dg-layer:hover { background: var(--surface-hover); }
.dg-layer__grip { display: inline-flex; color: var(--text-muted); cursor: grab; }
.dg-layer__grip .dg-ico { width: var(--icon-size-xs); height: var(--icon-size-xs); }
.dg-layer__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-layer.is-hidden .dg-layer__name { color: var(--text-disabled); }
.dg-layer__btn { opacity: 0; }
.dg-layer:hover .dg-layer__btn, .dg-layer__btn:focus-visible, .dg-layer__btn.is-on { opacity: 1; }

/* ---------- PropertiesPanel ---------- */
.dg-pp { padding: var(--space-2) var(--panel-padding) var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.dg-pp__obj { display: flex; align-items: center; gap: var(--space-2); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border-subtle); }
.dg-pp__objicon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--action-selected); color: var(--action-selected-text); }
.dg-pp__objtext { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dg-pp__name.dg-field { border-color: transparent; background: transparent; font-weight: 600; padding-left: var(--space-1\.5); }
.dg-pp__name.dg-field:hover { border-color: var(--border-default); }
.dg-pp__type { padding-left: var(--space-1\.5); color: var(--text-muted); }
.dg-pp__objbtns { display: flex; gap: var(--toolbar-gap); flex: none; }
.dg-pp__locked { display: flex; align-items: center; gap: var(--space-1\.5); margin: 0; padding: var(--space-1\.5) var(--space-2); border-radius: var(--radius-sm); background: var(--warning-bg); color: var(--warning-text); }
.dg-pp__locked .dg-ico { width: var(--icon-size-xs); height: var(--icon-size-xs); }
.dg-pp__pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--inspector-field-gap); }
.dg-pp__pair3 { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--inspector-field-gap); align-items: center; }
.dg-pp__stack { display: grid; gap: var(--space-1\.5); }
.dg-pp__label { font-weight: 500; color: var(--text-secondary); }
.dg-pp__hint { margin: 0; color: var(--text-muted); }
.dg-pp__arrange { display: flex; gap: var(--toolbar-gap); }
.dg-pp__empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); padding: var(--space-10) var(--space-4); text-align: center; color: var(--text-muted); font-weight: 400; }
.dg-pp__empty .dg-ico { width: var(--icon-size-xl); height: var(--icon-size-xl); margin-bottom: var(--space-1); }
.dg-pp__empty p { margin: 0; }
.dg-pp__empty-t { color: var(--text-primary); font-weight: 500; }
.dg-pp__railobj { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--action-selected); color: var(--action-selected-text); outline: 2px solid transparent; }
.dg-pp__railobj:focus-visible { box-shadow: var(--shadow-focus); }
.dg-swatch { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; flex: none; padding: 0; border: 1px solid var(--border-default); border-radius: var(--radius-xs); background: none; cursor: pointer; }
.dg-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.dg-swatch::-webkit-color-swatch { border: 0; border-radius: 3px; }
.dg-swatch::-moz-color-swatch { border: 0; border-radius: 3px; }
.dg-swatch:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.dg-swatch:disabled { cursor: not-allowed; opacity: 0.5; }

/* ---------- BottomSheet & BottomNav ---------- */
.dg-bnav { display: flex; align-items: stretch; justify-content: space-around; gap: var(--space-1); padding: var(--space-1) var(--space-2) calc(var(--space-1) + env(safe-area-inset-bottom, 0px)); background: var(--surface-panel); border-top: 1px solid var(--border-default); font-family: var(--font-sans); }
.dg-bnav__item {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--target-touch-lg); max-width: 120px;
  margin: 0; padding: var(--space-1) 0; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary); font: inherit; cursor: pointer;
  outline: 2px solid transparent; -webkit-tap-highlight-color: transparent; transition: color 120ms ease-out, background-color 120ms ease-out;
}
.dg-bnav__icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 26px; border-radius: var(--radius-full); transition: background-color 120ms ease-out; }
.dg-bnav__icon .dg-ico { width: var(--icon-size-lg); height: var(--icon-size-lg); }
.dg-bnav__label { font-weight: 500; }
.dg-bnav__item.is-active { color: var(--action-selected-text); }
.dg-bnav__item.is-active .dg-bnav__icon { background: var(--action-selected); }
.dg-bnav__item:focus-visible { box-shadow: var(--shadow-focus); }

/* ---------- EditorLayout ---------- */
.dg-el { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; background: var(--bg-app); color: var(--text-primary); font-family: var(--font-sans); }
.dg-el__main { position: relative; flex: 1 1 auto; display: flex; min-height: 0; }
.dg-el__canvas { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; background: var(--bg-canvas-surround); outline: none; }
.dg-el__fab { position: absolute; top: var(--space-3); z-index: 3; }
.dg-el__fab--left { left: var(--space-3); }
.dg-el__fab--right { right: var(--space-3); }
.dg-el__scrim { position: absolute; inset: 0; z-index: 9; background: var(--overlay-scrim); animation: dg-tip-in 160ms ease-out; }
.dg-el__overlay {
  position: absolute; top: var(--space-2); bottom: var(--space-2); z-index: 10; width: min(360px, calc(100% - 64px)); display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface-panel); border: 1px solid var(--border-default); border-radius: var(--radius-panel); box-shadow: var(--shadow-lg); animation: dg-tip-in 160ms ease-out;
}
.dg-el__overlay.is-left { left: var(--space-2); }
.dg-el__overlay.is-right { right: var(--space-2); }
.dg-el__overlay > .dg-sp { flex: 1 1 auto; min-height: 0; }
.dg-el--tablet .dg-el__overlay .dg-sp__head, .dg-el--mobile .dg-dlg--panel .dg-sp__head { display: none; }

/* ---------- Touch ---------- */
@media (pointer: coarse) {
  .dg-mn__item { min-height: var(--target-touch); }
  .dg-cs--sm .dg-cs__trigger, .dg-cs--md .dg-cs__trigger { min-height: var(--target-touch); }
  .dg-tabs--sm .dg-tabs__tab, .dg-tabs--md .dg-tabs__tab { min-height: var(--target-touch); }
  .dg-lib__railbtn { width: 40px; height: 40px; }
  .dg-sp__resize { width: 17px; }
  .dg-sp--left .dg-sp__resize { right: -9px; }
  .dg-sp--right .dg-sp__resize { left: -9px; }
  .dg-layer { min-height: var(--target-touch); font-weight: 400; }
  .dg-layer__btn { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .dg-tip, .dg-mn, .dg-el__scrim, .dg-el__overlay { animation: none; }
  .dg-cs__body, .dg-cs__chev, .dg-tabs__ind, .dg-sp__resize::after { transition: none; }
}

/* =====================================================================
   Asset library: AssetTile & AssetGrid
   ===================================================================== */
.dg-ag { display: grid; gap: var(--space-2); font-family: var(--font-sans); }
.dg-ag--compact { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.dg-ag--expanded { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: var(--space-3); }
.dg-at {
  position: relative; display: flex; flex-direction: column; gap: var(--space-1\.5); min-width: 0; box-sizing: border-box;
  padding: var(--space-1); border: 1px solid transparent; border-radius: var(--radius-md); background: transparent; color: var(--text-primary);
  font-family: var(--font-sans); text-align: left; cursor: grab; user-select: none; outline: 2px solid transparent; -webkit-tap-highlight-color: transparent;
  transition: border-color 120ms ease-out, background-color 120ms ease-out, box-shadow 120ms ease-out;
}
.dg-at--expanded { padding: var(--space-1\.5); border-radius: var(--radius-card); }
.dg-at__thumb { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--radius-sm); background: var(--bg-subtle); color: var(--text-secondary); }
.dg-at--expanded .dg-at__thumb { aspect-ratio: 4 / 3; border-radius: var(--radius-md); }
.dg-at__thumb.is-icon .dg-ico { width: var(--icon-size-xl); height: var(--icon-size-xl); }
.dg-at--expanded .dg-at__thumb.is-icon .dg-ico { width: var(--icon-size-2xl); height: var(--icon-size-2xl); }
.dg-at__img { width: 78%; height: 78%; object-fit: contain; display: block; }
.dg-at__img.is-fill { width: 100%; height: 100%; object-fit: cover; }
.dg-at__style { position: absolute; left: 6px; bottom: 6px; padding: 0 var(--space-1\.5); border-radius: var(--radius-chip); background: var(--surface-overlay); color: var(--text-secondary); font-weight: 500; }
.dg-at__meta { display: flex; flex-direction: column; min-width: 0; padding: 0 2px; }
.dg-at__name { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-at--expanded .dg-at__name { font-weight: 500; color: var(--text-primary); }
.dg-at__cat { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-at__grip { position: absolute; top: 8px; right: 8px; display: inline-flex; padding: 2px; border-radius: var(--radius-xs); background: var(--surface-overlay); color: var(--text-muted); box-shadow: var(--shadow-xs); opacity: 0; transition: opacity 120ms ease-out; }
.dg-at__grip .dg-ico { width: 12px; height: 12px; }
.dg-at__check { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: var(--radius-full); background: var(--action-indicator); color: var(--action-primary-text); box-shadow: 0 0 0 2px var(--surface-panel); opacity: 0; transform: scale(.8); transition: opacity 120ms ease-out, transform 120ms ease-out; }
.dg-at__check .dg-ico { width: 12px; height: 12px; }
.dg-at:hover:not(.is-disabled), .dg-at[data-state="hover"] { border-color: var(--border-default); background: var(--surface-raised); box-shadow: var(--shadow-xs); }
.dg-at:hover:not(.is-disabled) .dg-at__grip, .dg-at[data-state="hover"] .dg-at__grip, .dg-at:focus-visible .dg-at__grip { opacity: 1; }
.dg-at:hover:not(.is-disabled) .dg-at__thumb.is-icon, .dg-at[data-state="hover"] .dg-at__thumb.is-icon { color: var(--action-selected-text); }
.dg-at.is-selected { border-color: var(--action-indicator); background: var(--action-selected); box-shadow: inset 0 0 0 1px var(--action-indicator); }
.dg-at.is-selected .dg-at__check { opacity: 1; transform: none; }
.dg-at.is-selected .dg-at__name { color: var(--action-selected-text); }
.dg-at:focus-visible, .dg-at[data-state="focus"] { box-shadow: var(--shadow-focus); }
.dg-at.is-selected:focus-visible { box-shadow: inset 0 0 0 1px var(--action-indicator), var(--shadow-focus); }
.dg-at:active:not(.is-disabled) { cursor: grabbing; }
.dg-at.is-dragging, .dg-at[data-state="dragging"] { opacity: 0.45; border-style: dashed; border-color: var(--focus-ring); box-shadow: none; }
.dg-at.is-disabled { cursor: not-allowed; opacity: 0.5; }
.dg-ag__empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); padding: var(--space-8) var(--space-4); border: 1px dashed var(--border-strong); border-radius: var(--radius-card); text-align: center; color: var(--text-muted); font-family: var(--font-sans); font-weight: 400; }
.dg-ag__empty p { margin: 0; }
.dg-ag__empty-t { color: var(--text-primary); font-weight: 500; }
.dg-ag__empty .dg-btn { margin-top: var(--space-2); }
@media (pointer: coarse) {
  .dg-at__grip { opacity: 1; }
  .dg-ag--compact { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .dg-at, .dg-at__grip, .dg-at__check { transition: none; }
}

/* =====================================================================
   Overlays & feedback: Dialog, AlertDialog, ProgressDialog, Toast, ToastContainer
   ===================================================================== */

/* ---------- Dialog ---------- */
.dg-dlg-layer { position: fixed; inset: 0; z-index: 700; display: flex; align-items: center; justify-content: center; padding: var(--space-6); box-sizing: border-box; }
.dg-dlg-layer.is-contained { position: absolute; z-index: 40; }
.dg-dlg-layer.is-sheet { align-items: flex-end; padding: 0; }
.dg-dlg__backdrop { position: absolute; inset: 0; background: var(--overlay-scrim); animation: dg-ov-fade 160ms ease-out; }
.dg-dlg {
  position: relative; display: flex; flex-direction: column; gap: var(--dialog-gap); box-sizing: border-box; width: 100%; max-height: 100%; overflow: hidden;
  padding: var(--dialog-padding); background: var(--surface-overlay); color: var(--text-primary); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-dialog); box-shadow: var(--shadow-dialog); font-family: var(--font-sans); outline: none;
  animation: dg-ov-pop 160ms ease-out;
}
.dg-dlg--sm { max-width: 420px; }
.dg-dlg--md { max-width: 520px; }
.dg-dlg--lg { max-width: 680px; }
.dg-dlg.is-inline { animation: none; box-shadow: var(--shadow-md); max-height: none; }
.dg-dlg.is-sheet { max-width: none; max-height: 88%; border-radius: var(--radius-dialog) var(--radius-dialog) 0 0; border-bottom: 0; padding: var(--space-2) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom, 0px)); animation: dg-ov-rise 200ms ease-out; }
.dg-dlg__grab { display: flex; justify-content: center; padding-bottom: var(--space-1); }
.dg-dlg__grab span { width: 36px; height: 4px; border-radius: var(--radius-full); background: var(--border-strong); }
.dg-dlg__grab.is-draggable { cursor: grab; touch-action: none; }
.dg-dlg.is-sheet { transition: transform 160ms ease-out; }
/* BottomSheet: the sheet presentation with an edge-to-edge panel body (mobile library and properties). */
.dg-dlg--panel.is-sheet { max-height: 78%; gap: 0; padding: 0 0 env(safe-area-inset-bottom, 0px); }
.dg-dlg--panel .dg-dlg__grab { padding: var(--space-2) 0 var(--space-1); }
.dg-dlg--panel .dg-dlg__head { align-items: center; padding: 0 var(--space-3) var(--space-2) var(--space-4); }
.dg-dlg--panel .dg-dlg__close { margin: 0; }
.dg-dlg--panel .dg-dlg__body { flex: 1 1 auto; gap: 0; margin: 0; padding: 0; }
.dg-dlg--panel .dg-dlg__body > .dg-sp { flex: 1 1 auto; }
.dg-dlg__head { display: flex; align-items: flex-start; gap: var(--space-3); }
.dg-dlg__titles { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.dg-dlg__title { margin: 0; font-weight: 600; color: var(--text-primary); }
.dg-dlg.is-sheet:not(.dg-dlg--panel) .dg-dlg__title { font-size: 1.125rem; line-height: 1.5rem; }
.dg-dlg__desc { margin: 0; color: var(--text-secondary); }
.dg-dlg__desc p { margin: 0 0 var(--space-2); }
.dg-dlg__desc p:last-child { margin-bottom: 0; }
.dg-dlg__close { margin: -4px -8px 0 0; flex: none; }
.dg-dlg__icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--info-bg); color: var(--info-text); }
.dg-dlg__icon .dg-ico { width: var(--icon-size-lg); height: var(--icon-size-lg); }
.dg-dlg__icon.is-danger { background: var(--error-bg); color: var(--error-text); }
.dg-dlg__icon.is-warning { background: var(--warning-bg); color: var(--warning-text); }
.dg-dlg__icon.is-success { background: var(--success-bg); color: var(--success-text); }
.dg-dlg__body { display: flex; flex-direction: column; gap: var(--space-4); min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 calc(var(--space-1) * -1); padding: 2px var(--space-1); }
.dg-dlg__foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--dialog-actions-gap); padding-top: var(--space-1); }
.dg-dlg.is-sheet .dg-dlg__foot { flex-direction: column-reverse; align-items: stretch; }
.dg-dlg__mono { font-family: var(--font-mono); font-weight: 500; }
@keyframes dg-ov-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dg-ov-pop { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dg-ov-rise { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Progress ---------- */
.dg-prog-wrap { display: flex; flex-direction: column; gap: var(--space-2); outline: none; }
.dg-prog { position: relative; height: 8px; border-radius: var(--radius-full); background: var(--bg-subtle); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border-subtle); }
.dg-prog__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--radius-full); background: var(--action-indicator); transition: width 240ms ease-out; }
.dg-prog.is-indeterminate .dg-prog__fill { width: 36%; animation: dg-prog-slide 1.4s ease-in-out infinite; }
.dg-prog.is-success .dg-prog__fill { background: var(--success-solid); }
.dg-prog.is-error .dg-prog__fill { background: var(--error-solid); }
@keyframes dg-prog-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(280%); } }
.dg-prog__meta { display: flex; justify-content: space-between; gap: var(--space-3); color: var(--text-secondary); font-weight: 400; }
.dg-prog__pct { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text-primary); }

/* ---------- Toast ---------- */
.dg-toast {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--space-3);
  box-sizing: border-box; width: 100%; padding: var(--space-3); background: var(--surface-overlay); color: var(--text-primary);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); font-family: var(--font-sans); outline: none;
  animation: dg-toast-in 180ms ease-out;
}
.dg-toast:focus-visible { box-shadow: var(--shadow-md), var(--shadow-focus); }
.dg-toast.is-exiting { animation: dg-toast-out 160ms ease-in forwards; }
.dg-toast__icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-full); }
.dg-toast__icon .dg-ico { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.dg-toast.is-success .dg-toast__icon { background: var(--success-bg); color: var(--success-text); }
.dg-toast.is-info .dg-toast__icon { background: var(--info-bg); color: var(--info-text); }
.dg-toast.is-warning .dg-toast__icon { background: var(--warning-bg); color: var(--warning-text); }
.dg-toast.is-error .dg-toast__icon { background: var(--error-bg); color: var(--error-text); }
.dg-toast__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 4px; }
.dg-toast__title { margin: 0; font-weight: 600; }
.dg-toast__desc { margin: 0; line-height: 1.125rem; color: var(--text-secondary); font-weight: 400; }
.dg-toast__actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.dg-toast__close { margin: 0 -4px 0 0; }
@keyframes dg-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes dg-toast-out { to { opacity: 0; transform: translateY(4px); } }

/* ---------- ToastContainer ---------- */
.dg-toasts-host { position: relative; }
.dg-toasts { position: fixed; z-index: 650; display: flex; flex-direction: column; gap: var(--space-2); width: min(380px, calc(100% - 32px)); pointer-events: none; }
.dg-toasts-host.is-contained > .dg-toasts { position: absolute; }
.dg-toasts.is-bottom-right { right: var(--space-4); bottom: var(--space-4); }
.dg-toasts.is-bottom-left { left: var(--space-4); bottom: var(--space-4); }
.dg-toasts.is-top-right { right: var(--space-4); top: var(--space-4); }
.dg-toasts.is-bottom-center { left: 50%; bottom: var(--space-4); transform: translateX(-50%); }
.dg-toasts.is-top-center { left: 50%; top: var(--space-4); transform: translateX(-50%); }
.dg-toasts.is-mobile { width: auto; left: var(--space-2); right: var(--space-2); transform: none; }
.dg-toasts__list { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.dg-toasts__item { pointer-events: auto; }
.dg-toasts__more { align-self: center; margin: 0; padding: 2px var(--space-2); border-radius: var(--radius-chip); background: var(--surface-overlay); color: var(--text-secondary); box-shadow: var(--shadow-xs); font-family: var(--font-sans); pointer-events: auto; }
.dg-toasts.is-mobile .dg-toast { padding: var(--space-2) var(--space-3); }
.dg-toasts.is-mobile .dg-toast__desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (pointer: coarse) {
  .dg-toast__close::after { content: ""; position: absolute; inset: -8px; }
}
@media (prefers-reduced-motion: reduce) {
  .dg-dlg, .dg-dlg__backdrop, .dg-toast, .dg-toast.is-exiting { animation: none; }
  .dg-dlg.is-sheet { transition: none; }
  .dg-prog.is-indeterminate .dg-prog__fill { animation: none; width: 100%; opacity: .45; }
  .dg-prog__fill { transition: none; }
}
