/* ══════════════════════════════════════════════════════════════════════════
   MEDIA → WIDGETS library.
   Sibling of Медиатека / Наклейки: the header band, search, primary button,
   card, menu, dialog and pagination all follow the --mi-* media system in
   style.vNN.css. Only widget-specific pieces (connection rail, preview stage,
   scaled canvas) are defined here. Ids are the JS contract; keep them.
   ══════════════════════════════════════════════════════════════════════════ */
.widgetsPage { width: 100%; margin: 0; color: var(--mi-text); font: 400 14px/1.5 ClearSans, sans-serif; -webkit-font-smoothing: antialiased; }
.widgetsPage *, .widgetsPage *::before, .widgetsPage *::after { box-sizing: border-box; }
.widgetsPage [hidden] { display: none !important; }
.widgetsPage h1, .widgetsPage h2, .widgetsPage h3, .widgetsPage p { margin: 0; }
.widgetsPage button, .widgetsPage input, .widgetsPage select { font: inherit; letter-spacing: normal; }
.widgetsPage button { cursor: pointer; }
.widgetsPage button:disabled { cursor: default; }
.widgetsPage ::selection, .wg-dialog ::selection { background: rgba(75,144,142,.24); }
.widgetsPage :is(button,a,input,select):focus-visible, .wg-dialog :is(button,a,input):focus-visible { outline: 2px solid var(--mi-brand); outline-offset: 2px; }
.widgetsPage .mediaSearchInput:focus-visible { outline: none; }
.widgetsPage svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── Header band (shared media chrome; only the deltas live here) ─────── */
.widgetsPage .wg-header { display: block; padding: 0; margin: 0; } /* neutralises the legacy `header { display:flex; padding:20px 0 }` rule */
.widgetsPage .mediaPageHeaderInner { padding-bottom: 26px; }
.widgetsPage .mediaHeaderTop { margin-bottom: 0; }
.widgetsPage #addWidget { height: auto; padding: 11px 18px; border-radius: 11px; background: var(--mi-brand-grad); font-size: 14.5px; }
.widgetsPage #addWidget svg { width: 15px; height: 15px; stroke-width: 2; }
.widgetsPage #addWidget:disabled { background: #b7c8c6; box-shadow: none; transform: none; filter: none; color: #f4f8f7; }

/* ── Workspace: one raised plate, tinted connection pane + white library ──
   Layers, page → plate → pane → selected row, carry the depth; both pane
   headers share one 60px row and one continuous hairline. */
