/* ArchiFlow — файлы прямо в раздел (Claude, 18.11.2026, drop-v13.js): рамка «Отпустите, чтобы добавить в …» над разделом,
   панель загрузки с полосками, «＋ Из файла», «Файлы раздела», «Готовые мудборды», окна импорта и «Найти в файле».
   Тёмные поверхности, бежевый акцент, мелкие скруглённые кнопки — как остальной раздел. */

/* рамка над разделом: пока файл над окном — едва заметно, над самим разделом — бежевая пунктирная */
.afdr-veil { position: fixed; z-index: 45; pointer-events: none; box-sizing: border-box; border: 1.5px dashed transparent; border-radius: 14px; transition: background .12s, border-color .12s; }
.afdr-veil.on { border-color: var(--gold); background: rgba(30, 30, 32, .62); }
.afdr-vbox { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); max-width: calc(100% - 32px); text-align: center; background: #26262a; border: 1px solid var(--gold-line); border-radius: 14px; padding: 14px 22px; opacity: 0; transition: opacity .12s; }
.afdr-veil.on .afdr-vbox { opacity: 1; }
.afdr-vbox b { display: block; font-weight: 500; font-size: 15px; color: var(--text); }
.afdr-vbox small { display: block; color: var(--gold); font-size: 12.5px; margin-top: 4px; min-height: 1em; }
.afdr-tgt { outline: 1.5px dashed var(--gold); outline-offset: 2px; background: var(--gold-soft) !important; }
tr.afdr-tgt td { background: var(--gold-soft); }

