/* BOKS dashboard — app-only layout. Shared primitives and tokens live in style.css. */

.app-body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.app-body [hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.app-body.modal-open {
  overflow: hidden;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  vertical-align: middle;
}

/* The mark glyph is ink on the shared lime tile. */
.brand-mark svg {
  color: var(--bg);
}

.micro-label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--muted);
}

.mono {
  font-family: var(--font-mono);
}

.danger-text {
  color: var(--danger);
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 300;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: 260px;
  padding: 24px 18px 18px;
  overflow-y: auto;
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  padding: 0 8px 24px;
}

.sidebar-brand .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.sidebar-brand .brand-mark {
  display: inline-flex;
  width: 30px;
  height: 30px;
}

.sidebar-brand .brand-mark svg {
  display: block;
  width: 19px;
  height: 19px;
}

.sidebar-brand .brand-name {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.13em;
  line-height: 1;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.side-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.side-nav-item:hover {
  background: var(--bg-elev-2);
  color: var(--text);
}

.side-nav-item.is-current {
  background: var(--accent-soft);
  color: var(--text);
}

.side-nav-item.is-current .icon {
  color: var(--accent);
}

.side-nav-item .icon {
  width: 17px;
  height: 17px;
}

.sidebar-storage {
  margin-top: auto;
  padding: 18px 10px 0;
  border-top: 1px solid var(--line);
}

.storage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.storage-percent {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.02em;
}

.sidebar-storage .meter {
  margin-bottom: 9px;
}

.storage-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.4;
}

.storage-warning {
  display: block;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 107, 94, 0.3);
  border-radius: 7px;
  background: rgba(255, 107, 94, 0.08);
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.55;
  text-decoration: none;
}

.storage-warning:hover {
  border-color: rgba(255, 107, 94, 0.55);
}

.storage-sep {
  color: var(--dim);
}

.sidebar-logout {
  margin-top: 14px;
  color: var(--dim);
}

.sidebar-logout:hover {
  color: var(--danger);
  background: var(--bg-elev-2);
}

.sidebar-logout:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* ---------- Main ---------- */

.main {
  min-height: 100vh;
  margin-left: 260px;
  min-width: 0;
}

.main-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 32px 48px;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 26px;
  margin-bottom: 30px;
}

