/* =====================================================
   DECK BY CREATORS PACKS — UI design system (the dashboard)
   From the build brief's base CSS, adapted to this panel: tile states come from the engine
   (data-state / data-flash / aria-disabled set by app/tile.js), dialogs overlay the panel.
   ===================================================== */

:root {
  --deck-bg: #141416;
  --deck-panel: #1b1b1e;
  --deck-surface: #242427;
  --deck-tile: #29292c;
  --deck-hover: #323236;
  --deck-input: #202023;
  --deck-border: #3b3b40;
  --deck-border-strong: #505056;
  --deck-text: #f2f2f4;
  --deck-text-secondary: #a3a3aa;
  --deck-text-muted: #77777f;
  --deck-yellow: #ffe103;
  --deck-yellow-hover: #f4d800;
  --deck-blue: #2778ff;
  --deck-green: #09d86a;
  --deck-red: #ff4a54;
  --deck-radius-panel: 13px;
  --deck-radius-dialog: 12px;
  --deck-radius-tile: 10px;
  --deck-radius-control: 8px;
  --deck-transition: 140ms ease;
}

/* The dashboard replaces the shell's header, nav and strip while it shows. */
.ck-app[data-view="dashboard"] .ck-header,
.ck-app[data-view="dashboard"] .ck-nav,
.ck-app[data-view="dashboard"] .ck-strip,
.ck-app[data-view="dashboard"] .ck-sheet-head,
.ck-app[data-view="dashboard"] .cp-status { display: none !important; }
.ck-app[data-view="dashboard"] { background: var(--deck-bg); }
.ck-app[data-view="dashboard"] .ck-main { padding: 0; overflow: hidden; display: flex; flex-direction: column; }

