/* app (#app): the OnDrive app as a console panel (reference: "Every request and every dollar, in one console").
   Panel spans the frame; top bar; body on --surface-raised; three views (Files, Versions, Sharing) switched by the
   segmented tabs under the panel, which auto-advance with a fill bar until the visitor clicks. */
.app > .ap-headwrap { padding-bottom: 48px; }
.app > .ap-panel { padding: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.app > .ap-tabsrow { padding-top: 24px; display: flex; align-items: center; gap: 12px 22px; flex-wrap: wrap; }
.ap-br { display: none; }
@media (min-width: 900px) { .ap-br { display: inline; } }

/* top bar */
.ap-top { display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 var(--gutter); background: var(--bg); border-bottom: 1px solid var(--line); }
.ap-org { font-size: 13.5px; color: var(--fg); white-space: nowrap; }
.ap-crumb { font-size: 11.5px; letter-spacing: 0.02em; text-transform: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-top__r { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.ap-sample { padding: 3px 6px; border: 1px solid var(--line-strong); color: var(--mist); font: 500 9.5px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.ap-host { color: var(--mist); font: 400 12px/1 var(--f-mono); white-space: nowrap; }

/* body + views */
.ap-body { position: relative; background: var(--surface-raised); overflow: hidden; min-height: 470px; }
.ap-view { display: none; padding: 32px var(--gutter) 34px; }
.ap-view.is-on { display: block; animation: ap-in .45s var(--ease-out) both; }
@keyframes ap-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------------- Files ---------------- */
.ap-files { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; }
.ap-tr { display: grid; grid-template-columns: minmax(0, 2.75fr) minmax(0, 1.35fr) minmax(0, 0.8fr) 90px 78px; align-items: center; gap: 14px; min-height: 39px; border-bottom: 1px solid var(--line); }
.ap-th { min-height: 32px; color: var(--mist); font: 500 11px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; border-bottom-color: var(--line-strong); }
.ap-r { text-align: right; justify-self: end; }
.ap-row { position: relative; width: 100%; padding: 0; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s var(--ease); }
.ap-row::before { content: ""; position: absolute; left: 0; top: -1px; bottom: -1px; width: 2px; background: var(--accent-line); transform: scaleY(0); transition: transform .2s var(--ease-out); }
.ap-row:hover { background: var(--surface); }
.ap-row.is-sel { background: var(--surface); }
.ap-row.is-sel::before, .ap-row:focus-visible::before { transform: none; }
.ap-row:focus-visible { outline: none; background: var(--surface); }
.js .ap-row { opacity: .3; transform: translateY(6px); }
.ap-row.in { opacity: 1; transform: none; transition: opacity .45s var(--ease-out), transform .5s var(--ease-out), background .15s var(--ease); }
.ap-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13.5px; color: var(--fg); }
.ap-name .ic { width: 16px; height: 16px; flex: none; color: var(--fg-2); }
.ap-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-name .ap-eye { display: none; width: 14px; height: 14px; margin-left: auto; color: var(--mist); }
.ap-path { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--mist); font: 400 12px/1 var(--f-mono); white-space: nowrap; overflow: hidden; }
.ap-path em { font-style: normal; overflow: hidden; text-overflow: ellipsis; }
.ap-tagc { flex: none; padding: 3px 5px; border: 1px solid var(--line-strong); color: var(--mist); font: 500 9.5px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.ap-own { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--fg-2); white-space: nowrap; }
.ap-av { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; background: var(--c, #555); color: #fff; font: 600 9px/1 var(--f-body); font-style: normal; letter-spacing: 0.02em; }
.ap-mono { color: var(--fg-2); font: 400 12px/1 var(--f-mono); white-space: nowrap; }
.ap-acc { font: 400 12px/1 var(--f-mono); color: var(--fg-2); white-space: nowrap; }
.ap-acc.is-r { color: var(--accent-text); }

/* stats column */
.ap-stats { display: flex; flex-direction: column; min-width: 0; }
.ap-big { display: block; margin-top: 14px; font: 400 clamp(36px, 3.3vw, 46px)/1 var(--f-mono); letter-spacing: -0.03em; color: var(--fg); }
.ap-chart { margin-top: 18px; }
.ap-chart__tip { display: block; margin-bottom: 8px; font-size: 10.5px; min-height: 15px; transition: color .15s var(--ease); }
.ap-chart__tip.on { color: var(--fg); }
.ap-bars { display: flex; align-items: flex-end; gap: 3px; height: 72px; }
.ap-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; padding: 0; border: 0; background: transparent; cursor: pointer; }
.ap-bar i { display: block; width: 100%; height: var(--h); background: var(--line-strong); transform: scaleY(0); transform-origin: bottom; transition: transform .7s var(--ease-out), background .15s var(--ease); transition-delay: calc(var(--k) * 40ms); }
.ap-bar.last i { background: var(--fg); }
.ap-bar:hover i, .ap-bar:focus-visible i { background: var(--accent-line); }
.ap-bar:focus-visible { outline: none; }
.ap-stats.in .ap-bar i { transform: none; }
.ap-sec { display: block; margin-top: 26px; margin-bottom: 4px; }
.ap-hb { display: grid; grid-template-columns: 112px minmax(0, 1fr) 62px; align-items: center; gap: 12px; height: 25px; font-size: 13.5px; color: var(--fg); }
.ap-hb span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-hb__t { position: relative; height: 4px; background: var(--line); }
.ap-hb__t i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: var(--fg); transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease-out); transition-delay: calc(var(--k) * 90ms + 200ms); }
.ap-stats.in .ap-hb__t i { transform: none; }
.ap-hb b { font: 400 12.5px/1 var(--f-mono); color: var(--fg-2); text-align: right; }

/* ---------------- Versions ---------------- */
.ap-ver { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.ap-doc { background: var(--bg); border: 1px solid var(--line); }
.ap-doc__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 40px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.ap-doc__name { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--fg); }
.ap-doc__name .ic { width: 16px; height: 16px; color: var(--blue); }
.ap-doc__bar .label { font-size: 10.5px; }
.ap-doc__scroll { height: 392px; overflow: auto; overscroll-behavior: contain; }
.ap-doc__page { max-width: 620px; padding: 28px 34px 34px; }
.ap-doc__page h3 { font: 500 24px/1.15 var(--f-body); letter-spacing: -0.02em; color: var(--fg); }
.ap-doc__page .ap-doc__meta { margin-top: 6px; color: var(--mist); font: 400 11.5px/1.4 var(--f-mono); }
.ap-doc__page h4 { margin: 22px 0 6px; font: 600 14px/1.3 var(--f-body); color: var(--fg); }
.ap-doc__page p { font-size: 14px; line-height: 1.65; color: var(--fg-2); }
.ap-add-mark { background: rgba(31, 138, 91, 0.16); box-shadow: inset 0 -1.5px 0 var(--ok); color: var(--fg); }
.ap-del-mark { color: var(--accent-text); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.ap-doc__page.no-changes .ap-add-mark { background: none; box-shadow: none; color: inherit; }
.ap-doc__page.no-changes .ap-del-mark { display: none; }
.ap-doc__page .ap-new { animation: ap-flash 1.2s var(--ease) both; }
@keyframes ap-flash { from { background: rgba(31, 138, 91, 0.3); } }
.ap-hist { background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; }
.ap-hist__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.ap-switch { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: var(--fg-2); font: 500 12px/1 var(--f-body); cursor: pointer; }
.ap-switch__t { position: relative; width: 26px; height: 14px; background: var(--line-strong); transition: background .2s var(--ease); }
.ap-switch__t i { position: absolute; left: 2px; top: 2px; width: 10px; height: 10px; background: var(--bg); transition: transform .2s var(--ease-out); }
.ap-switch[aria-checked="true"] .ap-switch__t { background: var(--ok); }
.ap-switch[aria-checked="true"] .ap-switch__t i { transform: translateX(12px); }
.ap-hist__list { list-style: none; margin: 0; padding: 6px 0; position: relative; max-height: 338px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.ap-hist__list::before { content: ""; position: absolute; left: 20px; top: 20px; height: calc(100% - 40px); min-height: 0; width: 1px; background: var(--line); }
.ap-hi { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 0 12px; width: 100%; padding: 8px 14px 8px 12px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s var(--ease); }
.ap-hi:hover { background: var(--surface); }
.ap-hi.is-sel { background: var(--accent-soft); }
.ap-hi__dot { grid-row: span 3; justify-self: center; margin-top: 4px; width: 9px; height: 9px; border: 1.5px solid var(--line-strong); background: var(--bg); z-index: 1; }
.ap-hi.is-cur .ap-hi__dot { background: var(--ok); border-color: var(--ok); }
.ap-hi.is-sel .ap-hi__dot { border-color: var(--accent-line); }
.ap-hi.is-sel:not(.is-cur) .ap-hi__dot { background: var(--accent-line); }
.ap-hi__time { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--fg); }
.ap-hi__tag { padding: 2px 5px; border: 1px solid currentColor; color: var(--ok-text); font: 500 9px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.ap-hi__who { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 12.5px; color: var(--fg-2); }
.ap-hi__who .ap-av { width: 16px; height: 16px; font-size: 7.5px; }
.ap-hi__what { margin-top: 3px; color: var(--mist); font: 400 11px/1.4 var(--f-mono); }
.ap-hi.is-fresh { animation: ap-fresh 1.4s var(--ease) both; }
@keyframes ap-fresh { from { background: rgba(31, 138, 91, 0.22); } }
.ap-restore { margin: 0; justify-content: center; border-top: 1px solid var(--line); min-height: 48px; }
.ap-restore[disabled] { opacity: .4; cursor: default; }
.ap-restore.pulse { animation: ap-pulse 1.4s var(--ease) 2; }
@keyframes ap-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(234, 51, 35, 0.4); } 50% { box-shadow: 0 0 0 6px rgba(234, 51, 35, 0); } }

/* ---------------- Sharing ---------------- */
.ap-share { display: grid; grid-template-columns: 250px minmax(0, 560px); gap: 40px; justify-content: center; align-items: start; }
.ap-share__file { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ap-share__thumb { aspect-ratio: 240 / 310; background: var(--bg); border: 1px solid var(--line); padding: 10px; margin-bottom: 8px; }
.ap-share__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ap-share__file b { font-weight: 500; font-size: 14px; line-height: 1.35; color: var(--fg); }
.ap-share__file .label { font-size: 10.5px; text-transform: none; letter-spacing: 0.02em; }
.ap-share__own { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fg-2); }
.ap-dialog { background: var(--bg); border: 1px solid var(--line-strong); padding: 20px 20px 16px; min-width: 0; }
.ap-dialog__title { font: 500 18px/1.3 var(--f-body); letter-spacing: -0.015em; color: var(--fg); }
.ap-dialog__title span { color: var(--fg-2); font-weight: 400; word-break: break-word; }
.ap-add { position: relative; margin-top: 14px; }
.ap-add__row { display: flex; gap: 8px; }
.ap-add__in { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface-raised); transition: border-color .15s var(--ease); }
.ap-add__in:focus-within { border-color: var(--fg); }
.ap-add__in .ic { width: 16px; height: 16px; color: var(--mist); flex: none; }
.ap-add__in input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--fg); font: 400 14px/1 var(--f-body); }
.ap-add__in input::placeholder { color: var(--mist); }
.ap-sel { -webkit-appearance: none; appearance: none; height: 40px; padding: 0 30px 0 11px; border: 1px solid var(--line-strong); border-radius: 0; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 8 5 5 5-5' fill='none' stroke='%238a8b8d' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; color: var(--fg); font: 500 13px/1 var(--f-body); cursor: pointer; }
.ap-sel:focus-visible { outline: 1px solid var(--accent-line); outline-offset: 2px; }
.ap-add__go { height: 40px; }
.ap-sugg { position: absolute; left: 0; right: 0; top: 44px; z-index: 4; list-style: none; margin: 0; padding: 4px 0; background: var(--bg); border: 1px solid var(--line-strong); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12); display: none; }
.ap-sugg.on { display: block; }
.ap-sugg li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; font-size: 13.5px; color: var(--fg); }
.ap-sugg li small { margin-left: auto; color: var(--mist); font: 400 11px/1 var(--f-mono); }
.ap-sugg li.is-hi, .ap-sugg li:hover { background: var(--surface); }
.ap-warn { min-height: 0; margin-top: 0; color: var(--accent-text); font: 400 12px/1.4 var(--f-mono); }
.ap-warn:not(:empty) { margin-top: 8px; }
.ap-dialog .ap-sec { margin-top: 14px; }
.ap-people { list-style: none; margin: 4px 0 0; padding: 0; }
.ap-person { display: flex; align-items: center; gap: 12px; min-height: 42px; border-bottom: 1px solid var(--line); }
.ap-person:last-child { border-bottom: 0; }
.ap-person .ap-av, .ap-team { width: 28px; height: 28px; font-size: 10.5px; }
.ap-team { display: inline-grid; place-items: center; flex: none; background: var(--surface); border: 1px solid var(--line); color: var(--fg-2); }
.ap-team .ic { width: 15px; height: 15px; }
.ap-person__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ap-person__t b { font-weight: 500; font-size: 13.5px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-person__t small { color: var(--mist); font: 400 11px/1.2 var(--f-mono); }
.ap-person .ap-sel { height: 30px; font-size: 12.5px; }
.ap-person .ap-ownr { color: var(--mist); font: 400 12px/1 var(--f-mono); padding-right: 8px; }
.ap-person.is-new { animation: ap-fresh 1.4s var(--ease) both; }
.ap-person.is-out { opacity: 0; transform: translateX(10px); transition: opacity .25s var(--ease), transform .3s var(--ease); }
.ap-gen { display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 10px 12px; background: var(--surface-raised); border: 1px solid var(--line); }
.ap-gen__ic { display: grid; place-items: center; width: 28px; height: 28px; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.ap-gen__ic .ic { width: 15px; height: 15px; }
.ap-gen.is-off .ap-gen__ic { background: var(--surface); color: var(--mist); }
.ap-gen__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ap-gen__t b { font-weight: 500; font-size: 13.5px; color: var(--fg); }
.ap-gen__t small { color: var(--mist); font-size: 12.5px; }
.ap-toggle { position: relative; width: 38px; height: 22px; flex: none; padding: 0; border: 0; background: var(--line-strong); cursor: pointer; transition: background .2s var(--ease); }
.ap-toggle i { position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; transition: transform .25s var(--ease-out); }
.ap-toggle.is-on { background: var(--accent); }
.ap-toggle.is-on i { transform: translateX(16px); }
.ap-dialog__foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }

/* ---------------- drawer, scrim, toast ---------------- */
.ap-scrim { position: absolute; inset: 0; z-index: 5; background: rgba(17, 17, 17, 0.1); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.ap-scrim.on { opacity: 1; pointer-events: auto; }
.ap-drawer { position: absolute; top: 0; right: 0; bottom: 0; z-index: 6; width: min(460px, 100%); display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--line-strong); transform: translateX(102%); transition: transform .5s var(--ease-out); }
.ap-drawer.on { transform: none; }
.ap-drawer__bar { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.ap-drawer__ic .ic { width: 16px; height: 16px; color: var(--fg-2); }
.ap-drawer__name { flex: 1; min-width: 0; font-size: 13.5px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-x { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--mist); cursor: pointer; }
.ap-x:hover { color: var(--fg); }
.ap-x .ic { width: 16px; height: 16px; }
.ap-drawer__body { flex: 1; overflow: auto; padding: 18px 18px 20px; overscroll-behavior: contain; }
.ap-prev { position: relative; background: #ecebe6; border: 1px solid var(--line); padding: 14px; display: grid; place-items: center; }
.ap-prev img { width: 100%; max-width: 330px; height: auto; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 6px 18px rgba(0, 0, 0, .08); }
.ap-prev .ap-mini { width: 100%; max-width: 330px; background: #fff; color: #222; padding: 20px 20px 24px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 6px 18px rgba(0, 0, 0, .08); font-size: 10.5px; line-height: 1.55; }
.ap-mini h5 { margin: 0 0 4px; font: 600 15px/1.2 var(--f-body); color: #111; }
.ap-mini h6 { margin: 12px 0 3px; font: 600 11px/1.3 var(--f-body); color: #111; }
.ap-mini p { margin: 0; color: #444; }
.ap-mini .m { color: #888; font: 400 9px/1.4 var(--f-mono); }
.ap-mini table { width: 100%; border-collapse: collapse; margin-top: 8px; font: 400 9.5px/1.2 var(--f-mono); color: #333; }
.ap-mini th, .ap-mini td { border: 1px solid #ddd; padding: 4px 5px; text-align: left; }
.ap-mini th { background: #f2f2ef; font-weight: 600; }
.ap-mini td.n { text-align: right; }
.ap-prev .ap-scanbadge { position: absolute; left: 22px; top: 22px; padding: 4px 7px; background: #111; color: #fff; font: 500 9.5px/1 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.ap-meta { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0; margin: 16px 0 0; }
.ap-meta dt, .ap-meta dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ap-meta dt { color: var(--mist); font: 500 10.5px/1.5 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.ap-meta dd { font-size: 13px; color: var(--fg); }
.ap-drawer__acts { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.ap-toast { position: absolute; left: 50%; bottom: 20px; z-index: 8; display: inline-flex; align-items: center; gap: 9px; padding: 10px 14px; background: var(--fg); color: var(--bg); font: 500 13px/1 var(--f-body); white-space: nowrap; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease), transform .4s var(--ease-out); }
.ap-toast .ic { width: 15px; height: 15px; color: #4CC98F; stroke-width: 2; }
.ap-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- tabs (reference .seg with fill bar) ---------------- */
.ap-seg { display: inline-flex; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.ap-seg button { position: relative; padding: 13px 16px; border: 0; background: var(--bg); color: var(--mist); font: 500 12.5px/1 var(--f-body); cursor: pointer; transition: color .15s var(--ease), background .15s var(--ease); }
.ap-seg button:hover { color: var(--fg); }
.ap-seg button.on { background: var(--accent); color: var(--accent-ink); }
.ap-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; overflow: hidden; pointer-events: none; }
.ap-fill i { display: block; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.55); transform: scaleX(0); transform-origin: left; }
.ap-seg.auto button.on .ap-fill i { animation: ap-fillrun var(--dur, 7s) linear forwards; }
@keyframes ap-fillrun { to { transform: scaleX(1); } }
.ap-help { color: var(--mist); font-size: 14px; line-height: 1.55; }

/* ---------------- responsive ---------------- */
@media (max-width: 1180px) {
  .ap-files { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .ap-stats { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0 34px; padding-top: 24px; border-top: 1px solid var(--line); align-items: start; }
  .ap-stats > :nth-child(1) { grid-column: 1; grid-row: 1; }
  .ap-stats > :nth-child(2) { grid-column: 1; grid-row: 2; }
  .ap-stats > :nth-child(3) { grid-column: 1; grid-row: 3; }
  .ap-stats > :nth-child(4) { grid-column: 2; grid-row: 1; margin-top: 0; }
  .ap-stats > :nth-child(5) { grid-column: 2; grid-row: 2 / span 2; margin-top: 10px; }
  .ap-stats > :nth-child(6) { grid-column: 3; grid-row: 1; margin-top: 0; }
  .ap-stats > :nth-child(7) { grid-column: 3; grid-row: 2 / span 2; margin-top: 10px; }
  .ap-hb { grid-template-columns: 96px minmax(0, 1fr) 54px; gap: 10px; }
  .ap-ver { grid-template-columns: minmax(0, 1fr) 300px; }
  .ap-doc__scroll { height: 528px; }
  .ap-hist__list { max-height: 474px; }
}
@media (max-width: 860px) {
  .ap-doc__scroll { height: 360px; }
  .ap-hist__list { max-height: none; }
  .ap-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ap-stats > :nth-child(1), .ap-stats > :nth-child(2), .ap-stats > :nth-child(3) { grid-column: 1 / -1; }
  .ap-stats > :nth-child(4) { grid-column: 1; grid-row: 4; margin-top: 24px; }
  .ap-stats > :nth-child(5) { grid-column: 1; grid-row: 5; }
  .ap-stats > :nth-child(6) { grid-column: 2; grid-row: 4; margin-top: 24px; }
  .ap-stats > :nth-child(7) { grid-column: 2; grid-row: 5; }
  .ap-tr { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.3fr) 36px 92px 74px; }
  .ap-own span, .ap-th span:nth-child(3) { font-size: 0; }
  .ap-th span:nth-child(3)::before { content: "Who"; font-size: 11px; }
  .ap-ver { grid-template-columns: minmax(0, 1fr); }
  .ap-share { grid-template-columns: minmax(0, 1fr); }
  .ap-share__file { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; align-items: center; }
  .ap-share__thumb { grid-row: span 3; padding: 4px; margin: 0; }
}
@media (max-width: 640px) {
  .app > .ap-headwrap { padding-bottom: 32px; }
  .ap-crumb, .ap-host { display: none; }
  .ap-view { padding: 18px 14px 22px; }
  .ap-th { display: none; }
  .ap-tr.ap-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name name" "path acc"; gap: 6px 10px; padding: 11px 4px; }
  .ap-row .ap-name { grid-area: name; }
  .ap-row .ap-path { grid-area: path; }
  .ap-row .ap-acc { grid-area: acc; }
  .ap-row .ap-own, .ap-row .ap-mono { display: none; }
  #apRows .ap-row:nth-child(4), #apRows .ap-row:nth-child(7) { display: none; }
  .ap-name .ap-eye { display: block; }
  .ap-stats { grid-template-columns: minmax(0, 1fr); }
  .ap-stats > * { grid-column: 1 !important; grid-row: auto !important; }
  .ap-stats > :nth-child(6) { margin-top: 24px; }
  .ap-hb { grid-template-columns: 104px minmax(0, 1fr) 56px; }
  .ap-doc__scroll { height: 300px; }
  .ap-hist__list { max-height: 268px; }
  .ap-stats > :nth-child(6), .ap-stats > :nth-child(7) { display: none; }
  .ap-doc__page { padding: 20px 18px 24px; }
  .ap-add__row { flex-wrap: wrap; }
  .ap-add__in { flex-basis: 100%; }
  .ap-add__row .ap-sel { flex: 1; }
  .ap-dialog { padding: 18px 14px 14px; }
  .ap-sugg { top: 92px; }
  .ap-seg { display: flex; width: 100%; }
  .ap-help { min-height: calc(1.55em * 2); }
  .ap-seg button { flex: 1; padding-left: 6px; padding-right: 6px; }
  .ap-toast { left: 14px; right: 14px; justify-content: center; white-space: normal; text-align: center; line-height: 1.35; transform: translateY(16px); }
  .ap-toast.on { transform: none; }
}