.crumbs {
  min-width: 0;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crumb-item {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.crumb-link,
.crumb-current {
  display: inline-block;
  max-width: 260px;
  padding: 3px 1px;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.4;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumb-link:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.crumb-current {
  color: var(--text);
  font-weight: 500;
}

.crumb-sep {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 11px;
  user-select: none;
}

.account-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  flex: 0 0 auto;
}

.account-line .micro-label {
  color: var(--dim);
}

.account-line .mono {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 26px;
}

.page-heading {
  min-width: 0;
  flex: 1 1 280px;
}

.page-eyebrow {
  margin-bottom: 10px;
}

.page-title {
  margin: 0 0 10px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.page-title:focus {
  outline: none;
}

.page-title:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.page-meta {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.015em;
  line-height: 1.5;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.page-actions .icon {
  width: 16px;
  height: 16px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  margin-bottom: 14px;
}

.search-wrap {
  position: relative;
  flex: 1 1 260px;
  max-width: 360px;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 11px;
  z-index: 1;
  display: inline-flex;
  transform: translateY(-50%);
  color: var(--dim);
  pointer-events: none;
}

.search-icon .icon {
  width: 16px;
  height: 16px;
}

.search-input {
  width: 100%;
  padding-left: 36px;
  padding-right: 40px;
}

.search-input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
}

.search-clear .icon {
  width: 15px;
  height: 15px;
}

.toolbar-count {
  margin: 0;
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- File browser ---------- */

.browser-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}

.list-head,
.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 124px 148px;
  gap: 14px;
  align-items: center;
  padding-right: 16px;
  padding-left: 16px;
}

.list-head {
  height: 38px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.list-head-actions {
  text-align: right;
}

.file-row {
  min-height: 60px;
  padding-top: 9px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.file-row:last-child {
  border-bottom: 0;
}

.file-row:hover,
.file-row:focus-within {
  background: var(--bg-elev-2);
}

.file-row--folder {
  cursor: pointer;
}

.file-cell-name {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.row-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
}

.row-icon .icon {
  width: 16px;
  height: 16px;
}

.row-icon--folder {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.row-icon-danger {
  border-color: rgba(255, 107, 94, 0.25);
  background: rgba(255, 107, 94, 0.08);
  color: var(--danger);
}

.file-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.file-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.file-name {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  padding: 2px 0;
  overflow: hidden;
  border: 0;
  background: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

a.file-name:hover,
button.file-name:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.shared-badge {
  flex: 0 0 auto;
}

.row-sub {
  display: none;
  overflow: hidden;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-cell-size,
.file-cell-date {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-cell-size {
  color: var(--dim);
}

.file-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.file-actions .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--dim);
  text-decoration: none;
}

.file-actions .icon-btn:hover {
  color: var(--text);
}

.file-actions .icon-btn .icon {
  width: 16px;
  height: 16px;
}

.file-actions [data-action="delete"]:hover {
  color: var(--danger);
}

.browser {
  min-height: 120px;
}

.browser-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 280px;
  padding: 48px 24px;
  text-align: center;
}

.browser-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg-elev-2);
  color: var(--muted);
}

.browser-state-icon .icon {
  width: 22px;
  height: 22px;
}

.browser-state-icon--accent {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.browser-state-icon--danger {
  border-color: rgba(255, 107, 94, 0.22);
  background: rgba(255, 107, 94, 0.07);
  color: var(--danger);
}

.browser-state h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.browser-state p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 11px;
}

.state-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.state-actions .icon {
  width: 15px;
  height: 15px;
}

.skeleton-list {
  overflow: hidden;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.skeleton-row:last-child {
  border-bottom: 0;
}

.skeleton-icon,
.skeleton-bar {
  border-radius: 5px;
  background: var(--bg-elev-3);
  animation: boks-pulse 1.5s ease-in-out infinite;
}

.skeleton-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 8px;
}

.skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1 1 auto;
}

.skeleton-bar {
  height: 9px;
}

.skeleton-bar--name {
  width: min(44%, 240px);
}

.skeleton-bar--meta {
  width: min(24%, 130px);
  opacity: 0.65;
}

@keyframes boks-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.page-footnote {
  max-width: 620px;
  margin: 22px 2px 0;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.6;
}

/* ---------- Modals (app sizing; visuals come from style.css) ---------- */

.modal-backdrop {
  z-index: 100;
}

.app-modal {
  width: 100%;
  max-width: 430px;
}

.app-modal-wide {
  width: 100%;
  max-width: 530px;
}

.app-modal .modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.app-modal .modal-head h2 {
  margin: 3px 0 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.app-modal .modal-head .micro-label {
  color: var(--dim);
}

.app-modal .modal-close .icon {
  width: 17px;
  height: 17px;
}

.app-modal .modal-actions {
  flex-wrap: wrap;
}

.modal-copy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.modal .field-error {
  margin: 8px 0 0;
}

.share-file {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.share-file-text {
  min-width: 0;
}

.share-file-text .micro-label {
  margin-bottom: 3px;
  color: var(--dim);
}

.share-filename {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-state[hidden] {
  display: none !important;
}

.share-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  color: var(--muted);
  font-size: 13px;
}

.share-loading p {
  margin: 0;
}

#share-error {
  padding: 12px;
  border: 1px solid rgba(255, 107, 94, 0.25);
  border-radius: 8px;
  background: rgba(255, 107, 94, 0.06);
}

#share-error .field-error {
  margin: 0 0 10px;
}

.share-url-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.share-url-row .input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.share-url-row .copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  height: 44px;
}

.share-url-row .copy-btn .icon {
  width: 14px;
  height: 14px;
}

.share-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 10px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.share-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 11.5px;
  text-decoration: none;
}

.share-open:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.share-open .icon {
  width: 13px;
  height: 13px;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.share-revoke-toggle {
  color: var(--muted);
}

.share-revoke-toggle:hover {
  color: var(--danger);
}

.share-confirm {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 107, 94, 0.25);
  border-radius: 8px;
  background: rgba(255, 107, 94, 0.06);
}