.deck-app, .deck-app *, .deck-app *::before, .deck-app *::after, .deck-scope, .deck-scope *, .deck-scope *::before, .deck-scope *::after { box-sizing: border-box; }
.deck-app [hidden], .deck-scope[hidden], .deck-scope [hidden] { display: none !important; }
.deck-scope { font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.4; color: var(--deck-text); }
.deck-app {
  position: relative; display: flex; flex-direction: column; flex: 1 1 auto; width: 100%; min-width: 0; min-height: 100%; height: 100%;
  background: var(--deck-bg); color: var(--deck-text); font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.4;
}
.deck-app button, .deck-app input, .deck-app select, .deck-scope button, .deck-scope input, .deck-scope select { font: inherit; }
.deck-app button, .deck-scope button { cursor: pointer; }
.deck-app button:disabled, .deck-scope button:disabled { cursor: not-allowed; opacity: 0.45; }
.deck-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* Header */
.deck-topbar { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: 38px; padding: 0 10px 0 14px; border-bottom: 1px solid #303034; }
.deck-topbar__title { margin-right: auto; color: var(--deck-text-muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.deck-header { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px 24px 12px; }
.deck-head { display: contents; }
.deck-topbar-buttons { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
/* Two headers (Settings ▸ Header, dashboard.js applyHeader): large = the centred logo under the bar;
   compact = one line, the small logo on the left of the bar. */
.deck-head[data-header="compact"] .deck-header { display: none; }
.deck-head[data-header="large"] .deck-logo-wrap--compact { display: none; }
.deck-head[data-header="compact"] .deck-topbar { min-height: 44px; }
.deck-logo-wrap.deck-logo-wrap--compact { width: auto; height: 24px; flex: 0 0 auto; }
.deck-logo-wrap--compact .deck-logo { width: auto; height: 24px; }
.deck-logo-wrap { position: relative; display: block; width: min(100%, 360px); line-height: 0; }
.deck-logo { display: block; width: 100%; height: auto; object-fit: contain; -webkit-user-drag: none; user-select: none; }

/* Toolbar */
.deck-profile-toolbar { display: flex; align-items: center; gap: 10px; padding: 8px 24px 16px; }
.deck-profile-field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.deck-profile-field svg { position: absolute; left: 14px; color: var(--deck-text-secondary); pointer-events: none; }
.deck-profile-select { flex: 1; min-width: 0; min-height: 44px; padding: 0 34px 0 42px; background: var(--deck-surface); color: var(--deck-text); border: 1px solid var(--deck-border); border-radius: var(--deck-radius-control); outline: none; appearance: none; -webkit-appearance: none; font-size: 14px; }
.deck-profile-select:focus { border-color: var(--deck-yellow); }
.deck-profile-field::after { content: ""; position: absolute; right: 14px; width: 8px; height: 8px; border-right: 1.75px solid var(--deck-text-secondary); border-bottom: 1.75px solid var(--deck-text-secondary); transform: translateY(-3px) rotate(45deg); pointer-events: none; }
.deck-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; padding: 0; background: var(--deck-surface); color: var(--deck-text-secondary); border: 1px solid var(--deck-border); border-radius: var(--deck-radius-control); transition: background var(--deck-transition), color var(--deck-transition); }
.deck-icon-button:hover { background: var(--deck-hover); color: var(--deck-text); }
.deck-icon-button[aria-pressed="true"] { color: var(--deck-yellow); border-color: var(--deck-yellow); }
.deck-icon-button--small { width: 30px; height: 30px; background: transparent; border-color: transparent; }
.deck-icon-button--small:hover { background: var(--deck-hover); }

/* Edit-mode banner */
.deck-editbar { display: flex; align-items: center; gap: 10px; margin: -6px 24px 12px; padding: 8px 12px; border: 1px solid var(--deck-yellow); border-radius: var(--deck-radius-control); background: #2a2817; color: var(--deck-text); font-size: 12px; }
.deck-editbar span { flex: 1; color: var(--deck-text-secondary); }

/* Action grid */
.deck-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0 24px 16px; }
.deck-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-width: 0; min-height: 112px; padding: 14px 8px; background: var(--deck-tile); color: var(--deck-text); border: 1px solid var(--deck-border); border-radius: var(--deck-radius-tile); text-align: center; transition: background var(--deck-transition), border-color var(--deck-transition); touch-action: manipulation; }
.deck-tile:hover { background: var(--deck-hover); border-color: var(--deck-border-strong); }
.deck-tile:active { background: #3a3a3e; }
.deck-tile.is-selected { background: #302e20; border: 2px solid var(--deck-yellow); }
.deck-tile[aria-disabled="true"], .deck-tile.is-unavailable { opacity: 0.45; cursor: not-allowed; }
.deck-tile:focus-visible { outline: 2px solid var(--deck-yellow); outline-offset: 2px; }
.deck-tile[data-state="running"] { border-color: var(--deck-yellow); cursor: progress; }
.deck-tile[data-state="running"] .deck-tile-icon { color: var(--deck-yellow); }
.deck-tile[data-flash="success"] { border-color: var(--deck-green); }
.deck-tile[data-flash="nudge"], .deck-tile[data-flash="error"] { border-color: var(--deck-red); }
.deck-tile[data-gap]::before { content: ""; position: absolute; left: -6px; top: 18%; bottom: 18%; width: 2px; border-radius: 1px; background: var(--deck-border-strong); }
.deck-tile[data-hidden-on-strip] .deck-tile-label::after { content: " ·"; color: var(--deck-text-muted); }
.deck-tile-icon { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; color: #d2d2d6; }
.deck-tile-icon svg { width: 100%; height: 100%; }
.deck-tile-label { max-width: 100%; color: var(--deck-text); font-size: 12px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.deck-tile-shortcut { position: absolute; right: 8px; bottom: 6px; color: var(--deck-text-muted); font-size: 10px; }
.deck-tile-accent { position: absolute; left: 10px; top: 10px; width: 7px; height: 7px; border-radius: 50%; }
.deck-tile-add { background: transparent; border: 1px dashed var(--deck-border-strong); color: var(--deck-text-muted); }
.deck-tile-add:hover { background: var(--deck-surface); border-color: var(--deck-yellow); color: var(--deck-text); }
.deck-tile-add svg { width: 28px; height: 28px; }
.deck-editmode .deck-tile:not(.deck-tile-add) { cursor: pointer; }
.deck-editmode .deck-tile:not(.deck-tile-add)::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1px dashed var(--deck-border-strong); pointer-events: none; }
.deck-tile-moves { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; }
.deck-tile-moves button { width: 22px; height: 22px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--deck-surface); color: var(--deck-text-secondary); border: 1px solid var(--deck-border); border-radius: 5px; }
.deck-tile-moves button:hover { color: var(--deck-text); background: var(--deck-hover); }
.deck-tile[data-drag] { z-index: 3; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5); border-color: var(--deck-yellow); cursor: grabbing; }
/* While lifted the tile sticks to the pointer: no easing on its transform (the hover's 160 ms would make it trail). */
.deck-tile[data-drag="lifted"] { transition: none !important; }
.deck-grid[data-dragging] { cursor: grabbing; }
.deck-grid[data-dragging] .deck-tile { pointer-events: none; }

/* Empty state */
.deck-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px 20px; color: var(--deck-text-secondary); text-align: center; grid-column: 1 / -1; }
.deck-empty-state-title { color: var(--deck-text); font-size: 14px; font-weight: 600; }

/* Shortcuts drawer */
.deck-shortcuts-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: calc(100% - 48px); min-height: 52px; margin: 0 24px 16px; padding: 0 16px; background: var(--deck-surface); color: var(--deck-text); border: 1px solid var(--deck-border); border-radius: var(--deck-radius-control); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.deck-shortcuts-trigger:hover { background: var(--deck-hover); }
.deck-shortcuts-trigger > span { display: inline-flex; align-items: center; gap: 14px; }
.deck-shortcuts-trigger svg { color: var(--deck-text-secondary); }
.deck-shortcuts-trigger .deck-chev { transition: transform var(--deck-transition); }
.deck-shortcuts-trigger[aria-expanded="true"] .deck-chev { transform: rotate(90deg); }
/* Your shortcuts in columns (USER: two or three, not one long list): as many as fit at 200 px, never more
   than three, one on a very narrow panel; the note spans them all. */
.deck-shortcuts-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, max(200px, calc((100% - 32px) / 3))), 1fr)); gap: 2px 16px; overflow: hidden; margin: -8px 24px 16px; padding: 6px; background: var(--deck-surface); border: 1px solid var(--deck-border); border-radius: var(--deck-radius-control); }
.deck-shortcuts-note { grid-column: 1 / -1; }
.deck-shortcut-row > span:first-child > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-shortcut-row { min-width: 0; position: relative; }
/* A thin divider between the columns (USER): a line in the middle of the 16 px gap, left of every row; the
   first column's falls outside the list and is clipped by its overflow. */
.deck-shortcut-row::before { content: ''; position: absolute; left: -8.5px; top: 6px; bottom: 6px; width: 1px; background: var(--deck-border); pointer-events: none; }
/* The tiles' hover life on the shortcut rows too (USER): lift 2 px with a soft shadow, the icon grows and
   turns white, the brand streak flicks once along the bottom edge; a press squeezes. Off with Motion. */
