/* The original edge tab and compact menu stay familiar. Reorder the existing
   section-name rows directly; dashboard cards never receive editing chrome. */
@media screen {
  /* The desktop sidebar is 900; keep both saved dock sides usable above it. */
  #wfHomeDock { z-index: 920; }
  #wfHomeDockBackdrop { z-index: 919; }
  /* A 24px edge target stays outside the smart-card pager. */
  #wfHomeDock #wfHomeEdit::after { inset-block: -10px; inset-inline: auto; left: 0; right: -10px; }
  #wfHomeDock[data-side="right"] #wfHomeEdit::after { left: -10px; right: 0; }
  #wfHomeDock[hidden], #wfHomeDock:not([open]) > #wfHomeCustomizer,
  #wfHomeCustomizer [hidden] { display: none !important; }
  html body #wfHomeDock > #wfHomeCustomizer {
    --home-editor-tint: color-mix(in srgb, var(--brand-primary) 7%, var(--card));
    color: var(--text); font-family: inherit; text-align: start;
  }
  #wfHomeCustomizer * { box-sizing: border-box; }
  #wfHomeCustomizerTitle { outline: none; }
  #wfHomeCustomizer .wf-home-editor-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    min-inline-size: 0; min-block-size: 40px; padding: 6px 8px;
    border: 1px solid var(--border); border-radius: 9px;
    color: var(--text); background: var(--card);
    font: inherit; font-size: 12px; font-weight: 700; line-height: 1.4;
    cursor: pointer; touch-action: manipulation;
  }
  #wfHomeCustomizer .wf-home-editor-button:focus-visible,
  #wfHomeCustomizer .wf-home-visibility:focus-visible {
    outline: 2px solid var(--ui-accent, var(--brand-primary)); outline-offset: 2px;
  }
  #wfHomeCustomizer .wf-home-editor-button:hover {
    border-color: var(--brand-primary); background: var(--home-editor-tint);
  }
  #wfHomeCustomizer .wf-home-editor-button[aria-disabled="true"] { opacity: .4; cursor: default; }
  #wfHomeCustomizer .dash-dock-toolbar .wf-home-editor-button {
    min-inline-size: 32px; min-block-size: 36px; padding: 0;
    border-color: transparent; background: transparent; font-size: 21px;
  }
  .wf-home-editor-icon {
    display: inline-flex; flex: none; align-items: center; justify-content: center;
    inline-size: 18px; block-size: 18px;
  }
  .wf-home-editor-icon svg { display: block; inline-size: 100%; block-size: 100%; }
  #wfHomeCustomizer .wf-home-editor-count {
    margin: 0 0 4px; color: var(--text2); font-size: 11px; line-height: 1.6;
  }
  #wfHomeCustomizer .wf-home-editor-hint {
    margin: 0; color: var(--text2); font-size: 11px; line-height: 1.6;
  }
  #wfHomeCustomizer .wf-home-editor-body > .wf-home-editor-hint { margin-block-end: 6px; }
  #wfHomeCustomizer .wf-home-editor-grid {
    position: relative; display: grid; align-content: start; gap: 2px; min-inline-size: 0;
  }
  #wfHomeCustomizer .wf-home-section-tile {
    position: relative; min-inline-size: 0; margin: 0; padding: 0;
    border: 1px solid transparent; border-radius: 9px;
  }
  html body #wfHomeCustomizer .wf-home-section-choice {
    display: flex; flex-direction: row; align-items: center; gap: 6px; min-block-size: 44px;
    margin: 0; padding: 0 2px; color: var(--text); font-size: 13px;
    line-height: 1.5; font-weight: 600;
  }
  #wfHomeCustomizer .wf-home-section-choice span { min-inline-size: 0; overflow-wrap: anywhere; }
  html body #wfHomeCustomizer .wf-home-visibility-target {
    display: flex; order: 1; flex: 0 0 24px; align-items: center; justify-content: center;
    min-inline-size: 24px; min-block-size: 44px; margin: 0; padding: 0 3px;
    cursor: pointer; touch-action: pan-y;
  }
  html body #wfHomeCustomizer .wf-home-visibility {
    flex: 0 0 18px; inline-size: 18px; block-size: 18px; margin: 0;
    appearance: auto !important; -webkit-appearance: checkbox !important;
    accent-color: var(--brand-primary); cursor: pointer; background: initial !important;
  }
  html body #wfHomeCustomizer .wf-home-visibility::before,
  html body #wfHomeCustomizer .wf-home-visibility::after { content: none !important; display: none !important; }
  #wfHomeCustomizer .wf-home-section-tile[data-visible="false"] .wf-home-section-choice { color: var(--text2); }
  #wfHomeCustomizer .wf-home-section-controls {
    display: grid; gap: 5px; padding: 0 0 8px; border-block-end: 1px solid var(--border);
  }
  #wfHomeCustomizer .wf-home-drag-handle {
    display: flex; order: 0; flex: 1 1 auto; justify-content: space-between; gap: 5px;
    min-inline-size: 0; min-block-size: 44px; margin: 0; padding: 5px 0;
    border: 0; border-radius: 7px; color: inherit; background: transparent;
    font: inherit; font-size: 13px; font-weight: 600; line-height: 1.5; text-align: start;
    cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  #wfHomeCustomizer .wf-home-drag-handle .wf-home-section-name { flex: 1; pointer-events: none; }
  #wfHomeCustomizer .wf-home-drag-handle .wf-home-editor-icon {
    inline-size: 12px; block-size: 18px; color: var(--text2); opacity: .6; pointer-events: none;
  }
  #wfHomeCustomizer .wf-home-drag-handle:active { cursor: grabbing; }
  #wfHomeCustomizer .wf-home-section-tile.is-selected {
    border-color: var(--ui-accent, var(--brand-primary)); background: var(--home-editor-tint);
  }
  #wfHomeCustomizer .wf-home-section-tile.is-selected .wf-home-drag-handle .wf-home-editor-icon {
    color: var(--ui-accent, var(--brand-primary)); opacity: 1;
  }
  #wfHomeCustomizer .wf-home-width-options {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px;
    padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--input);
  }
  #wfHomeCustomizer .wf-home-width-options .wf-home-editor-button {
    padding: 4px; border-color: transparent; background: transparent; overflow-wrap: anywhere;
  }
  #wfHomeCustomizer .wf-home-width-options .wf-home-editor-button[aria-pressed="true"] {
    color: var(--ui-accent, var(--brand-primary)); background: var(--card); border-color: var(--border);
  }
  #wfHomeCustomizer .wf-home-editor-footer {
    display: grid; flex: none; gap: 6px; padding-block-start: 8px;
    border-block-start: 1px solid var(--border); background: var(--card);
  }
  #wfHomeCustomizer .wf-home-editor-tools { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 4px; }
  #wfHomeCustomizer .wf-home-editor-tools .wf-home-editor-button { padding: 4px; }
  #wfHomeCustomizer .wf-home-editor-advanced[aria-expanded="true"] { background: var(--home-editor-tint); border-color: var(--brand-primary); }
  #wfHomeCustomizer .wf-home-editor-reset { color: var(--text2); }
  #wfHomeCustomizer .wf-home-editor-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  #wfHomeCustomizer .wf-home-editor-actions .wf-home-editor-button { min-block-size: 44px; font-size: 13px; }
  #wfHomeCustomizer .wf-home-editor-button.is-primary { color: var(--on-primary, #fff); background: var(--brand-primary); border-color: var(--brand-primary); }
  #wfHomeCustomizer .wf-home-editor-empty, #wfHomeCustomizer .wf-home-editor-status {
    margin: 0 0 5px; padding: 7px; border: 1px dashed var(--border); border-radius: 8px;
    background: var(--home-editor-tint); color: var(--text); font-size: 12px; line-height: 1.65;
  }
  #wfHomeCustomizer .wf-home-editor-status { color: var(--red, #ad3b43); border-color: currentColor; }
  /* The original row follows the finger within this same list. The measured
     placeholder keeps the destination open without cloning any content. */
  #wfHomeCustomizer .wf-home-section-tile.is-dragging {
    position: absolute !important; z-index: 3; right: auto !important; bottom: auto !important;
    margin: 0 !important; max-inline-size: none; transform: none !important;
    border-color: var(--ui-accent, var(--brand-primary)); background: var(--card);
    box-shadow: 0 5px 14px rgb(18 42 55 / 18%); opacity: 1;
    pointer-events: none; cursor: grabbing; transition: none !important;
  }
  #wfHomeCustomizer .wf-home-drop-space {
    min-inline-size: 0; margin: 0; border: 1px dashed var(--ui-accent, var(--brand-primary));
    border-radius: 9px; background: var(--home-editor-tint); pointer-events: none;
  }
  #wfHomeCustomizer .wf-home-editor-grid.is-dragging {
    user-select: none; -webkit-user-select: none;
  }
  #wfHomeCustomizer .wf-home-editor-live {
    position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap; margin: -1px; padding: 0; border: 0;
  }
  @media (max-height: 440px) {
    html body #wfHomeDock > #wfHomeCustomizer { padding: 8px !important; gap: 5px; }
    /* Keep the short scroll area available for actual rows. The count and
       instructions remain readable by assistive technology and descriptions. */
    #wfHomeCustomizer .wf-home-editor-body > .wf-home-editor-count,
    #wfHomeCustomizer .wf-home-editor-body > .wf-home-editor-hint {
      position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden;
      clip-path: inset(50%); white-space: nowrap; margin: -1px; padding: 0; border: 0;
    }
    html body #wfHomeCustomizer .dash-dock-toolbar { padding-block-end: 4px; }
    #wfHomeCustomizer .dash-dock-toolbar .wf-home-editor-button { min-block-size: 32px; }
    #wfHomeCustomizer .wf-home-editor-footer { gap: 4px; padding-block-start: 5px; }
    #wfHomeCustomizer .wf-home-editor-footer > .wf-home-editor-hint { display: none; }
    #wfHomeCustomizer .wf-home-editor-tools .wf-home-editor-button { min-block-size: 32px; }
    #wfHomeCustomizer .wf-home-editor-actions .wf-home-editor-button { min-block-size: 36px; }
  }
}
@media print {
  #wfHomeDock, .wf-dashboard-dock-backdrop { display: none !important; }
}
