/* FLUXBOT chat app: Crew bots (scratchpad/spec-crew-bots.md §8). Prefixes: .bot-*, #botsModal, #botEditModal,
   #botReportModal, #botAboutModal, #botConfirmModal, #botNoteModal, #botEmoji…, body.no-bots, main.bot-view,
   #personaBtn.bot. Dark and light themes through the style.css tokens only; motion (the card lift, the sheet sliding
   in) only with prefers-reduced-motion: no-preference and without body.fx-off. Works from 360 px: the shelf and the
   dialog are full-screen sheets up to 600 px, one column, touch targets of 44 px. */

/* ---------- the kill switch (members only): nothing to open, nothing to start ---------- */
body.no-bots .bot-card, body.no-bots .bot-row-emoji { display: none !important; }

/* ---------- the ✨ mode button while it's a bot's handle (R6) ---------- */
#personaBtn.bot span.pn { min-width: 0; }
@media (min-width: 400px) and (max-width: 768px) { #personaBtn.bot span.pn { display: inline; } } /* just the emoji below 400 px */
#personaBtn.bot.off { opacity: .62; filter: grayscale(1); }
#personaBtn.bot.off:hover { opacity: .8; }

/* ---------- the mode row: 🤖 Crew bots, then recently used bots ---------- */
.persona-card.bot-card { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--text); max-width: 100%; min-width: 0; }
.persona-card.bot-card:hover { border-color: var(--accent); }
.persona-card.bot-recent { border-style: solid; border-color: var(--border); color: var(--muted); }
.bot-card-name { min-width: 0; max-width: 16ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- a bot's emoji before its chats' titles in the sidebar ---------- */
.bot-row-emoji { flex: none; margin-right: 6px; font-size: 13px; line-height: 1; }

/* ---------- the picture or emoji tile, on the bot's colour ring ---------- */
.bot-av {
  --bot-c: #1e90ff;
  position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  width: 48px; height: 48px; border-radius: 15px; font-size: 25px; line-height: 1;
  background: color-mix(in srgb, var(--bot-c) 16%, var(--surface)); box-shadow: inset 0 0 0 2px var(--bot-c);
}
.bot-av-sm { width: 30px; height: 30px; border-radius: 9px; font-size: 16px; }
.bot-av-lg { width: 72px; height: 72px; border-radius: 22px; font-size: 38px; box-shadow: inset 0 0 0 2.5px var(--bot-c), 0 10px 32px -14px var(--bot-c); }
.bot-av .bot-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.bot-av.has-img { box-shadow: 0 0 0 2px var(--bot-c); }
.bot-av-lg.has-img { box-shadow: 0 0 0 2.5px var(--bot-c), 0 10px 32px -14px var(--bot-c); }
.bot-av.has-img .bot-emoji { visibility: hidden; }

/* ---------- the welcome page (main.bot-view) ---------- */
.main.bot-view #personaRow, .main.bot-view .suggest { display: none; } /* R7: the starters take the mode row's place */
/* the content sits just above the message box, and scrolls from its top when it's taller than the room */
.main.bot-view.is-empty .scroll { justify-content: flex-start; }
.main.bot-view .thread { margin-top: auto; width: 100%; }
@media (max-width: 768px) {
  .main.bot-view.is-empty .dock { flex: 0 0 auto; } /* phones: the box goes to the bottom, the bot gets the room */
}
.bot-welcome { --bot-c: #1e90ff; max-width: 640px; margin: 0 auto; padding: 12px 0 20px; text-align: center; }
.bot-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bot-hero .bot-av-lg { margin-bottom: 6px; }
.bot-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; }
.bot-welcome .bot-desc { margin: 0; max-width: 52ch; font-size: 15px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.bot-welcome .bot-by { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.bot-starters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; text-align: left; }
.bot-starter {
  min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--glass, var(--surface));
  font-size: 14px; line-height: 1.4; color: var(--text); text-align: left; overflow-wrap: anywhere;
}
.bot-starter:not(:disabled):hover { border-color: color-mix(in srgb, var(--bot-c) 60%, var(--border)); background: var(--hover); }
.bot-starter:disabled { cursor: default; opacity: 1; }
.bot-starter.bot-skel { display: block; min-height: 48px; }
.bot-fine { margin: 16px auto 0; max-width: 56ch; font-size: 12.5px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.bot-banner { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; text-align: left; overflow-wrap: anywhere; }
.bot-banner.bad { color: var(--danger); background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); }
@media (max-width: 600px) {
  .bot-starters { grid-template-columns: minmax(0, 1fr); }
  .bot-title { font-size: 23px; }
  .bot-av-lg { width: 64px; height: 64px; font-size: 34px; border-radius: 20px; }
}

/* ---------- notes under replies, and a link's real host in someone else's bot chat ---------- */
.bot-note {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 12px; border-radius: 14px; max-width: 100%;
  font-size: 12.5px; line-height: 1.45; color: var(--muted); background: var(--neon-soft, var(--surface)); border: 1px solid var(--border);
}
.bot-host { color: var(--muted); font-size: .92em; overflow-wrap: anywhere; }

/* ---------- windows: shared look ---------- */
.menu.bot-menu { z-index: 75; } /* menus opened inside a window sit above its backdrop */
.bot-example { font-size: 14px; }
.bot-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: 0; }
.bot-modal .modal-head h2 { min-width: 0; overflow-wrap: anywhere; }
.bot-modal .modal-head h2:focus { outline: none; }
.bot-x { flex: none; }
.bot-confirm { font-size: 14px; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
.bot-notetext {
  margin-top: 10px; max-height: 55vh; overflow: auto; padding: 12px 14px; border-radius: 10px; background: var(--code-bg); border: 1px solid var(--border);
  white-space: pre-wrap; overflow-wrap: anywhere; font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.55;
}
.bot-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.bot-help { margin: 4px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.bot-help.bad { color: var(--danger); }
.bot-err { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--danger); overflow-wrap: anywhere; }
.bot-err:empty { display: none; }
.bot-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bot-ghost { color: var(--muted); border: 1px solid var(--border-strong); background: transparent; }
.bot-ghost:hover { color: var(--text); background: var(--hover); }
.bot-spacer { flex: 1; }

/* ---------- the shelf (#botsModal) ---------- */
.modal.bot-shelf { max-width: 980px; height: min(780px, calc(100vh - 32px)); height: min(780px, calc(100dvh - 32px)); }
.bot-shelf-head { gap: 8px; }
.bot-shelf-head h2 { flex: 1; }
.bot-new-btn { gap: 6px; flex: none; }
.bot-new-btn svg, .bot-empty .btn svg { width: 16px; height: 16px; }
.modal-body.bot-shelf-body { display: flex; flex-direction: column; padding: 0; overflow: hidden; flex: 1; min-height: 0; }
.bot-shelf-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 22px 10px; border-bottom: 1px solid var(--border); }
.bot-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.bot-tab { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); }
.bot-tab:hover { color: var(--text); }
.bot-tab[aria-selected="true"] { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.bot-tab-count { min-width: 18px; padding: 0 6px; border-radius: 999px; font-size: 11.5px; line-height: 18px; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.bot-tab-count:empty { display: none; }
.bot-toolbar { display: flex; gap: 8px; flex: 1 1 280px; min-width: 0; }
.bot-search { position: relative; flex: 1; min-width: 0; display: block; }
.bot-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.bot-search .input { height: 42px; padding-left: 36px; width: 100%; }
.bot-sort { flex: none; display: block; }
.bot-sort .input { height: 42px; width: auto; min-width: 0; padding-right: 30px; }
.bot-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 22px 22px; overscroll-behavior: contain; }
.bot-panel:focus { outline: none; }
.bot-counter { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bot-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 600px) { .bot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .bot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bot-item { position: relative; min-width: 0; display: flex; flex-direction: column; }
.bot-tile {
  --bot-c: #1e90ff;
  display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 88px; padding: 14px 44px 14px 14px; border-radius: 16px;
  text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--border);
}
button.bot-tile:hover { border-color: color-mix(in srgb, var(--bot-c) 55%, var(--border)); background: color-mix(in srgb, var(--bot-c) 6%, var(--surface)); }
button.bot-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bot-item.is-hidden .bot-tile { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.bot-tile-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.bot-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bot-name { min-width: 0; font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-new { flex: none; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); }
.bot-tile .bot-desc {
  font-size: 13px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bot-tile .bot-desc:empty { display: none; }
.bot-tile .bot-by { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.bot-chip { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 19px; background: var(--surface-2); color: var(--text); }
.bot-chip.is-shared { background: var(--accent-soft); }
.bot-more { position: absolute; top: 8px; right: 6px; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.bot-more:hover { color: var(--text); background: var(--hover); }
.bot-more svg { width: 18px; height: 18px; }
.bot-item .bot-banner { margin: 6px 0 0; }
.bot-edited { margin: 6px 2px 0; font-size: 12px; color: var(--muted); }
.bot-empty { display: grid; justify-items: center; gap: 12px; padding: 36px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.bot-empty-title { margin: 0; font-size: 15px; color: var(--text); }
.bot-empty .btn { display: inline-flex; align-items: center; gap: 6px; }
.bot-skel-card { height: 88px; border-radius: 16px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; }
.bot-skel { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; border-color: transparent; }

/* ---------- the New bot / Edit dialog (#botEditModal) ---------- */
.modal.bot-editor { max-width: 1080px; height: min(900px, calc(100vh - 32px)); height: min(900px, calc(100dvh - 32px)); }
.bot-switch { display: none; align-self: stretch; margin: 10px 22px 0; }
.bot-switch button { flex: 1; height: 36px; font-weight: 600; }
.bot-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.modal-body.bot-edit { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-content: start; }
@media (min-width: 900px) {
  .modal-body.bot-edit { grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); align-items: start; }
  .bot-preview { position: sticky; top: 0; }
}
@media (max-width: 899px) {
  .bot-switch { display: flex; }
  .modal-body.bot-edit[data-pane="edit"] .bot-preview, .modal-body.bot-edit[data-pane="preview"] .bot-form { display: none; }
}
.bot-form { display: grid; gap: 18px; min-width: 0; }
.bot-field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.bot-field > legend { padding: 0; margin-bottom: 2px; }
.bot-field-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bot-field .input { width: 100%; height: 42px; font-size: 14.5px; }
.bot-field textarea.input { height: auto; min-height: 170px; resize: vertical; line-height: 1.5; }
.bot-field .input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.bot-warn { margin: 2px 0 0; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; color: var(--text); background: color-mix(in srgb, #eab308 16%, transparent); border: 1px solid color-mix(in srgb, #eab308 45%, transparent); }
.bot-warn[hidden] { display: none; }
.bot-link-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 8px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--accent); }
.bot-link-btn:hover { background: var(--hover); }
.bot-link-btn svg { width: 15px; height: 15px; }
[data-theme="light"] .bot-link-btn { color: #0a52c4; }

/* the look: emoji tile, emoji, suggestions, colour */
.bot-look { display: flex; gap: 16px; align-items: flex-start; }
.bot-look-av { flex: none; padding-top: 24px; }
.bot-look-main { flex: 1; min-width: 0; display: grid; gap: 12px; }
.bot-emoji-in { max-width: 120px; font-size: 20px !important; text-align: center; }
.bot-emoji-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.bot-emo { width: 40px; height: 40px; border-radius: 10px; font-size: 20px; line-height: 1; display: grid; place-items: center; }
.bot-emo:hover { background: var(--hover); }
.bot-colors { display: flex; flex-wrap: wrap; gap: 4px; border: 0; margin: 0; padding: 0; min-width: 0; }
.bot-colors legend { width: 100%; margin-bottom: 4px; }
.bot-swatch { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; }
.bot-swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.bot-swatch-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--bot-c); box-shadow: 0 0 0 2px var(--bg); pointer-events: none; }
.bot-swatch input:checked + .bot-swatch-dot { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.bot-swatch input:focus-visible + .bot-swatch-dot { outline: 2px solid var(--accent); outline-offset: 4px; }

/* picture and files: a real (visually hidden) file input inside/next to a button-looking label */
.bot-pic-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bot-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bot-pick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.bot-pick svg { width: 16px; height: 16px; }
.bot-pick.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.bot-file-input:focus-visible + .bot-pick { outline: 2px solid var(--accent); outline-offset: 2px; }

/* starters */
.bot-starter-list { display: grid; gap: 6px; }
.bot-starter-row { display: flex; gap: 6px; align-items: center; }
.bot-starter-row .input { flex: 1; min-width: 0; }
.bot-starter-x { width: 42px; height: 42px; flex: none; }
.bot-starter-x svg { width: 16px; height: 16px; }
.bot-add-starter { justify-self: start; display: inline-flex; align-items: center; gap: 6px; }
.bot-add-starter svg { width: 15px; height: 15px; }

/* reference notes */
.bot-notes[hidden] { display: none; }
.bot-files { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.bot-file { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.bot-file-ico { display: grid; color: var(--accent); flex: none; }
.bot-file-ico svg { width: 20px; height: 20px; }
.bot-file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bot-file-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-file-sub { font-size: 12px; color: var(--muted); }
.bot-file-acts { display: flex; gap: 6px; flex: none; }
.bot-meter { margin-top: 4px; }
.bot-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bot-bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.bot-meter-text { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* share with the crew */
.bot-share-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.bot-share-text { min-width: 0; }
.bot-switch-btn { position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.bot-switch-btn[aria-checked="true"] { background: var(--accent); box-shadow: none; }
.bot-switch-btn:disabled { opacity: .5; cursor: not-allowed; }
.bot-switch-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.bot-switch-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.bot-switch-btn[aria-checked="true"] .bot-switch-knob { transform: translateX(20px); }
.bot-fineprint { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.bot-form-err { margin: 0; }

/* the live preview */
.bot-preview { min-width: 0; display: grid; gap: 12px; align-content: start; padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 55%, transparent); border: 1px dashed var(--border-strong); }
.bot-preview-label { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bot-preview .bot-tile { min-height: 0; padding-right: 14px; }
.bot-preview .bot-welcome { padding: 8px 0 4px; }
.bot-preview .bot-title { font-size: 21px; }
.bot-preview .bot-starters { grid-template-columns: minmax(0, 1fr); }

.bot-edit-foot { align-items: center; padding-top: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.bot-del { display: inline-flex; align-items: center; gap: 6px; }
.bot-del svg { width: 15px; height: 15px; }
.bot-save[aria-busy="true"] { cursor: progress; }

/* ---------- report ---------- */
.bot-report { display: grid; gap: 10px; }
.bot-reasons { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.bot-reasons legend { margin-bottom: 4px; }
.bot-reason { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; font-size: 14px; line-height: 1.35; }
.bot-reason:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.bot-reason input, .bot-check input { accent-color: var(--accent); width: 18px; height: 18px; flex: none; margin: 0; }
.bot-report-text { width: 100%; min-height: 84px; }
.bot-report .bot-count { justify-self: end; margin-top: -4px; }
.bot-check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; font-size: 14px; line-height: 1.4; }
.bot-check + .bot-help { margin-top: -4px; }

/* ---------- phones: the shelf and the dialog are full-screen sheets ---------- */
@media (max-width: 600px) {
  #botsModal, #botEditModal { padding: 0; align-items: stretch; }
  #botsModal .modal, #botEditModal .modal {
    max-width: none; width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; border: 0;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
  }
  .bot-modal .modal-head { padding: 10px 8px 10px 16px; }
  .bot-modal .modal-head .icon-btn { width: 44px; height: 44px; }
  .bot-shelf-top { padding: 10px 12px; }
  .bot-tabs { width: 100%; }
  .bot-tab { flex: 1; justify-content: center; height: 44px; }
  .bot-toolbar { flex-basis: 100%; }
  .bot-panel { padding: 12px 12px 20px; }
  .bot-switch { margin: 10px 12px 0; }
  .bot-switch button { height: 44px; }
  .modal-body.bot-edit { padding: 14px 12px 18px; }
  .bot-edit-foot { padding: 10px 12px; gap: 8px; }
  .bot-edit-foot .btn { height: 44px; }
  .bot-del span { display: none; } /* just the bin icon: Cancel and Save stay reachable */
  .bot-del { width: 44px; justify-content: center; padding: 0; }
  .bot-look { gap: 12px; }
  .bot-look-av { display: none; } /* the preview shows it */
  .bot-file { flex-wrap: wrap; }
  .bot-file-acts { width: 100%; justify-content: flex-end; }
  .bot-file-acts .btn { height: 40px; }
  .bot-new-btn { height: 44px; }
  .bot-search .input, .bot-sort .input { height: 44px; }
}
@media (max-width: 380px) {
  .bot-new-btn span { display: none; }
  .bot-new-btn { width: 44px; padding: 0; justify-content: center; }
}
@media (max-width: 768px) {
  .bot-more { width: 44px; height: 44px; top: 6px; right: 4px; }
  .bot-emo { width: 44px; height: 44px; }
  .bot-swatch { width: 44px; height: 44px; }
  .bot-field .input { height: 44px; }
  .bot-starter-x { width: 44px; height: 44px; }
}

/* ---------- motion (never with reduced motion or "Starfield & animations" off) ---------- */
@media (prefers-reduced-motion: no-preference) {
  body:not(.fx-off) button.bot-tile { transition: transform .18s, box-shadow .18s, border-color .18s, background .18s; }
  body:not(.fx-off) button.bot-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -16px var(--bot-c); }
  body:not(.fx-off) .bot-switch-knob { transition: transform .18s; }
  body:not(.fx-off) .bot-skel-card, body:not(.fx-off) .bot-skel { animation: botShimmer 1.3s ease-in-out infinite; }
  body:not(.fx-off) #botWelcome { animation: botIn .22s ease-out; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 600px) {
  body:not(.fx-off) #botsModal.show .modal, body:not(.fx-off) #botEditModal.show .modal { animation: botSheet .24s cubic-bezier(.2, .8, .2, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .bot-modal, #botsModal.show, #botEditModal.show, .bot-modal-bg.show { animation: none !important; }
}
body.fx-off .bot-modal, body.fx-off .bot-modal-bg.show { animation: none !important; }
@keyframes botShimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes botIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes botSheet { from { transform: translateY(24px); opacity: .6; } }

@media (forced-colors: active) {
  .bot-av, .bot-tile, .bot-starter, .bot-switch-btn { border: 1px solid CanvasText; }
  .bot-switch-btn[aria-checked="true"] .bot-switch-knob { background: Highlight; }
}