.deck-shortcut-row { transition: background var(--deck-transition), transform 160ms cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 160ms ease; }
.deck-shortcut-row svg { transition: transform 160ms cubic-bezier(0.2, 0.9, 0.3, 1.25), color var(--deck-transition); }
.deck-shortcut-row:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35); }
.deck-shortcut-row:hover svg { transform: scale(1.08); color: var(--deck-text); }
.deck-shortcut-row:active { transform: translateY(0) scale(0.97); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); transition-duration: 80ms; }
.deck-shortcut-row::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 0; height: 2px; border-radius: 1px; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, #ff211e, #019dff, #ffe103, #09ff80); }
.deck-shortcut-row:hover::after { animation: deck-flick 420ms ease-out; }
.ck-app[data-motion="off"] .deck-shortcut-row, .ck-app[data-motion="off"] .deck-shortcut-row svg, .ck-app[data-motion="off"] .deck-shortcut-row::after { transition: none !important; animation: none !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) { .deck-shortcut-row, .deck-shortcut-row svg, .deck-shortcut-row::after { animation: none !important; transform: none !important; } }
.deck-shortcut-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 6px; background: transparent; border: 0; color: var(--deck-text); text-align: left; }
.deck-shortcut-row:hover { background: var(--deck-hover); }
.deck-shortcut-row > span:first-child { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.deck-shortcut-row svg { flex: none; color: var(--deck-text-secondary); }
.deck-shortcut-keys { flex: none; color: var(--deck-text-secondary); font-size: 11px; }
.deck-shortcut-keys--none { color: var(--deck-text-muted); }
.deck-shortcuts-note { padding: 6px 10px 4px; color: var(--deck-text-muted); font-size: 11px; }

/* Footer */
.deck-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding: 12px 24px; border-top: 1px solid #303034; color: var(--deck-text-secondary); font-size: 11px; }
.deck-status { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.deck-status__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-status[data-type="error"] .deck-status__text, .deck-status[data-type="warning"] .deck-status__text { color: var(--deck-text); }
.deck-status-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--deck-green); }
.deck-status-dot.is-disconnected { background: var(--deck-text-muted); }
.deck-status-dot.is-error { background: var(--deck-red); }
.deck-status-dot.is-busy { background: var(--deck-yellow); }
.deck-footer__brand { flex: none; letter-spacing: 0.3em; font-size: 10px; text-transform: uppercase; color: var(--deck-text-muted); }

/* Context menu */
.deck-menu { position: fixed; z-index: 1100; min-width: 180px; padding: 6px; background: var(--deck-panel); border: 1px solid var(--deck-border); border-radius: 10px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); }
.deck-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; background: transparent; color: var(--deck-text); border: 0; border-radius: 6px; text-align: left; font-size: 12px; }
.deck-menu button:hover, .deck-menu button:focus-visible { background: var(--deck-hover); outline: none; }
.deck-menu button.is-danger { color: var(--deck-red); }
.deck-menu hr { border: 0; border-top: 1px solid var(--deck-border); margin: 4px 2px; }
.deck-menu svg { color: var(--deck-text-secondary); }

/* Modal overlay + dialog */
.deck-modal-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.68); }
.deck-dialog { display: flex; flex-direction: column; width: min(100%, 430px); max-height: 100%; overflow-y: auto; padding: 20px; background: var(--deck-panel); border: 1px solid var(--deck-border); border-radius: var(--deck-radius-dialog); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38); }
.deck-dialog--small { width: min(100%, 360px); }
.deck-dialog--large { width: min(100%, 560px); }
.deck-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.deck-dialog-title { margin: 0; color: var(--deck-text); font-size: 16px; font-weight: 600; }
.deck-dialog-close { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; background: transparent; color: var(--deck-text-secondary); border: none; border-radius: 6px; }
.deck-dialog-close:hover { color: var(--deck-text); background: var(--deck-hover); }
.deck-dialog-sub { margin: -10px 0 14px; color: var(--deck-text-secondary); font-size: 12px; }
.deck-dialog-centered { text-align: center; }
.deck-dialog-centered .deck-dialog-header { justify-content: center; }

/* Tabs */
.deck-dialog-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--deck-border); margin-bottom: 16px; }
.deck-dialog-tab { flex: 1; min-height: 38px; padding: 8px 12px; background: transparent; color: var(--deck-text-secondary); border: none; border-bottom: 2px solid transparent; }
.deck-dialog-tab.is-active { color: var(--deck-text); border-bottom-color: var(--deck-yellow); }