/* панель загрузки */
.afdr-panel { position: fixed; right: 16px; bottom: 16px; z-index: 72; width: min(360px, calc(100vw - 32px)); max-height: min(60vh, 420px); display: flex; flex-direction: column; background: var(--center); border: 1px solid var(--line2); border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.45); color: var(--text); }
.afdr-ph { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 14px; border-bottom: 1px solid var(--line); }
.afdr-ph b { font-size: 13px; font-weight: 600; }
.afdr-ph .afg-x { width: 30px; height: 30px; font-size: 14px; }
.afdr-list { overflow-y: auto; padding: 4px 12px 10px; }
.afdr-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 0 7px; border-top: 1px solid var(--line); }
.afdr-row:first-child { border-top: 0; }
.afdr-rt { min-width: 0; }
.afdr-rt b { display: block; font-weight: 500; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afdr-rt small, .afdr-dim { color: var(--dim); font-size: 11.5px; }
.afdr-rs { display: flex; gap: 6px; align-items: center; justify-content: flex-end; max-width: 190px; text-align: right; }
.afdr-ok { color: var(--ok); font-size: 13px; }
.afdr-bad { color: var(--conf); font-size: 11.5px; line-height: 1.25; }
.afdr-bar { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.afdr-bar span { display: block; height: 100%; background: var(--gold); transition: width .15s; }
.afdr-row.err .afdr-bar span { background: var(--conf); opacity: .7; }
.afdr-row.done .afdr-bar { opacity: .35; }

/* «＋ Из файла» над разделом */
.afdr-top { display: flex; justify-content: flex-end; margin: 6px 0 -4px; }
.afdr-top .afdr-pick { font-size: 12px; }

/* «Файлы раздела» */
.afdr-files .afp-t a { color: var(--text); text-decoration: none; }
.afdr-files .afp-t a:hover { color: var(--gold); }
.afdr-files .afp-ic { overflow: hidden; }
.afdr-files .afp-ic img { width: 100%; height: 100%; object-fit: cover; }
.afdr-files .afp-r { flex-wrap: wrap; justify-content: flex-end; }
.afdr-clip { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; color: var(--gold); font-size: 11px; vertical-align: 1px; }

/* «Готовые мудборды» */
.afdr-rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.afdr-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.afdr-prev { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #323236; border: 1px solid var(--line); }
.afdr-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.afdr-fcard { display: none; position: absolute; inset: 0; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; text-align: center; background: linear-gradient(160deg, #34332f, #2a2a2d); }
.afdr-fcard b { font-size: 12px; letter-spacing: .5px; color: #1c1c1e; background: var(--gold); border-radius: 6px; padding: 2px 8px; }
.afdr-fcard span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.afdr-prev.nofile img { display: none; }
.afdr-prev.nofile .afdr-fcard { display: flex; }
.afdr-cap b { display: block; font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afdr-cap small { color: var(--dim); font-size: 11.5px; }
.afdr-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.afdr-acts .afdr-rm { color: var(--muted); }

/* окна импорта и «Найти в файле» */
.afdr-box { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: hidden; }
.afdr-box.afdr-wide { width: min(940px, 100%); }
.afdr-mb { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: hidden; }
.afdr-ctl { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.afdr-ctl label { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; }
.afdr-ctl select, .afdr-ctl input, .afdr-table select { background: #2a2a2d; color: var(--text); border: 1px solid var(--line2); border-radius: 9px; padding: 5px 8px; font: inherit; font-size: 12.5px; max-width: 260px; outline: none; }
.afdr-ctl input:focus, .afdr-ctl select:focus, .afdr-table select:focus { border-color: var(--gold-line); }
.afdr-scroll { overflow: auto; max-height: min(52vh, 460px); border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.afdr-table { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.afdr-table th { position: sticky; top: 0; z-index: 1; background: #232325; text-align: left; vertical-align: bottom; padding: 6px 6px 7px; border-bottom: 1px solid var(--line2); font-weight: 400; }
.afdr-table th small { display: block; color: var(--dim); font-size: 11px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; }
.afdr-table th select { max-width: 150px; font-size: 12px; padding: 4px 6px; }
.afdr-table th select.on { border-color: var(--gold-line); color: var(--gold); }
.afdr-table td { padding: 6px; border-bottom: 1px solid var(--line); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.afdr-table td.on { color: var(--text); }
.afdr-table .afdr-n { color: var(--dim); width: 28px; text-align: right; }
.afdr-table tr.afdr-skip td { color: var(--dim); text-decoration: line-through; text-decoration-color: rgba(154,151,143,.4); }
.afdr-table tr.afdr-h td { color: var(--gold); font-weight: 500; }
.afdr-foot { justify-content: flex-end; flex-wrap: wrap; padding-top: 4px; }
.afdr-foot .afg-btn[disabled] { opacity: .45; }
.afdr-found { display: flex; flex-direction: column; overflow-y: auto; max-height: min(56vh, 480px); }
.afdr-fi { display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 8px; padding: 8px 2px; border-top: 1px solid var(--line); cursor: pointer; }
.afdr-fi:first-child { border-top: 0; }
.afdr-fi input { accent-color: var(--gold); width: 16px; height: 16px; margin-top: 2px; }
.afdr-fi b { font-weight: 500; font-size: 13px; display: block; }
.afdr-fi small { color: var(--gold); font-size: 11.5px; display: block; }
.afdr-fi q { color: var(--dim); font-size: 11.5px; display: block; quotes: '«' '»'; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afdr-wait::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 2px solid var(--gold-line); border-top-color: var(--gold); border-radius: 50%; vertical-align: -2px; animation: afdr-spin .8s linear infinite; }
@keyframes afdr-spin { to { transform: rotate(360deg); } }

/* телефон: панель загрузки над нижними вкладками, окна — на всю ширину */
@media (max-width: 700px) {
  .afdr-panel { right: 12px; left: 84px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .afdr-box.afdr-wide { width: 100%; }
  .afdr-rgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .afdr-ctl label { width: 100%; justify-content: space-between; }
  .afdr-ctl select, .afdr-ctl input { max-width: 64%; flex: 1; }
  .afdr-files .afp-row { grid-template-columns: 34px minmax(0,1fr); }
  .afdr-files .afp-row .afp-r { grid-column: 2; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .afdr-wait::before { animation: none; } .afdr-bar span { transition: none; } }
.afar-modal.afdr-modal { z-index: 80; } /* над панелью загрузки */

/* файл на панель «Помощник» (23.11.2026): рамка и плашки вложений над полем ввода */
.afdr-chatveil { z-index: 80; }
body.afdr-chatover .dropveil { display: none !important; }
.afdr-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 10px 0; }
.afdr-chips[hidden] { display: none; }
.afdr-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 200px; background: var(--center, #26262a); border: 1px solid var(--gold-line, rgba(184,167,126,.55)); border-radius: 10px; padding: 3px 4px 3px 4px; font-size: 12px; color: var(--text); }
.afdr-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; display: block; }
.afdr-chip i { font-style: normal; width: 28px; text-align: center; }
.afdr-chip em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.afdr-chip button { border: 0; background: transparent; color: var(--dim); cursor: pointer; font-size: 11px; padding: 4px 6px; border-radius: 6px; }
.afdr-chip button:hover { color: var(--text); background: rgba(255,255,255,.08); }
.afdr-chipsend { margin-left: auto; border: 0; border-radius: 10px; background: var(--gold); color: #1c1c1e; font-size: 12px; padding: 6px 12px; cursor: pointer; }
.afdr-chatveil .afdr-vbox { min-width: 270px; }