.wg-workspace { --wg-pane: #f5f8f7; --wg-hair: #e6ecec; display: grid; grid-template-columns: 260px minmax(0, 1fr); margin: 22px 36px 40px; min-height: 560px; border: 1px solid var(--mi-border); border-radius: 20px; background: #fff; box-shadow: 0 1px 2px rgba(21,48,58,.04), 0 18px 40px -24px rgba(21,48,58,.18); overflow: clip; }
.wg-sidebar { display: flex; flex-direction: column; min-width: 0; background: var(--wg-pane); border-right: 1px solid var(--wg-hair); }
.wg-sidebarHeading, .wg-toolbar { display: flex; align-items: center; gap: 10px; height: 60px; flex-shrink: 0; border-bottom: 1px solid var(--wg-hair); }
.wg-sidebarHeading { padding: 0 20px; }
.wg-sidebarHeading h2, .wg-libraryHeading h2 { font-size: 15px; font-weight: 500; letter-spacing: -.01em; line-height: 1.3; color: var(--mi-text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-count { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: rgba(21,48,58,.06); color: var(--mi-text-2); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.wg-sources { display: flex; flex-direction: column; gap: 2px; padding: 10px; max-height: 480px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--mi-border-strong) transparent; }
.wg-source { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--mi-text-2); text-align: left; transition: background-color .16s var(--mi-ease), color .16s var(--mi-ease), border-color .16s var(--mi-ease), box-shadow .16s var(--mi-ease), transform .12s var(--mi-ease); }
.wg-source svg { width: 15px; height: 15px; color: var(--mi-muted); transition: color .16s var(--mi-ease); }
.wg-source span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; line-height: 1.35; }
.wg-source:active { transform: scale(.985); }
.wg-source[aria-pressed="true"] { background: #fff; border-color: var(--mi-border); color: var(--mi-brand-deep); font-weight: 500; box-shadow: 0 1px 2px rgba(21,48,58,.06), 0 4px 10px -6px rgba(21,48,58,.12); }
.wg-source[aria-pressed="true"] svg { color: var(--mi-brand); }
.wg-guide { padding: 12px 20px 18px; }
.wg-guide h3 { font-size: 13px; line-height: 1.45; font-weight: 500; color: var(--mi-text); margin-bottom: 5px; }
.wg-guide p { font-size: 12.5px; line-height: 1.6; color: var(--mi-muted); }
.wg-dataLink { display: flex; align-items: center; gap: 9px; margin-top: auto; height: 60px; flex-shrink: 0; padding: 0 20px; border-top: 1px solid var(--wg-hair); color: var(--mi-brand-dark); font-size: 13.5px; font-weight: 500; text-decoration: none; transition: background-color .16s var(--mi-ease), color .16s var(--mi-ease); }
.wg-dataLink > span { flex: 1; min-width: 0; }
.wg-dataLink .wg-chevron { width: 14px; height: 14px; color: var(--mi-muted); transition: transform .16s var(--mi-ease); }
.wg-mobileSource { display: none; }
.wg-muted { padding: 8px 10px; font-size: 12.5px; color: var(--mi-muted); }

/* ── Library pane ────────────────────────────────────────────────────── */
.wg-library { display: flex; flex-direction: column; min-width: 0; background: #fff; }
.wg-toolbar { justify-content: space-between; gap: 16px; padding: 0 24px; }
.wg-libraryHeading { display: flex; align-items: center; gap: 9px; min-width: 0; }
.widgetsPage .wg-search { width: 260px; flex-shrink: 0; }
.widgetsPage #filterWidget { height: 36px; flex: none; padding: 6px 32px 6px 34px; background-color: var(--mi-sunken); background-image: none; border: 1px solid var(--mi-border); border-radius: 9px; font-size: 13.5px; }
.widgetsPage #filterWidget::placeholder { color: var(--mi-subtle); font-weight: 400; font-size: 13.5px; }
.widgetsPage #filterWidget:focus { background-color: #fff; border-color: var(--mi-brand); box-shadow: var(--mi-brand-ring); }
.widgetsPage #filterWidget:disabled { color: var(--mi-subtle); }
.widgetsPage #filterWidget::-webkit-search-cancel-button { display: none; }
.widgetsPage .mediaSearchIcon { left: 12px; width: 14px; height: 14px; }
.widgetsPage .mediaSearchClear { width: 20px; height: 20px; right: 9px; font-size: 16px; line-height: 18px; }
.wg-libraryBody { flex: 1; padding: 22px 24px 20px; }
.widgetsPage .wg-previewNote { font-size: 12.5px; color: var(--mi-muted); margin: 18px 0 0; }

/* ── Card grid ───────────────────────────────────────────────────────── */
.wg-grid { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.wg-grid::before { content: 'Обновление…'; position: absolute; right: 0; top: -18px; color: var(--mi-muted); font-size: 11px; opacity: 0; pointer-events: none; transition: opacity 120ms ease-out; }
.wg-grid[aria-busy="true"]::before { opacity: 1; transition-delay: 180ms; }
.wg-card { position: relative; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--mi-border); border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(21,48,58,.04), 0 6px 16px -12px rgba(21,48,58,.12); transition: transform .24s var(--mi-ease), box-shadow .24s var(--mi-ease), border-color .18s var(--mi-ease); }
.wg-card:hover { transform: translateY(-2px); border-color: var(--mi-border-strong); box-shadow: 0 18px 32px -14px rgba(21,48,58,.18), 0 4px 10px -4px rgba(21,48,58,.08); }
.wg-cardPreview { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 20px; margin: 0; overflow: hidden; border: 0; border-bottom: 1px solid var(--mi-border-light); border-radius: 13px 13px 0 0; background-color: #f1f4f4; background-image: radial-gradient(ellipse at 50% 0%, #f8fafa, transparent 70%); color: var(--mi-muted); text-align: center; transition: background-color .2s var(--mi-ease); }
.wg-cardPreview:hover { background-color: #ebefef; }
.wg-cardPreview:focus-visible { outline-offset: -3px; }
.wg-previewHost { display: block; width: 100%; height: 100%; position: relative; overflow: hidden; isolation: isolate; }
.wg-previewCanvas { position: absolute; transform-origin: top left; overflow: hidden; pointer-events: none; text-align: left; box-shadow: 0 6px 22px -8px rgba(21,48,58,.22), 0 1px 3px rgba(21,48,58,.08); }
.wg-previewCanvas.wg-transparent { background-color: #fff; background-image: repeating-conic-gradient(#e9eeee 0% 25%, transparent 0% 50%); background-size: 16px 16px; }
.wg-previewElement { position: absolute; display: flex; align-items: center; overflow: hidden; box-sizing: border-box; line-height: 1.2; }
.wg-previewElement > span { width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.wg-previewElement > img { width: 100%; height: 100%; display: block; }
.wg-previewCaption { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 8px; border-radius: 7px; background: rgba(255,255,255,.92); backdrop-filter: blur(4px); color: #1a3942; font-size: 12px; font-weight: 500; box-shadow: var(--mi-shadow-xs); opacity: 0; transform: translateY(6px); transition: opacity .2s var(--mi-ease), transform .2s var(--mi-ease); }
.wg-previewCaption svg { width: 13px; height: 13px; }
.wg-card:hover .wg-previewCaption, .wg-cardPreview:focus-visible .wg-previewCaption { opacity: 1; transform: none; }
.wg-cardInfo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 10px 11px 15px; }
.wg-cardInfo > div:first-child { min-width: 0; flex: 1; }
.wg-cardInfo h3 { font-size: 14.5px; font-weight: 500; letter-spacing: -.012em; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-cardInfo p { margin-top: 4px; font-size: 12.5px; color: var(--mi-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-cardActions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.wg-editLink, .wg-iconButton { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #5a7a82; text-decoration: none; transition: background-color .15s var(--mi-ease), color .15s var(--mi-ease); }
.wg-editLink:hover, .wg-iconButton:hover, .wg-iconButton[aria-expanded="true"] { background: #e8eef2; color: var(--mi-text); }
.wg-editLink svg, .wg-iconButton svg { width: 15px; height: 15px; }

/* ── Card menu (same family as .mediaMenu) ───────────────────────────── */
.wg-menu { position: absolute; right: 10px; bottom: 52px; z-index: 5; min-width: 204px; padding: 6px; border-radius: 12px; background: rgba(255,255,255,.97); backdrop-filter: blur(24px); box-shadow: var(--mi-shadow-menu); animation: wg-menuIn .14s var(--mi-ease); }
@keyframes wg-menuIn { from { opacity: 0; transform: scale(.96) translateY(4px); } to { opacity: 1; transform: none; } }
.wg-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: #3a4f56; font-size: 14px; text-align: left; letter-spacing: -.01em; }
.wg-menu button svg { width: 15px; height: 15px; color: #5a7a82; opacity: .75; }
.wg-menu button:hover, .wg-menu button:focus-visible { background: #f5f7f9; }
.wg-menu button[data-wg-action="delete"] { position: relative; margin-top: 5px; color: var(--mi-danger); }
.wg-menu button[data-wg-action="delete"]::before { content: ''; position: absolute; left: 4px; right: 4px; top: -3px; height: 1px; background: var(--mi-border); }
.wg-menu button[data-wg-action="delete"] svg { color: var(--mi-danger); opacity: 1; }
.wg-menu button[data-wg-action="delete"]:hover { background: #fdecec; }

/* ── Empty, error and loading states (same family as .mediaState) ────── */
.wg-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 420px; padding: 60px 20px; }
.wg-empty > svg { width: 64px; height: 64px; padding: 19px; margin-bottom: 18px; border-radius: 18px; color: #b0bec5; background: linear-gradient(165deg, #f8fafa 0%, #eef1f0 100%); box-shadow: 0 0 0 1px var(--mi-border-light) inset, 0 8px 20px -8px rgba(21,48,58,.10); stroke-width: 1.5; }
.wg-empty h3 { font-size: 18px; font-weight: 600; letter-spacing: -.02em; color: var(--mi-text); }
.wg-empty p { max-width: 360px; margin: 8px 0 20px; font-size: 14px; line-height: 1.55; color: var(--mi-muted); }
.wg-skeleton { aspect-ratio: 4 / 3; border: 1px solid var(--mi-border-light); border-radius: 14px; background: #fff; overflow: hidden; }
.wg-skeleton::before { content: ''; display: block; height: calc(100% - 62px); background: #f0f2f4; animation: wg-pulse 1.4s ease-in-out infinite alternate; }
@keyframes wg-pulse { to { opacity: .45; } }
.wg-previewFallback { display: flex; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--mi-muted); font-size: 12.5px; }
.wg-previewFallback svg { width: 26px; height: 26px; opacity: .55; }

/* ── Pagination (same family as .mediaLibraryPagination) ─────────────── */
.wg-pagination { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; margin: 0; height: 60px; padding: 0 24px; border-top: 1px solid var(--wg-hair); color: var(--mi-text-2); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.wg-range { justify-self: start; white-space: nowrap; }
.wg-pagination nav { display: flex; align-items: center; gap: 5px; justify-self: center; }
.wg-pagination nav span { min-width: 56px; text-align: center; color: var(--mi-text-2); }
.wg-pagination button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--mi-border); border-radius: 8px; background: var(--mi-surface); color: var(--mi-text-2); box-shadow: var(--mi-shadow-xs); transition: color .15s var(--mi-ease), border-color .15s var(--mi-ease), background .15s var(--mi-ease), transform .15s var(--mi-ease); }
.wg-pagination button:hover:not(:disabled) { color: var(--mi-text); border-color: var(--mi-border-strong); background: var(--mi-sunken); }
.wg-pagination button:active:not(:disabled) { transform: translateY(1px); }
.wg-pagination button:disabled { color: var(--mi-subtle); background: var(--mi-sunken); border-color: var(--mi-border-light); box-shadow: none; opacity: .68; }
.wg-pagination button svg { width: 14px; height: 14px; stroke-width: 2; }

/* ── Buttons used in the empty state and the dialog ──────────────────── */
.wg-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 10px 18px; border: 1px solid transparent; border-radius: 10px; font-size: 14px !important; font-weight: 500 !important; line-height: 1.2; text-decoration: none; transition: filter .15s var(--mi-ease), transform .12s var(--mi-ease), background-color .15s var(--mi-ease), border-color .15s var(--mi-ease); }
.wg-button:active:not(:disabled) { transform: scale(.98); }
.wg-primary { color: #fff; background: var(--mi-brand-grad); box-shadow: 0 4px 12px rgba(75,144,142,.25); }
.wg-primary:hover:not(:disabled) { filter: brightness(1.05); color: #fff; }
.wg-quiet { background: #fff; border-color: var(--mi-border); color: #5a7a82; }
.wg-quiet:hover { background: #f8fafc; border-color: var(--mi-border-strong); }
.wg-danger { background: var(--mi-danger); box-shadow: 0 4px 12px rgba(220,53,69,.25); }
.wg-danger:hover:not(:disabled) { filter: brightness(1.05); }
.wg-button:disabled { opacity: .55; }

/* ── Dialog (same family as .mediaDialog) ────────────────────────────── */
.wg-dialog { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 22px 24px 20px; border: 0; border-radius: 16px; color: var(--mi-text); background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.04); font: 400 14px/1.5 ClearSans, sans-serif; }
.wg-dialog[open] { animation: wg-pop .22s var(--mi-ease); }
@keyframes wg-pop { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
.wg-dialog::backdrop { background: rgba(15,30,36,.40); backdrop-filter: blur(4px); }
.wg-dialog *, .wg-dialog *::before, .wg-dialog *::after { box-sizing: border-box; }
.wg-dialog [hidden] { display: none !important; }
.wg-dialog h2, .wg-dialog p { margin: 0; }
.wg-dialog button, .wg-dialog input { font: inherit; }
.wg-dialog button { cursor: pointer; }
.wg-dialogHead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.wg-dialogHead h2 { font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; color: #1a3942; line-height: 1.35; overflow-wrap: anywhere; padding-top: 4px; }
.wg-dialogClose { display: inline-grid; place-items: center; width: 32px; height: 32px; margin: -4px -6px 0 0; border: 0; border-radius: 8px; background: transparent; color: #b8c8d0; flex-shrink: 0; transition: background-color .15s, color .15s; }
.wg-dialogClose:hover { background: #f5f7f9; color: var(--mi-text); }
.wg-dialogClose svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; fill: none; }
.wg-dialog > p { font-size: 13.5px; line-height: 1.55; color: #5a7a82; margin-bottom: 20px; }
.wg-dialog label { display: block; font-size: 12.5px; font-weight: 500; color: var(--mi-text-2); margin-bottom: 7px; }
.wg-dialog input { width: 100%; padding: 11px 14px; border: 1px solid var(--mi-border); border-radius: 10px; background: #f8fafc; color: #1a3942; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.wg-dialog input::placeholder { color: #b8c8d0; }
.wg-dialog input:focus { border-color: var(--mi-brand); background: #fff; box-shadow: var(--mi-brand-ring); }
.wg-dialogActions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--mi-border); }
.wg-formError { font-size: 13px; color: #b7343d; margin-top: 10px !important; }
.wg-dialog.wg-dialogPreview { width: min(920px, calc(100vw - 32px)); }
.wg-largePreview { padding: 24px; border-radius: 12px; background: #f0f2f4; box-shadow: 0 0 0 1px var(--mi-border-light) inset; }
.wg-largePreview .wg-previewHost { height: auto; min-height: 160px; max-height: 56dvh; aspect-ratio: var(--wg-preview-ratio, 4 / 3); }
.wg-previewDetails { display: flex; justify-content: space-between; gap: 20px; color: var(--mi-text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; margin-top: 12px !important; }
.wg-srOnly { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (min-width: 1700px) { .wg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .wg-workspace { grid-template-columns: 220px minmax(0, 1fr); margin: 20px 24px 36px; }
  .wg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wg-sidebarHeading, .wg-guide, .wg-dataLink { padding-inline: 16px; }
  .wg-toolbar { padding: 0 18px; }
  .wg-libraryBody { padding: 18px; }
  .wg-pagination { padding: 0 18px; }
  .widgetsPage .wg-search { width: 210px; }
  .wg-cardPreview { padding: 16px; }
}
@media (max-width: 760px) {
  .wg-workspace { display: block; margin: 16px 18px 32px; min-height: 0; border-radius: 16px; }
  .wg-sidebar { display: block; border-right: 0; border-bottom: 1px solid var(--wg-hair); padding: 14px 16px 16px; }
  .wg-sidebarHeading, .wg-sources, .wg-guide { display: none; }
  .wg-mobileSource { display: block; }
  .wg-mobileSource label { display: block; font-size: 12.5px; font-weight: 500; color: var(--mi-text-2); margin-bottom: 7px; }
  .widgetsPage #tabSource { width: 100%; height: 44px; padding: 0 40px 0 14px; border: 1px solid var(--mi-border); border-radius: 9px; background: var(--mi-surface) url('../file/select_arrow.svg') no-repeat right 14px center / 10px 7px !important; color: var(--mi-text); font-size: 15px; line-height: 1.2; box-shadow: var(--mi-shadow-xs); }
  .widgetsPage #tabSource:focus { border-color: var(--mi-brand); box-shadow: var(--mi-brand-ring); outline: none; }
  .wg-dataLink { margin: 10px -16px -16px; height: 52px; padding: 0 16px; }
  .wg-library { display: block; }
  .wg-toolbar { height: auto; flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; }
  .widgetsPage .wg-search { width: 100%; }
  .widgetsPage #filterWidget { height: 44px; font-size: 16px; }
  .wg-libraryBody { padding: 16px; }
  .wg-grid { gap: 14px; }
  .wg-iconButton, .wg-editLink { width: 40px; height: 40px; }
  .wg-cardInfo { padding: 11px 8px 11px 14px; }
  .wg-previewCaption { opacity: 1; transform: none; }
  .wg-empty { min-height: 320px; padding: 44px 16px; }
  .wg-pagination { height: 56px; padding: 0 16px; }
}
@media (max-width: 600px) {
  .widgetsPage .mediaHeaderTop { gap: 14px; }
  .widgetsPage #addWidget { padding: 10px 14px; font-size: 13.5px; }
}
@media (max-width: 520px) {
  .wg-grid { grid-template-columns: minmax(0, 1fr); }
  .wg-cardPreview { padding: 20px; }
  .wg-pagination { grid-template-columns: minmax(0, 1fr) auto; }
  .wg-dialog { padding: 20px; }
  .wg-largePreview { padding: 14px; }
  .wg-previewDetails { flex-direction: column; gap: 4px; }
  .wg-dialogActions { flex-direction: column-reverse; }
  .wg-dialogActions .wg-button { width: 100%; }
}
@media (hover: hover) and (pointer: fine) {
  .wg-source:not([aria-pressed="true"]):hover { background: rgba(21,48,58,.05); color: var(--mi-text); }
  .wg-dataLink:hover { background: rgba(21,48,58,.04); color: var(--mi-brand-deep); }
  .wg-dataLink:hover .wg-chevron { transform: translateX(2px); color: var(--mi-brand-dark); }
}
@media (hover: none), (pointer: coarse) {
  .wg-previewCaption { opacity: 1; transform: none; }
  .wg-card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .widgetsPage *, .widgetsPage *::before, .widgetsPage *::after, .wg-dialog, .wg-dialog * { animation: none !important; transition: none !important; }
  .wg-card:hover { transform: none; }
}
@media (forced-colors: active) {
  .wg-source[aria-pressed="true"] { outline: 2px solid Highlight; }
  .wg-card, .wg-menu, .wg-dialog { border: 1px solid CanvasText; }
}