/* Inputs */
.deck-input { display: block; width: 100%; min-height: 40px; padding: 8px 12px; background: var(--deck-input); color: var(--deck-text); border: 1px solid var(--deck-border-strong); border-radius: var(--deck-radius-control); outline: none; }
.deck-input::placeholder { color: var(--deck-text-muted); }
.deck-input:focus { border-color: var(--deck-yellow); }
.deck-search { position: relative; }
.deck-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--deck-text-secondary); pointer-events: none; }
.deck-search .deck-input { min-height: 44px; padding-left: 40px; }
.deck-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.deck-field > label, .deck-field__label { color: var(--deck-text-secondary); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.deck-field__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.deck-field .ck-field, .deck-field .cp-field { margin: 0; }
.deck-note { color: var(--deck-text-muted); font-size: 11px; line-height: 1.45; }
.deck-error-text { color: var(--deck-red); font-size: 12px; }

/* Action library */
.deck-action-library { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.deck-action-category { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 12px 8px; background: var(--deck-surface); color: var(--deck-text); border: 1px solid var(--deck-border); border-radius: 9px; text-align: center; }
.deck-action-category:hover { background: var(--deck-hover); border-color: var(--deck-border-strong); }
.deck-action-category-icon { width: 24px; height: 24px; color: #d2d2d6; }
.deck-action-category-label { font-size: 11px; line-height: 1.3; overflow-wrap: anywhere; }
.deck-action-category-count { color: var(--deck-text-muted); font-size: 10px; }
.deck-action-list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.deck-action-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; background: transparent; color: var(--deck-text); border: 1px solid transparent; border-radius: 8px; text-align: left; }
.deck-action-item:hover { background: var(--deck-surface); border-color: var(--deck-border); }
.deck-action-item svg { flex: none; width: 20px; height: 20px; color: #d2d2d6; }
.deck-action-item__text { display: flex; flex-direction: column; min-width: 0; }
.deck-action-item__name { font-size: 13px; }
.deck-action-item__meta { color: var(--deck-text-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-back-link { align-self: flex-start; margin: 10px 0 0; padding: 4px 8px; background: transparent; color: var(--deck-text-secondary); border: 0; border-radius: 6px; font-size: 12px; }
.deck-back-link:hover { color: var(--deck-text); background: var(--deck-hover); }

/* Configure */
.deck-config-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.deck-config-icon { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; flex: none; background: var(--deck-surface); color: var(--deck-text); border: 1px solid var(--deck-border); border-radius: 9px; }
.deck-config-icon:hover { border-color: var(--deck-yellow); }
.deck-config-icon svg { width: 26px; height: 26px; }
.deck-config-head .deck-input { flex: 1; }
.deck-config-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; margin-bottom: 8px; padding: 0 12px; background: var(--deck-surface); color: var(--deck-text); border: 1px solid var(--deck-border); border-radius: var(--deck-radius-control); text-align: left; }
.deck-config-row:hover { background: var(--deck-hover); }
.deck-config-row__value { display: inline-flex; align-items: center; gap: 8px; color: var(--deck-text-secondary); font-size: 12px; }
.deck-config-row__swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--deck-border-strong); }
.deck-settings-box { margin: 4px 0 12px; padding: 12px; background: var(--deck-input); border: 1px solid var(--deck-border); border-radius: var(--deck-radius-control); }
.deck-settings-box .ck-field { margin-bottom: 8px; }

/* Icon picker */
.deck-icon-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.deck-icon-choice { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; min-width: 0; padding: 8px; background: var(--deck-surface); color: var(--deck-text-secondary); border: 1px solid var(--deck-border); border-radius: 9px; }
.deck-icon-choice svg { width: 22px; height: 22px; }
.deck-icon-choice:hover { background: var(--deck-hover); color: var(--deck-text); }
.deck-icon-choice.is-selected { color: var(--deck-text); border: 2px solid var(--deck-yellow); }

/* Shortcut editor */
.deck-shortcut-action { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.deck-shortcut-action-icon { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; flex: none; background: var(--deck-surface); border-radius: 9px; }
.deck-shortcut-action-icon svg { width: 26px; height: 26px; }
.deck-shortcut-action-name { font-size: 13px; font-weight: 600; }
.deck-shortcut-action-path { color: var(--deck-text-muted); font-size: 11px; }
.deck-shortcut-capture { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; background: var(--deck-input); color: var(--deck-text); border: 2px solid var(--deck-border-strong); border-radius: 9px; font-weight: 600; font-size: 14px; }
.deck-shortcut-capture.is-capturing { border-color: var(--deck-blue); box-shadow: 0 0 0 2px rgba(39, 120, 255, 0.18); }
.deck-shortcut-scope { margin-top: 10px; color: var(--deck-text-muted); font-size: 11px; line-height: 1.45; }
.deck-scope-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.deck-scope-option { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 74px; padding: 8px 4px; background: var(--deck-surface); color: var(--deck-text-secondary); border: 1px solid var(--deck-border); border-radius: 8px; font-size: 11px; text-align: center; }
.deck-scope-option.is-selected { color: var(--deck-text); border-color: var(--deck-yellow); }
.deck-scope-option:disabled { opacity: 0.35; }
.deck-scope-mark { display: flex; gap: 3px; }
.deck-scope-mark i { display: block; width: 11px; height: 9px; border-radius: 2px; background: #3f3f46; }
.deck-scope-mark i.on { background: #6f6cf0; }
.deck-scope-mark--over { flex-direction: column; gap: 2px; }
.deck-scope-mark--over b { display: block; width: 25px; height: 4px; border-radius: 2px; background: #6f6cf0; }
.deck-menukeys { display: flex; flex-wrap: wrap; gap: 6px; }
.deck-chip { min-width: 34px; height: 28px; padding: 0 8px; background: var(--deck-surface); color: var(--deck-text-secondary); border: 1px solid var(--deck-border); border-radius: 6px; font-size: 11px; }
.deck-chip:hover { color: var(--deck-text); background: var(--deck-hover); }
.deck-chip.is-selected { color: #111114; background: var(--deck-yellow); border-color: var(--deck-yellow); font-weight: 600; }

/* Colour picker */
.deck-swatch-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.deck-swatch { aspect-ratio: 1; min-width: 0; padding: 0; border: 2px solid transparent; border-radius: 6px; }
.deck-swatch.is-selected { outline: 2px solid var(--deck-text); outline-offset: 2px; }
.deck-swatch--none { background: transparent; border: 1px dashed var(--deck-border-strong); color: var(--deck-text-muted); font-size: 10px; }

/* Buttons */
.deck-primary-button { min-height: 40px; padding: 8px 18px; background: var(--deck-yellow); color: #111114; border: none; border-radius: var(--deck-radius-control); font-weight: 600; }
.deck-primary-button:hover { background: var(--deck-yellow-hover); }
.deck-secondary-button { min-height: 40px; padding: 8px 18px; background: var(--deck-surface); color: var(--deck-text); border: 1px solid var(--deck-border-strong); border-radius: var(--deck-radius-control); }
.deck-secondary-button:hover { background: var(--deck-hover); }
.deck-danger-button { min-height: 40px; padding: 8px 14px; background: transparent; color: var(--deck-red); border: 1px solid transparent; border-radius: var(--deck-radius-control); }
.deck-danger-button:hover { border-color: var(--deck-red); }
.deck-dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.deck-dialog-actions .deck-spacer { flex: 1; }
.deck-dialog-actions--center { justify-content: center; }

/* Conflict warning */
.deck-conflict-message { color: var(--deck-text-secondary); font-size: 12px; line-height: 1.6; text-align: center; }
.deck-conflict-key { color: var(--deck-yellow); font-weight: 600; }
.deck-conflict-message strong { color: var(--deck-text); }

/* Responsive */
@media (max-width: 520px) {
  .deck-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-left: 14px; padding-right: 14px; }
  .deck-header, .deck-profile-toolbar, .deck-footer { padding-left: 14px; padding-right: 14px; }
  .deck-shortcuts-trigger { width: calc(100% - 28px); margin-left: 14px; margin-right: 14px; }
  .deck-shortcuts-list, .deck-editbar { margin-left: 14px; margin-right: 14px; }
  .deck-icon-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  .deck-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deck-tile { min-height: 96px; }
  .deck-action-library { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deck-scope-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deck-icon-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .deck-footer { flex-wrap: wrap; }
  .deck-footer__brand { display: none; }
}
@media (max-height: 420px) { .deck-header { padding-top: 8px; padding-bottom: 6px; } .deck-logo-wrap { width: min(100%, 220px); } }
@media (prefers-reduced-motion: reduce) {
  .deck-app *, .deck-app *::before, .deck-app *::after { transition: none !important; animation: none !important; }
}
.ck-app[data-motion="off"] .deck-app * { transition: none !important; }

/* Settings and Help inside a dialog: the panel's own screens, on the dialog's surface */
.deck-dialog--large { width: min(100%, 620px); }
.deck-screen-host { min-height: 0; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.deck-screen-host .ck-screen, .deck-screen-host .cp-section { padding: 0; margin: 0; background: transparent; }
.deck-screen-host .cp-section__head:first-child { display: none; }
.deck-screen-host .ck-row { background: var(--deck-surface); border-color: var(--deck-border); }
/* A row's control drops under its text when both can't fit side by side, so descriptions never crush. */
.deck-screen-host .ck-row { flex-wrap: wrap; row-gap: 8px; }
.deck-screen-host .ck-row__text { flex: 1 1 220px; min-width: min(100%, 200px); }
.deck-screen-host .ck-row__actions { flex: 0 1 auto; max-width: 100%; margin-left: auto; }
.deck-screen-host .cp-select, .deck-screen-host .cp-select select { max-width: 100%; }

/* A short panel (the compact strip) still fits a dialog: less padding, top-aligned, scrolls inside. */
@media (max-height: 360px) { .deck-modal-overlay { padding: 6px; align-items: flex-start; } .deck-dialog { padding: 12px; } .deck-dialog-header { margin-bottom: 8px; } }
@media (prefers-reduced-motion: reduce) { .deck-scope *, .deck-scope *::before, .deck-scope *::after { transition: none !important; animation: none !important; } }

/* The deck picker: Deck's own dropdown */
.deck-profile-button { display: flex; align-items: center; text-align: left; cursor: pointer; }
.deck-profile-button:hover { background: var(--deck-hover); }
.deck-profile-button__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-menu button.is-checked { color: var(--deck-text); font-weight: 600; }
.deck-menu button.is-checked svg { color: var(--deck-yellow); }

/* ---------- Hover life (subtle, once, never looping; off with reduced motion) ----------
   A tile lifts 2 px with a soft shadow, its border brightens, the icon grows a touch and turns white,
   and a thin brand streak (red, blue, yellow, green — or the tile's own colour) sweeps once along the
   bottom. A press squeezes it. Category cards, icon choices and Applies-to cards lift the same way. */
.deck-tile { transition: background var(--deck-transition), border-color var(--deck-transition), transform 160ms cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 160ms ease; overflow: visible; }
.deck-tile-icon { transition: transform 160ms cubic-bezier(0.2, 0.9, 0.3, 1.25), color var(--deck-transition); }
.deck-tile:hover:not([aria-disabled="true"]):not(.is-unavailable) { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35); border-color: #5c5c63; }
.deck-tile:hover:not([aria-disabled="true"]):not(.is-unavailable) .deck-tile-icon { transform: scale(1.08); color: var(--deck-text); }
.deck-tile:active:not([aria-disabled="true"]):not(.is-unavailable) { transform: translateY(0) scale(0.97); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition-duration: 80ms; }
/* Creator Console's brand flick (app.css, cc-quick-flick): one blended red → blue → yellow → green line just
   under the tile, 2 px, inset 3 px; it grows from the middle and flashes once, then fades away entirely. Played
   on hover, when a tile is picked up to drag, and once when a tile is added. */
/* It lies ON the tile's bottom edge: a copy of the tile's outline (same corners), cut down to its bottom 2 px,
   so the light runs along the border and curves up into the rounded corners. */
.deck-tile-flick { position: absolute; inset: -1px; border-radius: inherit; opacity: 0; pointer-events: none;
  background: var(--tile-accent, linear-gradient(90deg, #ff211e, #019dff, #ffe103, #09ff80));
  -webkit-mask-image: linear-gradient(to top, #000 2px, transparent 2px); mask-image: linear-gradient(to top, #000 2px, transparent 2px); }
.deck-tile:hover:not([aria-disabled="true"]):not(.is-unavailable) .deck-tile-flick { animation: deck-flick 420ms ease-out; }
.deck-tile[data-drag="lifted"] .deck-tile-flick { animation: deck-flick 420ms ease-out; }
.deck-tile[data-added] { animation: deck-added 360ms cubic-bezier(0.2, 0.9, 0.3, 1.1) both; }
.deck-tile[data-added] .deck-tile-flick { animation: deck-flick-in 520ms ease-out 120ms both; }
/* grows from the middle (clip, so the corners never stretch), flashes once, fades away entirely */
@keyframes deck-flick { 0% { opacity: 0; clip-path: inset(0 35% 0 35%); } 35% { opacity: 1; clip-path: inset(0 0 0 0); } 100% { opacity: 0; clip-path: inset(0 0 0 0); } }
@keyframes deck-flick-in { 0% { opacity: 0; clip-path: inset(0 70% 0 0); } 35% { opacity: 1; clip-path: inset(0 0 0 0); } 100% { opacity: 0; clip-path: inset(0 0 0 0); } }
@keyframes deck-added { from { opacity: 0; transform: scale(0.86); } to { opacity: 1; transform: none; } }
.deck-tile.is-selected .deck-tile-flick { display: none; }
.deck-tile-add { transition: background var(--deck-transition), border-color var(--deck-transition), color var(--deck-transition), transform 160ms ease; }
.deck-tile-add:hover svg { transform: rotate(90deg); transition: transform 220ms cubic-bezier(0.2, 0.8, 0.3, 1); }
.deck-tile-add svg { transition: transform 220ms cubic-bezier(0.2, 0.8, 0.3, 1); }
.deck-action-category, .deck-icon-choice, .deck-scope-option, .deck-action-item { transition: background var(--deck-transition), border-color var(--deck-transition), transform 140ms ease, box-shadow 140ms ease; }
.deck-action-category:hover, .deck-scope-option:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3); }
.deck-icon-choice:hover { transform: translateY(-1px) scale(1.05); }
.deck-action-category:active, .deck-icon-choice:active, .deck-scope-option:active:not(:disabled) { transform: scale(0.97); transition-duration: 80ms; }
.ck-app[data-motion="off"] .deck-tile, .ck-app[data-motion="off"] .deck-tile *, body[data-motion="off"] .deck-scope * { transition: none !important; animation: none !important; transform: none !important; }
@media (prefers-reduced-motion: reduce) { .deck-tile, .deck-tile *, .deck-scope * { animation: none !important; transform: none !important; } }

/* ---------- Logo power-on (ported from Creator Console, app.css "Logo power-on") ----------
   Once, when the dashboard first shows: the keypad icon slides in from the left, a run of RGBY energy crosses
   and reveals the DECK wordmark, a blink of colour fringing snaps into focus, the wordmark brightens,
   "BY CREATORS PACKS" rises, a shine passes, one breath of glow — then the plain image for the rest of the
   session. Hover plays one small shine (rationed in dashboard.js).
   The logo is one picture with its glow baked in, so each animated part is the same picture seen through a
   soft-edged window over one region. Measured on deck-logo.png (600 x 200, the "Neon Rainbow" logo of
   2026-10-13): icon 3–30% across and 20–82% down; DECK 29–98% across, 30–71% down; "BY CREATORS PACKS"
   from 29.5% across, 75–83% down (beside the icon's lower part, so the subtitle's window starts at 29%). Everything hidden is hidden BY the animation
   (fill-mode), so without animation the image simply shows. */
.deck-logo-fx, .deck-logo-shine { position: absolute; inset: 0; pointer-events: none; }
.deck-logo-fx { opacity: 0; visibility: hidden; overflow: hidden; }
.deck-logo-part, .deck-logo-ghost { position: absolute; inset: 0; background: url('../assets/brand/deck-logo.png') 0 0 / 100% 100% no-repeat; }
.deck-logo-icon { -webkit-mask-image: linear-gradient(to right, #000 27.5%, transparent 30%); mask-image: linear-gradient(to right, #000 27.5%, transparent 30%); }
.deck-logo-word {
  -webkit-mask-image: linear-gradient(to right, transparent 28%, #000 31%), linear-gradient(to bottom, #000 72%, transparent 74%);
  mask-image: linear-gradient(to right, transparent 28%, #000 31%), linear-gradient(to bottom, #000 72%, transparent 74%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.deck-logo-sub {
  -webkit-mask-image: linear-gradient(to bottom, transparent 72.5%, #000 74.5%), linear-gradient(to right, transparent 27.5%, #000 29.5%);
  mask-image: linear-gradient(to bottom, transparent 72.5%, #000 74.5%), linear-gradient(to right, transparent 27.5%, #000 29.5%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
/* the energy that does the revealing: four short RGBY dashes riding the reveal's edge */
.deck-logo-edge {
  position: absolute; top: 28%; bottom: 27%; left: 0; width: 18%; opacity: 0;
  background: linear-gradient(to bottom, #ff211e 0 16%, transparent 16% 28%, #019dff 28% 44%, transparent 44% 56%, #ffe103 56% 72%, transparent 72% 84%, #09ff80 84% 100%);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 85%, #fff); mask-image: linear-gradient(to right, transparent, #000 85%, #fff);
  transform: skewX(-16deg);
}
/* colour fringing for a blink: the wordmark's shape in one flat colour, a pixel to each side */
.deck-logo-ghost { background: #ff211e; mix-blend-mode: screen; opacity: 0;
  -webkit-mask-image: url('../assets/brand/deck-logo.png'), linear-gradient(to right, transparent 29.5%, #000 31.5%), linear-gradient(to bottom, #000 71%, transparent 73%);
  mask-image: url('../assets/brand/deck-logo.png'), linear-gradient(to right, transparent 29.5%, #000 31.5%), linear-gradient(to bottom, #000 71%, transparent 73%);
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-composite: source-in; mask-composite: intersect; }
.deck-logo-ghost--b { background: #019dff; }
/* the shine: a slanted RGBY band that only shows where the logo has pixels; the finish and the hover */
.deck-logo-shine { overflow: hidden; -webkit-mask: url('../assets/brand/deck-logo.png') 0 0 / 100% 100% no-repeat; mask: url('../assets/brand/deck-logo.png') 0 0 / 100% 100% no-repeat; }
.deck-logo-shine::before {
  content: ''; position: absolute; top: -20%; bottom: -20%; left: 0; width: 38%; opacity: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 33, 30, 0.7) 22%, rgba(255, 225, 3, 0.75) 40%, rgba(255, 255, 255, 0.95) 52%, rgba(9, 255, 128, 0.7) 66%, rgba(1, 157, 255, 0.7) 82%, transparent 100%);
  mix-blend-mode: screen;
}

/* the timeline runs only while playing (set when the logo first appears; "done" removes the copies) */
.deck-logo-wrap[data-intro="playing"] .deck-logo-fx { animation: deck-logo-fx 1420ms linear both; }
.deck-logo-wrap[data-intro="playing"] .deck-logo { animation: deck-logo-base 1650ms linear both; }
.deck-logo-wrap[data-intro="playing"] .deck-logo-icon { animation: deck-logo-icon 340ms cubic-bezier(0.16, 1, 0.3, 1) 100ms both; }
.deck-logo-wrap[data-intro="playing"] .deck-logo-word { animation: deck-logo-reveal 450ms cubic-bezier(0.3, 0, 0.2, 1) 200ms both, deck-logo-hit 210ms ease-out 650ms both; }
.deck-logo-wrap[data-intro="playing"] .deck-logo-sub { animation: deck-logo-sub 260ms cubic-bezier(0.2, 0, 0, 1) 720ms both; }
.deck-logo-wrap[data-intro="playing"] .deck-logo-edge { animation: deck-logo-edge 450ms cubic-bezier(0.3, 0, 0.2, 1) 200ms both; }
.deck-logo-wrap[data-intro="playing"] .deck-logo-ghost--a { animation: deck-logo-ghost-a 120ms linear 620ms both; }
.deck-logo-wrap[data-intro="playing"] .deck-logo-ghost--b { animation: deck-logo-ghost-b 120ms linear 620ms both; }
.deck-logo-wrap[data-intro="playing"] .deck-logo-shine::before { animation: deck-logo-shine 350ms cubic-bezier(0.3, 0, 0.3, 1) 880ms both; }
.deck-logo-wrap[data-intro="done"][data-hover] .deck-logo { animation: deck-logo-hover 340ms ease-out both; }
.deck-logo-wrap[data-intro="done"][data-hover] .deck-logo-shine::before { animation: deck-logo-shine 340ms cubic-bezier(0.3, 0, 0.3, 1) both; }

@keyframes deck-logo-fx { 0% { opacity: 1; visibility: visible; } 91% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
@keyframes deck-logo-base { 0%, 69% { opacity: 0; filter: none; } 78% { opacity: 1; filter: none; } 88% { filter: brightness(1.14); } 100% { opacity: 1; filter: none; } }
@keyframes deck-logo-icon { 0% { opacity: 0; transform: translateX(-20%); } 55% { opacity: 1; } 78% { transform: translateX(1.2%); } 100% { opacity: 1; transform: none; } }
@keyframes deck-logo-reveal { from { clip-path: inset(-10% 69% -10% 0); } to { clip-path: inset(-10% -2% -10% 0); } }
@keyframes deck-logo-edge { 0% { opacity: 0; transform: translateX(89%) skewX(-16deg); } 12% { opacity: 1; } 80% { opacity: 0.9; } 100% { opacity: 0; transform: translateX(483%) skewX(-16deg); } }
@keyframes deck-logo-hit { 0% { filter: none; } 40% { filter: brightness(1.2); } 100% { filter: none; } }
@keyframes deck-logo-ghost-a { 0% { opacity: 0; transform: translateX(-0.9%); } 1% { opacity: 0.5; transform: translateX(-0.9%); } 60% { opacity: 0.35; transform: translateX(-0.45%); } 100% { opacity: 0; transform: none; } }
@keyframes deck-logo-ghost-b { 0% { opacity: 0; transform: translateX(0.9%); } 1% { opacity: 0.5; transform: translateX(0.9%); } 60% { opacity: 0.35; transform: translateX(0.45%); } 100% { opacity: 0; transform: none; } }
@keyframes deck-logo-sub { from { opacity: 0; transform: translateY(8%); } to { opacity: 1; transform: none; } }
@keyframes deck-logo-shine { 0% { opacity: 0; transform: translateX(-110%); } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(290%); } }
@keyframes deck-logo-hover { 0% { filter: none; } 45% { filter: brightness(1.1); } 100% { filter: none; } }

/* Reduce motion (Deck's setting or the system's): a calm fade in, no copies, no shine. */
.ck-app[data-motion="off"] .deck-logo-fx, .ck-app[data-motion="off"] .deck-logo-shine { display: none; }
.ck-app[data-motion="off"] .deck-logo-wrap .deck-logo { opacity: 1; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .deck-logo-fx, .deck-logo-shine { display: none; }
  .deck-logo-wrap[data-intro="playing"] .deck-logo { animation: deck-logo-calm 200ms ease-out both; }
  .deck-logo-wrap[data-intro="done"][data-hover] .deck-logo { animation: none; }
}
@keyframes deck-logo-calm { from { opacity: 0; } to { opacity: 1; } }

/* The compact variation (deck-logo-compact.png, 422 x 100: icon + DECK, the subtitle erased — made by
   dev/tools/make-compact-logo.swift). Measured: the icon ends and DECK starts at about 28–29% across; DECK
   is 20–79% down. Same timeline as the large logo. */
.deck-logo-wrap--compact .deck-logo-part, .deck-logo-wrap--compact .deck-logo-ghost { background-image: url('../assets/brand/deck-logo-compact.png'); }
.deck-logo-wrap--compact .deck-logo-icon { -webkit-mask-image: linear-gradient(to right, #000 27.5%, transparent 30%); mask-image: linear-gradient(to right, #000 27.5%, transparent 30%); }
.deck-logo-wrap--compact .deck-logo-word { -webkit-mask-image: linear-gradient(to right, transparent 28%, #000 30.5%); mask-image: linear-gradient(to right, transparent 28%, #000 30.5%); }
.deck-logo-wrap--compact .deck-logo-ghost { -webkit-mask-image: url('../assets/brand/deck-logo-compact.png'), linear-gradient(to right, transparent 28.5%, #000 30.5%); mask-image: url('../assets/brand/deck-logo-compact.png'), linear-gradient(to right, transparent 28.5%, #000 30.5%); }
.deck-logo-wrap--compact .deck-logo-edge { top: 18%; bottom: 19%; }
.deck-logo-wrap--compact .deck-logo-shine { -webkit-mask: url('../assets/brand/deck-logo-compact.png') 0 0 / 100% 100% no-repeat; mask: url('../assets/brand/deck-logo-compact.png') 0 0 / 100% 100% no-repeat; }

/* The trash bin for held tiles (dashboard.js): fixed at the bottom of the panel, shown only while a tile is
   held, red when the tile is over it. */
.deck-trash { display: none; position: fixed; left: 24px; right: 24px; bottom: 52px; z-index: 30; height: 56px; min-width: 0; white-space: nowrap; overflow: hidden; align-items: center; justify-content: center; gap: 10px; border: 2px dashed rgba(255, 90, 90, 0.55); border-radius: 12px; background: rgba(30, 20, 22, 0.92); color: #ff8a8a; font-size: 13px; font-weight: 600; pointer-events: none; }
.deck-grid[data-dragging] ~ .deck-trash { display: flex; }
.deck-trash[data-hot] { border-style: solid; border-color: #ff4d4d; background: rgba(120, 20, 24, 0.95); color: #fff; transform: scale(1.03); transition: transform 120ms ease; }

/* Pages of a deck: a quiet row of tabs above the grid (only when the deck has pages). */
.deck-pagebar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px 0; padding: 0 24px; }
.deck-page-chip { padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.14); background: transparent; color: var(--deck-text-secondary, #a8a8b0); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease; }
.deck-page-chip:hover { color: var(--deck-text, #f2f2f4); border-color: rgba(255,255,255,0.3); }
.deck-page-chip.is-selected { color: #111; background: var(--deck-yellow, #ffe103); border-color: transparent; }

/* First-run tips: a quiet card under the deck picker, shown once. */
.deck-tips { margin: 0 24px 12px; padding: 10px 12px; border: 1px solid rgba(255,225,3,0.35); border-radius: 10px; background: rgba(255,225,3,0.05); }
.deck-tips__title { font-size: 12px; font-weight: 700; margin: 0 0 6px 0; color: var(--deck-text, #f2f2f4); }
.deck-tips__list { margin: 0 0 8px 0; padding: 0 0 0 16px; font-size: 12px; line-height: 1.45; color: var(--deck-text-secondary, #b4b4bc); }
.deck-tips .deck-secondary-button { min-height: 26px; padding: 0 12px; font-size: 12px; }

/* Narrow panels: the same side room as the grid there. */
@media (max-width: 520px) { .deck-pagebar { padding: 0 14px; } .deck-tips { margin: 0 14px 12px; } }

/* Narrow panels: a lower bin, smaller text (its left/right follow the grid, set when a button lifts). */
@media (max-width: 520px) { .deck-trash { height: 46px; font-size: 12px; left: 14px; right: 14px; } }
@media (max-width: 300px) { .deck-trash span { display: none; } }

/* Even room on both sides of the panel: where the engine supports it, the scroll bar's room is kept on both edges. */
.deck-scroll { scrollbar-gutter: stable both-edges; }

/* The master search above the buttons, with the button-size button at its end. */
.deck-master-search { display: flex; align-items: center; gap: 8px; margin: 0 24px 12px; padding: 0 6px 0 12px; height: 36px; border: 1px solid var(--deck-border, rgba(255,255,255,0.12)); border-radius: 10px; background: rgba(255,255,255,0.04); }
.deck-master-search:focus-within { border-color: rgba(255,225,3,0.6); background: rgba(255,255,255,0.06); }
.deck-master-search__icon { display: flex; color: #9a9aa2; flex: none; }
.deck-master-search__icon svg { width: 16px; height: 16px; }
.deck-master-search__input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--deck-text, #f2f2f4); font: inherit; font-size: 13px; }
.deck-master-search__input::placeholder { color: #85858d; }
.deck-master-search__input::-webkit-search-cancel-button { filter: invert(0.7); }
.deck-master-search__size { display: inline-flex; align-items: center; gap: 5px; flex: none; height: 26px; padding: 0 8px; border: 1px solid rgba(255,255,255,0.14); border-radius: 7px; background: transparent; color: #b8b8c0; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.deck-master-search__size:hover { color: var(--deck-text, #f2f2f4); border-color: rgba(255,255,255,0.32); }
.deck-master-search__size svg { width: 14px; height: 14px; }
.deck-search-more { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 24px 14px; }
.deck-search-more__label { font-size: 11px; color: #9a9aa2; margin-right: 2px; }
.deck-search-more__item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px dashed rgba(255,255,255,0.22); border-radius: 999px; background: transparent; color: #d2d2d6; font: inherit; font-size: 12px; cursor: pointer; }
.deck-search-more__item:hover { border-style: solid; border-color: rgba(255,225,3,0.6); color: var(--deck-text, #f2f2f4); }
.deck-search-more__item svg { width: 14px; height: 14px; }
@media (max-width: 520px) { .deck-master-search { margin: 0 14px 12px; } .deck-search-more { margin: -6px 14px 14px; } }

/* Button size (Settings ui.tileSize; auto = by the panel's width, the rules above). */
.deck-grid[data-size="s"] { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.deck-grid[data-size="s"] .deck-tile { min-height: 78px; padding: 10px 6px; gap: 6px; font-size: 11px; }
.deck-grid[data-size="s"] .deck-tile-icon { width: 22px; height: 22px; }
.deck-grid[data-size="m"] { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.deck-grid[data-size="m"] .deck-tile { min-height: 108px; }
.deck-grid[data-size="l"] { grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
.deck-grid[data-size="l"] .deck-tile { min-height: 142px; font-size: 14px; }
.deck-grid[data-size="l"] .deck-tile-icon { width: 38px; height: 38px; }
.deck-grid[data-size="xl"] { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.deck-grid[data-size="xl"] .deck-tile { min-height: 180px; font-size: 15px; }
.deck-grid[data-size="xl"] .deck-tile-icon { width: 48px; height: 48px; }
/* Icons in the search row and the "also" chips sit in the line (the shared icon style positions them absolutely). */
.deck-master-search__icon { position: relative; width: 16px; height: 16px; }
.deck-master-search__icon svg, .deck-master-search__size svg, .deck-search-more__item svg { position: static; flex: none; }
