/* Документы СМК · Mini App. Цвета и элементы — из n45.css (дизайн-система СМК 0.45), здесь только раскладка. */
html, body { margin: 0; min-height: 100%; background: #0f1416; }
body.n45 { min-height: 100vh; overflow-x: hidden; }
.app { max-width: 760px; margin: 0 auto; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.fatal { position: fixed; inset: 0; padding: 24px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.fatal .logo { width: 112px; height: 112px; border-radius: 28px; margin-bottom: 8px; box-shadow: var(--sh-pop); }
.boot { min-height: 70vh; display: grid; place-items: center; color: var(--acc); }
.spin.big { width: 28px; height: 28px; border-width: 3px; animation: rot .8s linear infinite; }
.spin { animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* Шапка */
.hdr { position: sticky; top: 0; z-index: 5; background: var(--bar); border-bottom: 1px solid var(--line);
  padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.hrow { display: flex; align-items: center; gap: 6px; min-height: 48px; }
.htx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-left: 4px; }
.htx .t-h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs { display: flex; gap: 4px; font-size: 12px; color: var(--dim); white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.crumbs a { color: var(--dim); cursor: pointer; }
.crumbs a:hover { color: var(--acc-txt); }
.crumbs i { font-style: normal; color: var(--faint); }
.hdr .inp { height: 44px; }
.hdr .inp svg { flex: none; color: var(--dim); }
.hdr .inp .x { flex: none; border: 0; background: none; color: var(--dim); width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; border-radius: 8px; }
.role { flex: none; }

/* Содержимое */
.content { padding: 14px 12px; display: flex; flex-direction: column; gap: 16px; }
.sec-t { padding: 0 4px; display: flex; justify-content: space-between; align-items: baseline; }
.lrow { padding-right: 10px; }
.lrow .nm { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .mt { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .cnt { flex: none; font-size: 13px; color: var(--dim); }
.lrow.danger .nm { color: var(--alarm-txt); }
.ic-box.f-img { color: var(--pr-txt); background: var(--pr-bg); }
.ic-box.f-pdf { color: var(--alarm-txt); background: var(--alarm-bg); }
.ic-box.f-xls { color: var(--ok-txt); background: var(--ok-bg); }
.ic-box.f-doc { color: var(--pr-txt); background: var(--raised); }
.ic-box.f-zip { color: var(--warn-txt); background: var(--warn-bg); }
.ic-box.f-dir { color: var(--acc-txt); background: var(--sel-bg); }
.ic-box.f-vid, .ic-box.f-aud { color: var(--soft); }
.ic-box .ext { font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.n45 .drop.drop-hint { display: none; }
body.n45.drag .drop.drop-hint { display: flex; }

/* Нижняя панель действий */
.actbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--bar); border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: flex; justify-content: center; }
.actbar .in { width: 100%; max-width: 736px; display: flex; gap: 10px; }
.actbar .btn { flex: 1; }

/* Окна */
.layer { position: fixed; inset: 0; z-index: 20; }
.layer > .scrim { position: absolute; inset: 0; background: var(--scrim); animation: fade .15s ease-out; }
.layer > .sheet { position: absolute; max-width: 760px; margin: 0 auto; max-height: 88vh; overflow-y: auto;
  padding-bottom: calc(18px + env(safe-area-inset-bottom)); animation: up .18s ease-out; }
.layer.center { display: grid; place-items: center; padding: 16px; }
.layer.center > .dlg { position: relative; width: min(440px, 100%); padding: 20px; gap: 16px; animation: fade .15s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.sheet .shd { display: flex; align-items: center; gap: 12px; }
.sheet .shd .htx { padding: 0; }
.sheet .nm-big { font-size: 17px; font-weight: 700; line-height: 1.3; word-break: break-word; }
.preview { border-radius: 14px; background: var(--well); border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; min-height: 120px; }
.preview img { display: block; max-width: 100%; max-height: 46vh; }
.acts-col { display: flex; flex-direction: column; gap: 10px; }
.mv-list { max-height: 46vh; overflow-y: auto; }

/* Сообщения и загрузка */
.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toasts .toast { width: 100%; max-width: 520px; pointer-events: auto; animation: up .18s ease-out; }
.toast .tt { flex: 1; min-width: 0; }
.toast.err { border-color: color-mix(in srgb, var(--alarm) 45%, transparent); color: var(--alarm-txt); }
.toast.ok svg { color: var(--ok); }
.upl { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.upl .r { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.upl .r span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog { height: 4px; border-radius: 2px; background: var(--raised); overflow: hidden; }
.prog b { display: block; height: 100%; background: var(--acc); transition: width .15s; }

.logrow { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; font-size: 14px; line-height: 1.4; }
.logrow:first-child { border-top: 0; }
.logrow .mt { font-size: 12px; color: var(--dim); }