.share-confirm-copy {
  margin: 0;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.5;
}

.share-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.share-revoked-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.share-revoked-head p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.share-revoked-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.share-revoked-copy {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.delete-target {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.delete-name {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
}

.danger-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 107, 94, 0.24);
  border-radius: 8px;
  background: rgba(255, 107, 94, 0.06);
}

.danger-note-icon {
  display: inline-flex;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--danger);
}

.danger-note-icon .icon {
  width: 16px;
  height: 16px;
}

.danger-note p {
  margin: 0;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.5;
}

.danger-note .danger-note-detail {
  margin-top: 4px;
  color: var(--muted);
}

/* ---------- Drop overlay ---------- */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 10, 11, 0.86);
  pointer-events: none;
}

.drop-card {
  width: min(440px, 100%);
  padding: 46px 30px;
  border: 1px dashed var(--accent);
  border-radius: 14px;
  background: var(--bg-elev);
  text-align: center;
}

.drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
}

.drop-icon .icon {
  width: 23px;
  height: 23px;
}

.drop-title {
  margin: 0 0 6px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.drop-sub {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ---------- Upload tray ---------- */

.upload-tray {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 55;
  width: min(370px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-elev-2);
}

.tray-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.tray-heading {
  min-width: 0;
}

.tray-title {
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.tray-sub {
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.tray-head .icon-btn {
  width: 26px;
  height: 26px;
  color: var(--dim);
}

.tray-head .icon-btn .icon {
  width: 14px;
  height: 14px;
}

.tray-list {
  max-height: 264px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.tray-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.tray-item:last-child {
  border-bottom: 0;
}

.tray-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tray-item-top > .icon {
  width: 15px;
  height: 15px;
  color: var(--dim);
}

.tray-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tray-remove {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: var(--dim);
}

.tray-remove .icon {
  width: 13px;
  height: 13px;
}

.tray-remove:hover {
  color: var(--danger);
}

.tray-progress {
  height: 3px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--bg-elev-3);
}

.tray-progress-fill {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.16s linear;
}

.tray-item.is-done .tray-progress-fill {
  background: var(--ok);
}

.tray-item.is-error .tray-progress-fill {
  background: var(--danger);
}

.tray-item.is-canceled .tray-progress-fill {
  background: var(--dim);
}

.tray-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0 0;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
}

.tray-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tray-item.is-error .tray-status-text {
  color: var(--danger);
}

.tray-item.is-done .tray-status-text {
  color: var(--ok);
}

.tray-foot {
  display: flex;
  justify-content: flex-end;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
}

/* ---------- Toasts (placement on the app page; visual style from style.css) ---------- */

.toast-region {
  top: auto;
  right: 20px;
  bottom: calc(20px + var(--tray-offset, 0px));
  left: auto;
  z-index: 140;
  max-width: min(380px, calc(100vw - 32px));
}

.toast-region .toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.toast-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.toast-close {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin: -2px -4px 0 0;
  color: var(--muted);
}

.toast-close .icon {
  width: 12px;
  height: 12px;
  margin-top: 0;
}

/* ---------- Boot ---------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.boot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(360px, 100%);
  text-align: center;
}

.boot-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--text);
  text-decoration: none;
}

.boot-brand .brand-mark {
  display: inline-flex;
  width: 34px;
  height: 34px;
}

.boot-brand .brand-mark svg {
  display: block;
  width: 21px;
  height: 21px;
}

.boot-brand .brand-name {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.boot-spinner {
  width: 20px;
  height: 20px;
  margin-bottom: 16px;
}

.boot-title {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.boot-detail {
  max-width: 330px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.boot-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.boot-actions:empty {
  display: none;
}

.boot-login {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.boot-login:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.boot.is-error .boot-spinner {
  display: none;
}

.noscript-note {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 400;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-elev-2);
  color: var(--text);
  font-size: 13px;
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 1060px) {
  .list-head,
  .file-row {
    grid-template-columns: minmax(0, 1fr) 88px 112px 140px;
    gap: 11px;
  }
}

@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 12px 16px 13px;
    overflow: visible;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-brand {
    flex: 1 1 auto;
    order: 1;
    padding: 0;
  }

  .sidebar-brand .brand-mark,
  .sidebar-brand .brand-mark svg {
    width: 26px;
    height: 26px;
  }

  .sidebar-brand .brand-name {
    font-size: 15px;
  }

  .sidebar-logout {
    order: 2;
    width: auto;
    margin: 0;
    padding: 7px 9px;
    color: var(--muted);
    font-size: 12px;
  }

  .side-nav {
    order: 3;
    flex: 1 1 100%;
    flex-direction: row;
    gap: 4px;
    padding-top: 2px;
  }

  .side-nav-item {
    width: auto;
    padding: 8px 10px;
    font-size: 12.5px;
  }

  .sidebar-storage {
    order: 4;
    flex: 1 1 100%;
    margin: 0;
    padding: 9px 2px 0;
    border-top: 1px solid var(--line);
  }

  .sidebar-storage .meter {
    margin-bottom: 7px;
  }

  .storage-head {
    margin-bottom: 7px;
  }

  .main {
    margin-left: 0;
  }

  .main-inner {
    padding: 22px 22px 40px;
  }

  .topline {
    margin-bottom: 24px;
  }
}

@media (max-width: 760px) {
  .list-head {
    display: none;
  }

  .file-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: none;
    gap: 10px;
    padding: 11px 12px;
    min-height: 64px;
  }

  .file-cell-size,
  .file-cell-date {
    display: none;
  }

  .file-cell-name {
    gap: 10px;
  }

  .row-sub {
    display: block;
  }

  .file-actions {
    gap: 0;
  }

  .file-actions .icon-btn {
    width: 32px;
    height: 34px;
  }

  .browser-state {
    min-height: 240px;
    padding: 40px 20px;
  }
}

@media (max-width: 560px) {
  .main-inner {
    padding: 20px 16px 36px;
  }

  .account-line {
    display: none;
  }

  .page-head {
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
  }

  .page-heading {
    flex-basis: 100%;
  }

  .page-title {
    font-size: 29px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .search-wrap {
    flex-basis: 100%;
    max-width: none;
  }

  .file-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 4px;
  }

  .file-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-left: 42px;
  }

  .file-name {
    max-width: 100%;
  }

  .toolbar-count {
    width: 100%;
  }

  .share-url-row {
    flex-wrap: wrap;
  }

  .share-url-row .input {
    flex: 1 1 100%;
  }

  .share-url-row .copy-btn {
    width: 100%;
    justify-content: center;
  }

  .upload-tray {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }

  .toast-region {
    top: auto;
    right: 12px;
    bottom: calc(12px + var(--tray-offset, 0px));
    left: 12px;
    width: auto;
    max-width: none;
  }

  .app-modal .modal-actions .btn {
    flex: 1 1 120px;
  }
}

@media (max-width: 400px) {
  .main-inner {
    padding-right: 14px;
    padding-left: 14px;
  }

  .file-row {
    padding-right: 10px;
    padding-left: 10px;
    gap: 6px;
  }

  .file-actions .icon-btn {
    width: 30px;
  }

  .file-name {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-icon,
  .skeleton-bar {
    animation: none;
  }

  .tray-progress-fill {
    transition: none;
  }

  .skip-link {
    transition: none;
  }
}

/* ---------- Encryption unlock ---------- */
.vault-lock {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  overflow-y: auto;
  background: var(--bg);
}

.vault-lock[hidden] {
  display: none;
}

.vault-lock-card {
  width: min(520px, 100%);
  padding: clamp(26px, 5vw, 42px);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}

.vault-lock-brand {
  margin-bottom: 30px;
}

.vault-lock-card h1 {
  margin: 8px 0 12px;
  font-size: clamp(28px, 5vw, 38px);
  letter-spacing: -0.03em;
}

.vault-lock-copy {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.vault-lock-card .field {
  margin-bottom: 12px;
}

.vault-lock-card .field-error {
  min-height: 18px;
  margin: 6px 0 10px;
}

.vault-lock-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.6;
}

.vault-lock-foot a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
