/* FATÓSH · ESTATE — просмотр вложений (attview.js).
   Сцена всегда тёмная, независимо от темы кабинета: документ и фотография должны читаться
   на нейтральном фоне, а не спорить с бежевой бумагой светлой темы. */
.attv{position:fixed;inset:0;z-index:9700;display:flex;flex-direction:column;color:#fff;
    background:rgba(10,9,7,.95);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
    opacity:0;transition:opacity .22s cubic-bezier(.23,1,.32,1)}
.attv.on{opacity:1}

/* --- шапка: чем открыли и что это за файл --- */
.attv-bar{flex:0 0 auto;display:flex;align-items:center;gap:12px;padding:14px 16px;
        border-bottom:1px solid rgba(255,255,255,.09)}
.attv-mono{flex:0 0 auto;display:grid;place-items:center;min-width:46px;height:44px;padding:0 9px;
         border-radius:12px;background:rgba(255,255,255,.1);
         font:600 11.5px/1 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;letter-spacing:.09em}
.attv-id{flex:1;min-width:0}
.attv-id b{display:block;font:400 16px/1.3 'Forum',Georgia,serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.attv-id i{display:block;margin-top:2px;font:400 12px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
         font-style:normal;color:rgba(255,255,255,.58)}
.attv-x{flex:0 0 auto;width:40px;height:40px;border-radius:50%;border:0;cursor:pointer;
      background:rgba(255,255,255,.12);color:#fff;font-size:15px;line-height:1;transition:background .15s}
.attv-x:hover{background:rgba(255,255,255,.2)}
.attv-x:focus-visible,.attv-b:focus-visible,.attv-n:focus-visible{outline:2px solid #fff;outline-offset:2px}

/* --- сцена --- */
.attv-stage{flex:1;min-height:0;position:relative;display:grid;place-items:center;padding:16px}
.attv-doc{position:relative;width:100%;height:100%;display:grid;place-items:center}
.attv-scroll{width:100%;height:100%;overflow:auto;display:grid;place-items:center;-webkit-overflow-scrolling:touch}
.attv-im{max-width:100%;max-height:100%;object-fit:contain;cursor:zoom-in;border-radius:4px}
.attv-im.zm{max-width:none;max-height:none;cursor:zoom-out}
.attv-fr{width:min(100%,1180px);height:100%;border:0;border-radius:12px;background:#fff;
       box-shadow:0 34px 90px -46px #000}
.attv-au{width:min(100%,520px)}
.attv-vi{max-width:100%;max-height:100%;border-radius:12px;background:#000}
.attv-sk{position:absolute;inset:0;border-radius:12px;pointer-events:none;
       background:linear-gradient(100deg,rgba(255,255,255,.06) 30%,rgba(255,255,255,.14) 50%,rgba(255,255,255,.06) 70%);
       background-size:200% 100%;animation:attvsk 1.4s linear infinite}
@keyframes attvsk{from{background-position:120% 0}to{background-position:-40% 0}}

/* --- карточка «файл не показывается внутри кабинета» / ошибка --- */
.attv-card{max-width:430px;display:grid;gap:13px;justify-items:center;text-align:center}
.attv-card .big{width:82px;height:82px;border-radius:22px;display:grid;place-items:center;
              background:rgba(255,255,255,.1);
              font:600 17px/1 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;letter-spacing:.1em}
.attv-card b{font:400 23px/1.25 'Forum',Georgia,serif;word-break:break-word}
.attv-card p{margin:0;font:400 13.5px/1.62 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
           color:rgba(255,255,255,.62)}
.attv-card.bad .big{background:rgba(217,122,104,.18);color:#e5a495}

/* --- переключение между вложениями --- */
.attv-n{position:absolute;top:50%;transform:translateY(-50%);width:46px;height:46px;border-radius:50%;
      border:0;cursor:pointer;background:rgba(255,255,255,.12);color:#fff;font-size:24px;line-height:1;
      transition:background .15s}
.attv-n:hover{background:rgba(255,255,255,.22)}
.attv-n.p{left:14px}
.attv-n.n{right:14px}
/* со стрелками сцене нужны поля, иначе кнопки ложатся поверх документа */
.attv-stage.nav{padding-left:74px;padding-right:74px}

/* --- действия --- */
.attv-acts{flex:0 0 auto;display:flex;gap:10px;justify-content:center;flex-wrap:wrap;
         padding:14px 16px calc(14px + env(safe-area-inset-bottom));
         border-top:1px solid rgba(255,255,255,.09)}
.attv-b{font:600 14px/1 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;padding:12px 18px;
      border-radius:12px;border:1px solid rgba(255,255,255,.22);background:transparent;color:#fff;
      cursor:pointer;transition:background .15s,transform .12s}
.attv-b:hover{background:rgba(255,255,255,.12)}
.attv-b:active{transform:scale(.98)}
.attv-b.p{background:#fff;color:#16140f;border-color:#fff}
.attv-b.p:hover{background:rgba(255,255,255,.88)}
.attv-b[disabled]{opacity:.45;pointer-events:none}

@media(max-width:620px){
  .attv-bar{padding:12px}
  .attv-stage{padding:12px}
  .attv-acts{padding:12px 12px calc(12px + env(safe-area-inset-bottom))}
  .attv-b{flex:1 1 42%;min-height:44px;padding:13px 8px;font-size:13.5px}
  .attv-n{width:40px;height:40px;font-size:21px}
  .attv-n.p{left:6px}
  .attv-n.n{right:6px}
  .attv-stage.nav{padding-left:12px;padding-right:12px}
  /* На узком экране поля даём только тексту карточки: у фото и кадра документа
     каждый пиксель ширины на счету, а длинное имя файла не должно уходить под стрелку. */
  .attv-stage.nav .attv-card{padding-left:40px;padding-right:40px}
  .attv-card b{font-size:19px}
  .attv-mono{min-width:40px;height:40px}
  .attv-id b{font-size:15px}
}
@media(prefers-reduced-motion:reduce){
  .attv{transition:none}
  .attv-sk{animation:none}
}
