/* ArchiFlow — мудборд с темами дизайнера и выбор нескольких (Claude, 16.11.2026; pages-v13.js, server/moodThemes.js).
   Мудборд: шапка «N фото · Выбрать · ＋ Тема · ＋ Добавить», блоки тем (⋮⋮ — перетащить, ↑ ↓, ⋯), «Без темы».
   Галерея: отметка «мудборд» на плитке. Выбор нескольких: галочки на плитках и строках, полоса действий внизу. */

/* ---------- мудборд ---------- */
.afm-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 14px 0 2px; }
.afm-n { color: var(--muted); font-size: 13px; }
.afm-acts { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.afm-acts .afp-btn { height: 34px; display: inline-flex; align-items: center; border-radius: 12px; }
.afm-acts .afg-btn { height: 34px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 12px; }
.afm-pool { padding-top: 14px; }
.afm-theme h3 { align-items: center; gap: 6px; min-height: 28px; }
.afm-theme h3 small { margin-left: auto; }
.afm-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afm-grip { cursor: grab; color: var(--dim); font-size: 12px; letter-spacing: -2px; padding: 4px 4px 4px 0; user-select: none; }
.afm-grip:active { cursor: grabbing; }
.afm-tc { display: inline-flex; gap: 2px; margin-left: 6px; }
.afm-ic { width: 28px; height: 28px; border-radius: 14px; color: var(--muted); font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.afm-ic:hover:not(:disabled), .afm-ic:focus-visible { background: #f2f0ec12; color: var(--text); }
.afm-ic:disabled { opacity: .3; cursor: default; }
.afm-loose h3 .afm-title { color: var(--muted); font-weight: 500; }
.afm-empty { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; padding: 2px 0; }
.afm-over { outline: 1.5px dashed var(--gold-line); outline-offset: 2px; }
.afm-page .afg-tile[draggable="true"] { cursor: grab; }
.afm-menu .afm-ok { display: inline-block; width: 14px; color: var(--gold); font-style: normal; }
.afg-menu .afm-sep { border-top: 1px solid var(--line); margin: 4px 2px; }
.afm-ask .afar-box { width: min(380px, 100%); }
.afm-ask .afar-box .afp-r { flex-direction: column; align-items: stretch; gap: 8px; }
.afm-ask .afar-box .afp-r button { text-align: center; justify-content: center; min-height: 38px; }
.afm-ask .afar-box .afp-r .afp-btn { border: 0; color: var(--muted); }

/* «мудборд» на плитке галереи */
.afg-mb { position: absolute; left: 6px; top: 6px; font-size: 10px; font-weight: 600; color: #1c1c1e; background: #d9d2c0; padding: 1px 6px; border-radius: 6px; letter-spacing: .2px; }
.afg-tile:has(.afg-pin) .afg-mb { left: 30px; top: 8px; }

/* ---------- выбор нескольких ---------- */
.afg-tile, .afsel-row { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.afsel-mode .afg-mb, .afsel-mode .afg-pin { display: none; }
.afsel-chk { position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; border-radius: 11px; border: 1.5px solid #fff; background: rgba(0,0,0,.35); box-sizing: border-box; }
.afg-cell.picked .afg-tile { outline: 2px solid var(--gold); outline-offset: -2px; }
.afg-cell.picked .afg-tile img { opacity: .82; }
.afg-cell.picked .afsel-chk, .afsel-row.picked .afsel-chk { background: var(--gold); border-color: var(--gold); }
.afg-cell.picked .afsel-chk::after, .afsel-row.picked .afsel-chk::after {
  content: ''; position: absolute; left: 6.5px; top: 3px; width: 5px; height: 10px; border: solid #1c1c1e; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.afsel-row { position: relative; cursor: default; }
.afsel-mode .afsel-row { padding-left: 32px; cursor: pointer; }
.afsel-row .afsel-chk { left: 2px; top: 50%; margin-top: -11px; border-color: var(--line2); background: transparent; }
.afsel-row.picked { background: #f2f0ec0a; }
.afsel-go.on { border-color: var(--gold-line); color: var(--gold); }
.afg-day h3 small .afsel-go { margin-left: 8px; font-size: 11.5px; padding: 2px 10px; }

.afsel-bar {
  position: sticky; bottom: -24px; z-index: 5; margin: 16px -6px -10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  background: #2a2a2d; border: 1px solid var(--line2); border-radius: 16px; box-shadow: 0 -8px 28px #00000073;
}
.afsel-n { font-size: 13px; color: var(--muted); }
.afsel-n b { color: var(--text); font-weight: 600; }
.afsel-all, .afsel-x { font-size: 12.5px; color: var(--muted); padding: 6px 4px; }
.afsel-all:hover, .afsel-x:hover { color: var(--text); }
.afsel-x { margin-left: auto; }
.afsel-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.afsel-a { border: 1px solid var(--line2); border-radius: 12px; padding: 6px 11px; font-size: 12.5px; color: var(--text); white-space: nowrap; }
.afsel-a:hover:not(:disabled) { border-color: var(--gold-line); color: var(--gold); }
.afsel-a.dz { color: var(--conf); border-color: color-mix(in srgb, var(--conf) 45%, transparent); }
.afsel-a:disabled { opacity: .4; cursor: default; }

/* телефон: полоса во всю ширину, действия прокручиваются вбок */
@media (max-width: 700px) {
  .afsel-bar { margin: 14px -10px -10px; border-radius: 14px 14px 0 0; gap: 6px 8px; }
  .afsel-acts { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .afsel-acts::-webkit-scrollbar { display: none; }
  .afsel-a { padding: 9px 12px; font-size: 13px; }
  .afm-acts { margin-left: 0; width: 100%; }
  .afm-acts .afg-btn { margin-left: auto; }
  .afm-ic { width: 34px; height: 34px; }
}

/* уведомление с «Отменить» */
.afg-toast.undo { display: flex; align-items: center; gap: 12px; }
.afg-tundo { color: var(--gold); font-size: 13px; font-weight: 600; padding: 2px 2px; }
.afg-tundo:hover { text-decoration: underline; text-underline-offset: 3px; }

/* мудборд: нажатие на картинку и так открывает меню — «⋯» на плитке лишний */
.afm-page .afg-more { display: none; }
.afg-tile, .afg-more, .afm-ic { -webkit-tap-highlight-color: transparent; }
/* уведомление по центру во всю доступную ширину (left: 50% иначе сжимает его до половины экрана) */
.afg-toast.undo { width: max-content; max-width: min(560px, calc(100vw - 32px)); }
@media (max-width: 700px) {
  /* «Выбрать» в строке поиска галереи: поиск — своей строкой, без прокрутки вбок */
  .afg-tools { flex-wrap: wrap; }
  .afg-tools .afg-q { flex: 1 0 100%; }
  .afg-tools .afg-stage { flex: 1 1 auto; min-width: 0; }
  /* действия выбора — переносятся на вторую строку, а не уезжают вбок */
  .afsel-acts { flex-wrap: wrap; overflow: visible; }
}

/* ---------- выбор рамкой и пальцем, отметка «выбрать всё за день / тему» (17.11.2026) ---------- */
.afsel-marq { position: fixed; z-index: 60; pointer-events: none; background: rgba(200,181,138,.15); border: 1px solid rgba(200,181,138,.8); border-radius: 3px; }
.afsel-drag, .afsel-drag * { user-select: none; -webkit-user-select: none; }
.afsel-drag .afg-tile { cursor: crosshair; }
.afsel-mode .afg-cell, .afsel-mode .afsel-row { touch-action: pan-y; }
.afsel-day { width: 20px; height: 20px; border-radius: 10px; border: 1.5px solid var(--line2); background: transparent; box-sizing: border-box; flex: 0 0 auto; align-self: center; margin-right: 8px; padding: 0; position: relative; cursor: pointer; }
.afsel-day:hover { border-color: var(--gold-line); }
.afsel-day.on { background: var(--gold); border-color: var(--gold); }
.afsel-day.on::after { content: ''; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border: solid #1b1b1d; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.afm-grip + .afsel-day { margin-left: 2px; }
@media (max-width: 760px) { .afsel-day { width: 26px; height: 26px; border-radius: 13px; } .afsel-day.on::after { left: 8px; top: 4px; } }
