.portal { background: var(--paper-2); min-height: 100svh; }
.portal .nav__links a:not(.btn) { display: inline; }
.portal__main { width: min(860px, 100% - 2rem); margin-inline: auto; padding: 7rem 0 4rem; }
.panel { animation: rise 600ms var(--ease-out) both; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.login { max-width: 420px; margin-inline: auto; text-align: center; }
.login__mark { width: 120px; margin: 0 auto 1rem; }
.login__form { text-align: left; margin: 1.5rem 0; }
.login__form .btn { justify-self: stretch; }
.error { margin: 0; padding: .7rem .9rem; border-radius: 10px; background: #fdecea; color: #9b2c1e; font-size: .9rem; font-weight: 600; }
.login.shake { animation: shake 360ms var(--ease-out); }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

.files__head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.files__head .title { margin: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 1.5rem 0 1rem; font-size: .9rem; }
.crumbs button { border: 0; background: none; padding: .2rem .4rem; border-radius: 6px; font: inherit; color: var(--teal-deep); cursor: pointer; }
.crumbs button:hover { background: rgba(43,163,174,.12); }
.crumbs span { color: var(--muted); padding: .2rem 0; }

.filelist { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 20px 50px -35px rgba(15,36,66,.5); }
.filelist li { border-top: 1px solid var(--line); animation: rise 450ms var(--ease-out) both; animation-delay: calc(var(--i) * 30ms); }
.filelist li:first-child { border-top: 0; }
.row {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 1rem;
  width: 100%; padding: .9rem 1.2rem; border: 0; background: none; text-align: left; font: inherit; color: inherit;
  cursor: pointer; transition: background-color 120ms ease;
  -webkit-tap-highlight-color: transparent;
}
.row:hover { background: #f7f9fb; }
.row:active { background: #eef3f7; }
.row:focus-visible { outline: 3px solid var(--teal); outline-offset: -3px; }
.row__icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: .7rem; font-weight: 800; color: #fff; background: var(--navy); letter-spacing: .02em; }
.row__icon.is-folder { background: var(--teal); }
.row__name { font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
.row__meta { display: block; font-size: .82rem; color: var(--muted); font-weight: 400; }
.row__action { font-size: .85rem; font-weight: 700; color: var(--teal-deep); white-space: nowrap; }
.row.is-busy .row__action { color: var(--muted); }

.loading { display: grid; place-items: center; padding: 4rem 0; }
.loading[hidden] { display: none; }
.loading span { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--teal); animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .panel, .filelist li { animation: none; }
  .login.shake { animation: none; }
  .loading span { animation-duration: 2s; }
}
