:root {
  color-scheme: light;
  --bg: #f7f1e7;
  --bg-texture: radial-gradient(circle at 30% 12%, rgba(205, 169, 99, .13), transparent 30%),
    linear-gradient(135deg, rgba(124, 86, 35, .07) 0 1px, transparent 1px 100%);
  --sidebar: rgba(255, 252, 246, .82);
  --panel: rgba(255, 252, 246, .74);
  --panel-strong: rgba(255, 255, 255, .88);
  --panel-soft: rgba(241, 232, 217, .62);
  --text: #172333;
  --muted: #6e7480;
  --line: rgba(147, 119, 77, .25);
  --line-strong: rgba(172, 132, 63, .46);
  --gold: #dca53d;
  --gold-2: #f2c96e;
  --blue: #3f8ee9;
  --green: #2eac68;
  --danger: #b44a42;
  --spinner-dot: #d9a047;
  --spinner-glow: rgba(220, 165, 61, .36);
  --shadow: 0 18px 50px rgba(87, 62, 28, .12);
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root.dark {
  color-scheme: dark;
  --bg: #08111b;
  --bg-texture: radial-gradient(circle at 82% 0%, rgba(199, 147, 62, .13), transparent 28%),
    radial-gradient(circle at 32% 28%, rgba(90, 123, 156, .1), transparent 32%),
    linear-gradient(135deg, rgba(238, 180, 76, .08) 0 1px, transparent 1px 100%);
  --sidebar: rgba(11, 20, 31, .9);
  --panel: rgba(13, 25, 38, .74);
  --panel-strong: rgba(15, 28, 43, .9);
  --panel-soft: rgba(23, 38, 55, .7);
  --text: #f3efe6;
  --muted: #a5adba;
  --line: rgba(190, 154, 92, .22);
  --line-strong: rgba(217, 166, 71, .5);
  --gold: #e0ad4c;
  --gold-2: #ffd27a;
  --blue: #5799ee;
  --green: #42c37d;
  --danger: #ff827a;
  --spinner-dot: #f1c15d;
  --spinner-glow: rgba(242, 201, 110, .58);
  --shadow: 0 22px 60px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

html,
body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-texture);
  background-size: auto, 180px 180px;
  font-family: var(--font-sans);
  overflow-x: hidden;
}

button,
input,
select { font: inherit; }

button { cursor: pointer; }

button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.hidden { display: none !important; }

.depositum-spinner {
  --spinner-size: 24px;
  width: var(--spinner-size);
  height: var(--spinner-size);
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
  vertical-align: middle;
}

.depositum-spinner i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: var(--spinner-dot);
  box-shadow: 0 0 9px var(--spinner-glow);
  transform: rotate(calc(var(--i) * 30deg)) translateY(-10px);
  animation: depositum-dot-pulse 1.1s linear infinite;
  animation-delay: calc(var(--i) * -0.092s);
}

@keyframes depositum-dot-pulse {
  0%, 100% {
    opacity: 1;
    filter: brightness(1.25);
  }
  55% {
    opacity: .25;
    filter: brightness(.72);
  }
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 26px 13px 20px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  justify-content: center;
  min-height: 160px;
  text-decoration: none;
}

.brand-logo {
  width: 210px;
  height: 172px;
  object-fit: contain;
}

.brand-logo-light,
:root.dark .brand-logo-dark { display: block; }

.brand-logo-dark,
:root.dark .brand-logo-light { display: none; }

.side-nav,
.side-section {
  display: grid;
  gap: 7px;
}

.nav-item,
.side-section button {
  width: 100%;
  min-height: 45px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  text-align: left;
}

.nav-item span,
.side-section button span {
  width: 22px;
  color: var(--muted);
  text-align: center;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(224, 173, 76, .95), rgba(224, 173, 76, .12) 9px, var(--panel-soft) 9px);
  box-shadow: inset 0 0 0 1px var(--line);
}

.nav-item.active span { color: var(--gold); }

.nav-item:hover,
.side-section button:hover { background: var(--panel-soft); }

.side-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.side-section p {
  margin: 0 0 4px 18px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .06em;
}

.secure-note {
  margin-top: auto;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 18px 16px;
  color: var(--muted);
  background: linear-gradient(145deg, rgba(224, 173, 76, .1), transparent);
  display: grid;
  gap: 8px;
  line-height: 1.45;
}

.secure-note strong {
  color: var(--gold);
  font-size: 14px;
}

.secure-note span { font-size: 13px; }

.account-mini {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.account-mini:hover,
.account-mini:focus-visible {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--gold) 9%, var(--panel-soft));
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: var(--panel-soft);
  color: var(--gold);
  font: 700 24px var(--font-serif);
}

.avatar.has-image {
  background-size: cover;
  background-position: center;
  color: transparent;
}

.account-mini strong,
.account-mini span {
  display: block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-mini span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.main {
  min-width: 0;
  padding: 26px 22px 44px;
  overflow-x: hidden;
}

.workspace {
  min-height: calc(100vh - 26px);
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.search-box {
  width: min(490px, 100%);
  min-height: 43px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 0 10px;
  color: var(--muted);
}

.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  min-width: 0;
}

kbd {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 6px;
  color: var(--muted);
  font-size: 12px;
  background: var(--panel-soft);
}

.top-actions,
.action-row,
.tool-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-actions { justify-content: flex-end; }

.icon-btn,
.ghost-btn,
.primary-btn,
.danger-btn,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: var(--panel);
  text-decoration: none;
}

.icon-btn {
  width: 42px;
  display: inline-grid;
  place-items: center;
  position: relative;
  font-weight: 800;
}

.notification-btn span {
  position: absolute;
  right: -5px;
  top: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  color: #172333;
  font-size: 11px;
  display: grid;
  place-items: center;
}

.notification-btn.has-notifications {
  border-color: var(--line-strong);
  color: var(--gold);
}

.temple-btn {
  color: var(--gold);
  border-radius: 50%;
  border-color: var(--line-strong);
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 0;
}

.temple-btn[data-mode="auto"] {
  font-weight: 800;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 18%, transparent);
}

.ghost-btn,
.primary-btn,
.danger-btn {
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-btn {
  border-color: rgba(156, 107, 31, .35);
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1d2631;
  box-shadow: 0 10px 24px rgba(177, 122, 33, .18);
}

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

.file-picker input { display: none; }

select {
  padding: 0 12px;
  max-width: 260px;
}

.view { display: none; }
.view.active { display: block; }
.dashboard-grid.active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(248px, 274px);
  gap: 18px;
}

.content-pane { min-width: 0; }

.folder-tree-panel {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.folder-tree-heading {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.folder-tree-heading h2 {
  margin: 0;
  font-size: 15px;
}

.folder-tree-heading span,
.folder-tree-node small,
.folder-tree-empty {
  color: var(--muted);
  font-size: 12px;
}

.folder-tree {
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 2px;
}

.folder-tree-row {
  padding-left: calc(var(--depth, 0) * 22px);
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  position: relative;
}

.folder-tree-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: calc(var(--depth, 0) * 22px + 13px);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--line-strong) 70%, transparent) 1px, transparent 1.4px);
  background-size: 22px 6px;
  background-position: 11px 0;
  opacity: .58;
  pointer-events: none;
}

.folder-tree-row::after {
  content: "";
  position: absolute;
  left: var(--branch-left, 0);
  top: 50%;
  width: 22px;
  border-top: 1px dotted color-mix(in srgb, var(--line-strong) 72%, transparent);
  pointer-events: none;
}

.folder-tree-row.is-root::before,
.folder-tree-row.is-root::after {
  display: none;
}

.folder-tree-toggle {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: color-mix(in srgb, var(--panel-strong) 78%, transparent);
  color: var(--gold);
  display: grid;
  place-items: center;
  font-weight: 800;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.folder-tree-toggle:disabled {
  border-color: transparent;
  background: transparent;
  color: transparent;
}

.folder-tree-node {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 9px;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: 24px minmax(100px, auto) minmax(80px, 1fr);
  align-items: center;
  gap: 8px;
  text-align: left;
  min-width: 0;
}

.folder-tree-node span {
  color: var(--gold);
}

.folder-tree-node strong {
  font-size: 13px;
}

.folder-tree-node small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-tree-node.is-current {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--gold) 12%, var(--panel));
}

.folder-tree-node.is-drop-target {
  border-color: color-mix(in srgb, var(--green) 64%, var(--line-strong));
  background: color-mix(in srgb, var(--green) 14%, var(--panel-strong));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 35%, transparent);
}

.folder-row-drop-target,
.preview-card.is-drop-target {
  outline: 2px solid color-mix(in srgb, var(--green) 58%, var(--line-strong));
  outline-offset: -2px;
  background: color-mix(in srgb, var(--green) 12%, var(--panel-strong));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 34%, transparent);
}

.folder-tree-empty {
  padding: 12px;
}

.drag-source {
  opacity: .58;
}

.hero {
  min-height: 184px;
  display: flex;
  align-items: end;
  position: relative;
  isolation: isolate;
  margin-bottom: 18px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -24px 0 auto auto;
  width: 330px;
  height: 285px;
  background: url("hero-statue-light.png") center / contain no-repeat;
  opacity: .58;
  z-index: -1;
  pointer-events: none;
}

:root.dark .hero::before {
  background-image: url("hero-statue-dark.png");
  opacity: .7;
}

.roman-mark {
  position: absolute;
  right: 245px;
  top: 40px;
  width: 200px;
  color: color-mix(in srgb, var(--gold) 38%, transparent);
  font: 26px var(--font-serif);
  letter-spacing: .35em;
  text-transform: uppercase;
  line-height: 1.45;
  opacity: .34;
}

h1,
h2,
p { overflow-wrap: anywhere; }

h1 {
  margin: 0;
  color: var(--text);
  font: 52px var(--font-serif);
  line-height: 1.02;
}

.title-rule {
  display: block;
  width: 62px;
  height: 2px;
  margin: 16px 0 12px;
  background: linear-gradient(90deg, var(--gold), transparent);
  position: relative;
}

.title-rule::after {
  content: "";
  width: 6px;
  height: 6px;
  position: absolute;
  left: 24px;
  top: -2px;
  transform: rotate(45deg);
  background: var(--gold);
}

.hero p:last-child {
  max-width: 480px;
  margin: 0;
  color: var(--text);
  font: 19px/1.45 var(--font-serif);
}

.action-row {
  margin-bottom: 18px;
}

.folder-more-menu {
  position: relative;
  display: inline-block;
  z-index: 25;
}

.folder-more-menu summary {
  list-style: none;
}

.folder-more-menu summary::-webkit-details-marker {
  display: none;
}

.folder-more-menu[open] summary {
  border-color: var(--line-strong);
  color: var(--gold);
}

.folder-more-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 230px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  z-index: 80;
}

.folder-more-panel button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 10px;
  text-align: left;
}

.folder-more-panel button:not(:disabled):hover {
  border-color: var(--line-strong);
  color: var(--gold);
}

.folder-more-panel button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.breadcrumbs {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.breadcrumbs button {
  border: 0;
  background: transparent;
  color: var(--gold);
  font-weight: 700;
  padding: 5px 0;
}

.drop-zone {
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: color-mix(in srgb, var(--gold) 8%, var(--panel));
  padding: 15px 18px;
  display: none;
  gap: 4px;
  margin-bottom: 14px;
}

.drop-zone.drag {
  display: grid;
  outline: 3px solid color-mix(in srgb, var(--gold) 24%, transparent);
}

.drop-zone span,
.panel-heading p,
.public-card p { color: var(--muted); }

.floating-drop-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1700;
  width: min(286px, calc(100vw - 28px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 32%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 58%),
    color-mix(in srgb, var(--panel-strong) 96%, transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.floating-drop-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: grab;
  user-select: none;
}

.floating-drop-panel header strong {
  color: var(--gold);
}

.floating-drop-panel header button {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
}

.floating-drop-target {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 16px 16px;
  text-align: center;
  cursor: pointer;
  outline: none;
}

.floating-drop-target > strong {
  font-size: 18px;
}

.floating-drop-target > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.floating-drop-mark {
  width: 106px;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--gold) 78%, var(--line));
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  color: var(--gold);
  background:
    radial-gradient(circle, color-mix(in srgb, var(--gold) 10%, transparent), transparent 58%),
    color-mix(in srgb, var(--panel-soft) 66%, transparent);
  box-shadow: inset 0 0 22px color-mix(in srgb, var(--gold) 9%, transparent);
}

.floating-drop-mark::before,
.floating-drop-mark::after {
  content: "";
  position: absolute;
  inset: 13px;
  border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent);
  border-radius: 50%;
}

.floating-drop-mark::after {
  inset: auto;
  width: 78px;
  height: 1px;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--gold) 58%, transparent);
  box-shadow: 0 0 0 999px transparent;
}

.floating-drop-mark span {
  font: 48px var(--font-serif);
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 16px color-mix(in srgb, var(--gold) 24%, transparent);
}

.floating-drop-target.drag {
  background: color-mix(in srgb, var(--gold) 12%, transparent);
}

.floating-drop-target.drag .floating-drop-mark {
  animation: deposit-ring-breathe 1.1s ease-in-out infinite;
  box-shadow: 0 0 34px color-mix(in srgb, var(--gold) 30%, transparent), inset 0 0 20px color-mix(in srgb, var(--gold) 14%, transparent);
}

.floating-drop-panel footer {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}

.floating-drop-panel footer button {
  flex: 1;
  justify-content: center;
}

.drop-window-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 36%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.drop-window-shell {
  width: min(100%, 420px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 10px;
  transition: background .18s ease, box-shadow .18s ease;
}

.drop-window-shell.drag {
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gold) 54%, transparent);
}

.drop-window-header {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--panel-strong) 94%, transparent), color-mix(in srgb, var(--gold) 7%, var(--panel)));
  box-shadow: var(--shadow);
}

.drop-window-mark,
.drop-window-target-icon {
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--gold) 78%, var(--line));
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  color: var(--gold);
  background:
    radial-gradient(circle, color-mix(in srgb, var(--gold) 12%, transparent), transparent 60%),
    color-mix(in srgb, var(--panel-soft) 66%, transparent);
  box-shadow: inset 0 0 22px color-mix(in srgb, var(--gold) 9%, transparent);
}

.drop-window-mark {
  width: 54px;
}

.drop-window-target-icon {
  width: 76px;
}

.drop-window-mark::before,
.drop-window-mark::after,
.drop-window-target-icon::before,
.drop-window-target-icon::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  border-radius: 50%;
}

.drop-window-mark::after,
.drop-window-target-icon::after {
  inset: auto;
  width: 72%;
  height: 1px;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--gold) 58%, transparent);
}

.drop-window-mark span,
.drop-window-target-icon span {
  font-family: var(--font-serif);
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 16px color-mix(in srgb, var(--gold) 24%, transparent);
}

.drop-window-mark span {
  font-size: 30px;
}

.drop-window-target-icon span {
  font-size: 38px;
}

.drop-window-header p,
.drop-window-header h1 {
  margin: 0;
}

.drop-window-header p {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 11px;
}

.drop-window-header h1 {
  font-size: 24px;
}

.drop-window-header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.drop-window-usage {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.drop-window-usage .usage-ring {
  width: 78px;
  height: 78px;
}

.drop-window-usage .usage-ring strong {
  font-size: 24px;
}

.drop-window-usage .usage-ring span {
  font-size: 11px;
}

.drop-window-usage dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  align-items: baseline;
}

.drop-window-usage dt {
  color: var(--muted);
  font-size: 12px;
}

.drop-window-usage dd {
  margin: 0;
  font-weight: 900;
  font-size: 13px;
}

.drop-window-quota {
  margin: -3px 0 0;
  height: 8px;
}

.drop-window-target {
  min-height: 172px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px 14px;
  border: 1px dashed color-mix(in srgb, var(--gold) 54%, var(--line));
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 52%),
    var(--panel-strong);
  cursor: pointer;
  text-align: center;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.drop-window-target strong {
  font-size: 18px;
}

.drop-window-target > span {
  color: var(--muted);
  line-height: 1.35;
  font-size: 13px;
}

.drop-window-target.drag {
  border-color: var(--gold);
  box-shadow: 0 0 34px color-mix(in srgb, var(--gold) 22%, transparent);
}

.drop-window-target.drag .drop-window-target-icon {
  animation: deposit-ring-breathe 1.1s ease-in-out infinite;
}

.drop-window-actions {
  display: grid;
  grid-template-columns: repeat(2, 48px);
  justify-content: center;
  gap: 8px;
}

.drop-window-actions button {
  min-height: 44px;
  justify-content: center;
}

.icon-action-btn {
  width: 48px;
  padding: 0;
  font-size: 24px;
}

.drop-window-progress {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--gold) 14%, var(--panel-strong)), var(--panel));
  box-shadow: var(--shadow);
}

.drop-window-progress header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.drop-window-progress header strong,
.drop-window-progress header span,
.drop-window-progress header small,
.drop-window-progress header b {
  display: block;
}

.drop-window-progress header span,
.drop-window-progress header small,
.drop-window-progress p {
  color: var(--muted);
}

.drop-window-progress header b {
  text-align: right;
  color: var(--gold);
  font-size: 20px;
}

.drop-window-progress p {
  margin: 0;
}

.drop-window-meander {
  margin: 0;
}

.drop-window-file-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.drop-window-file-list .upload-item {
  margin: 0;
  background: color-mix(in srgb, var(--panel-strong) 86%, transparent);
}

.drop-window-progress.is-done {
  border-color: color-mix(in srgb, var(--green) 55%, var(--line));
}

.drop-window-progress.is-done #dropBatchEta {
  color: var(--green);
}

@media (max-width: 520px) {
  .drop-window-shell {
    padding: 12px;
  }

  .drop-window-header,
  .drop-window-usage {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .drop-window-actions {
    grid-template-columns: 1fr;
  }
}

.upload-queue {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.upload-batch {
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--gold) 18%, var(--panel-strong)), var(--panel));
  box-shadow: var(--shadow);
}

.upload-batch header,
.upload-item {
  min-width: 0;
}

.upload-batch header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 14px;
  align-items: start;
  margin-bottom: 10px;
}

.upload-batch header > div {
  min-width: 0;
}

.upload-batch header strong,
.upload-batch header span {
  display: block;
}

.upload-batch-title {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}

.upload-batch header span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: normal;
}

.upload-batch header b {
  color: var(--gold);
  font-size: 18px;
  white-space: nowrap;
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 150px;
}

.upload-batch header b small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.upload-files {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.upload-files .upload-item {
  background: color-mix(in srgb, var(--panel-strong) 72%, transparent);
  box-shadow: none;
}

.upload-batch.upload-finished {
  opacity: .82;
}

.upload-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-strong);
}

.upload-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.upload-item header div {
  min-width: 0;
}

.upload-item header strong,
.upload-item header small {
  display: block;
  overflow-wrap: anywhere;
}

.upload-item header small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.upload-item-status {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}

.upload-item-status span {
  color: var(--muted);
  font-weight: 800;
}

.upload-item-status button {
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--danger) 42%, var(--line));
  border-radius: 7px;
  padding: 0 10px;
  background: color-mix(in srgb, var(--danger) 8%, var(--panel));
  color: var(--danger);
  font-weight: 800;
}

.upload-item-status button:hover {
  background: color-mix(in srgb, var(--danger) 14%, var(--panel));
}

.upload-cancelled {
  opacity: .62;
  border-color: color-mix(in srgb, var(--danger) 36%, var(--line));
}

.progress,
.quota-bar {
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 22%, transparent);
  overflow: hidden;
  position: relative;
}

.progress span,
.quota-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
}

.quota-bar span {
  position: relative;
  z-index: 2;
}

.quota-bar.projected::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--projected);
  background: color-mix(in srgb, var(--gold-2) 42%, transparent);
  z-index: 1;
}

.quota-bar.reclaimable::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 var(--reclaimable-start);
  width: var(--reclaimable);
  min-width: 2px;
  background: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--green) 74%, var(--gold-2)) 0 7px,
    color-mix(in srgb, var(--green) 22%, transparent) 7px 13px
  );
  z-index: 3;
  opacity: .92;
}

.reclaimable-text {
  display: block;
  margin-top: 8px;
  color: var(--green);
  font-weight: 800;
}

.progress-total {
  height: 11px;
  background: color-mix(in srgb, var(--gold) 24%, var(--panel-soft));
}

.progress-total span {
  background: linear-gradient(90deg, #2f6ed4, var(--gold), var(--gold-2));
}

.upload-summary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.upload-blocked {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, var(--panel-strong));
}

.upload-blocked p {
  margin: 8px 0 0;
  color: var(--text);
  line-height: 1.45;
}

.ancient-transfer {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  width: min(360px, calc(100vw - 28px));
  border: 1px solid color-mix(in srgb, var(--gold) 58%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--gold) 12%, var(--panel-strong)), var(--panel)),
    var(--panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .24), inset 0 0 0 1px color-mix(in srgb, var(--gold) 16%, transparent);
  overflow: hidden;
}

.ancient-transfer header {
  min-height: 52px;
  padding: 10px 12px 9px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: grab;
  user-select: none;
}

.ancient-transfer header:active {
  cursor: grabbing;
}

.ancient-transfer header strong,
.ancient-transfer header span {
  display: block;
}

.ancient-transfer header strong {
  color: var(--gold);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ancient-transfer header span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.ancient-transfer header button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
}

.ancient-transfer-body {
  padding: 18px;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.deposit-circle {
  --deposit-progress: 0deg;
  width: 116px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--panel-strong) 0 56%, transparent 57%),
    conic-gradient(var(--gold-2) 0 var(--deposit-progress), color-mix(in srgb, var(--muted) 18%, transparent) var(--deposit-progress) 360deg);
  box-shadow: 0 0 26px color-mix(in srgb, var(--gold) 24%, transparent);
  animation: deposit-ring-breathe 1.9s ease-in-out infinite;
}

.deposit-circle-core {
  width: 70px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--gold) 62%, var(--line));
  background: var(--panel);
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--gold) 14%, transparent);
}

.deposit-circle-core span {
  font: 45px var(--font-serif);
  color: var(--gold);
  text-shadow: 0 0 10px color-mix(in srgb, var(--gold) 28%, transparent);
}

.ancient-transfer-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.ancient-transfer-copy span {
  color: var(--gold);
  font-weight: 900;
}

.ancient-transfer-copy strong {
  font-size: 34px;
}

.ancient-transfer-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.meander-transfer {
  height: 42px;
  margin: 0 18px 18px;
  border: 1px solid color-mix(in srgb, var(--gold) 34%, var(--line));
  border-radius: 7px;
  overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 88%, transparent), color-mix(in srgb, var(--panel-soft) 72%, transparent)),
    var(--panel);
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--gold) 8%, transparent);
}

.meander-transfer-path {
  --meander-progress: 0%;
  --meander-density: 78px;
  --meander-speed: 5.2s;
  --meander-glow: .18;
  width: var(--meander-progress);
  height: 100%;
  min-width: 0;
  background-color: color-mix(in srgb, var(--gold) 8%, transparent);
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, .32), transparent 34%, rgba(255, 255, 255, .18)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='34' viewBox='0 0 96 34'%3E%3Cpath d='M0 25H14V9H32V25H50V9H68V25H86V9H96' fill='none' stroke='%23dca53d' stroke-width='5' stroke-linejoin='round' stroke-linecap='square'/%3E%3Cpath d='M0 25H14V9H32V25H50V9H68V25H86V9H96' fill='none' stroke='%23ffd27a' stroke-width='1.6' stroke-linejoin='round' stroke-linecap='square'/%3E%3C/svg%3E");
  background-repeat: no-repeat, repeat-x;
  background-size: 100% 100%, var(--meander-density) 30px;
  background-position: 0 0, 0 50%;
  box-shadow: 0 0 calc(18px * var(--meander-glow)) color-mix(in srgb, var(--gold) 64%, transparent);
  filter: saturate(1.05);
  transition: width .32s ease, box-shadow .42s ease;
  animation: meander-flow var(--meander-speed) linear infinite;
}

.ancient-transfer.is-done .meander-transfer-path {
  animation-duration: 1.8s;
  filter: saturate(1.15) brightness(1.06);
}

.ancient-transfer.is-done .deposit-circle {
  animation: none;
  box-shadow: 0 0 34px color-mix(in srgb, var(--green) 28%, transparent);
}

.ancient-transfer.is-done .ancient-transfer-copy span {
  color: var(--green);
}

.ancient-transfer.is-error {
  border-color: color-mix(in srgb, var(--danger) 58%, var(--line));
}

.ancient-transfer.is-error .ancient-transfer-copy span,
.ancient-transfer.is-error .ancient-transfer-copy strong {
  color: var(--danger);
}

@keyframes deposit-ring-breathe {
  0%, 100% {
    filter: brightness(1);
    transform: scale(1);
  }
  50% {
    filter: brightness(1.14);
    transform: scale(1.015);
  }
}

@keyframes meander-flow {
  to {
    background-position: 0 0, var(--meander-density) 50%;
  }
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 10px;
}

.section-heading h2 {
  margin: 0;
  font: 20px var(--font-serif);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading h2 span,
.section-heading button {
  color: var(--gold);
}

.section-heading button {
  border: 0;
  background: transparent;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.folder-card {
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 15px;
  display: grid;
  align-content: space-between;
  box-shadow: var(--shadow);
}

.folder-card button {
  all: unset;
  cursor: pointer;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: start;
}

.folder-icon,
.doc-icon {
  width: 34px;
  height: 30px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #74b4ff, #347bd6);
  color: #fff;
  font-weight: 800;
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, .12);
}

.folder-card strong {
  display: block;
  font-weight: 600;
}

.folder-card small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}

.favorite-star {
  color: var(--gold);
}

.latest-heading {
  margin-top: 26px;
}

.file-list-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.sort-control {
  min-height: 33px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
}

.sort-control span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.sort-control select {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  outline: none;
}

.type-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
  margin: 14px 0 6px;
}

.type-filter,
.type-filter-reset {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
}

.type-filter {
  display: grid;
  grid-template-columns: 34px auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 8px 12px;
  text-align: left;
}

.type-filter .doc-icon {
  grid-row: 1 / 3;
  width: 30px;
  height: 32px;
}

.type-filter strong {
  font-size: 13px;
  line-height: 1.1;
}

.type-filter small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.type-filter.active {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--gold) 15%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 50%, transparent);
}

.type-filter-reset {
  padding: 0 14px;
  color: var(--gold);
}

.type-filter-reset:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.view-toggle button {
  width: 32px;
  height: 31px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
}

.view-toggle button:last-child {
  border-right: 0;
}

.view-toggle button.active {
  background: var(--panel-soft);
  color: var(--gold);
}

.table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

#tableShell table {
  min-width: 0;
  table-layout: fixed;
}

#tableShell th:nth-child(1),
#tableShell td:nth-child(1) {
  width: 46px;
}

#tableShell th:nth-child(3),
#tableShell td:nth-child(3) {
  width: 130px;
}

#tableShell th:nth-child(4),
#tableShell td:nth-child(4) {
  width: 170px;
}

#tableShell th:nth-child(5),
#tableShell td:nth-child(5) {
  width: 110px;
}

#tableShell th:nth-child(6),
#tableShell td:nth-child(6) {
  width: 58px;
}

th,
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

tbody tr:last-child td { border-bottom: 0; }

#fileList td {
  padding: 8px 12px;
}

#fileList td:nth-child(2) {
  min-width: 0;
  overflow: hidden;
}

#fileList td:nth-child(3),
#fileList td:nth-child(4),
#fileList td:nth-child(5) {
  white-space: nowrap;
}

#fileList .actions-col {
  width: 54px;
  padding-right: 10px;
}

.name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
  flex-wrap: wrap;
}

.name-cell.clickable {
  cursor: pointer;
}

.name-cell strong {
  display: block;
  font-weight: 600;
}

#fileList .name-cell {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 9px;
  row-gap: 4px;
  align-items: center;
}

#fileList .name-cell strong {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: none;
}

#fileList .name-cell .doc-icon,
#fileList .name-cell .table-folder-icon {
  grid-column: 1;
  grid-row: 1;
  flex: 0 0 auto;
}

#fileList .name-cell .photo-badges,
#fileList .file-status,
#fileList .file-annotation {
  grid-column: 2;
}

.file-status {
  margin-left: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  min-width: 0;
}

.porta-file-status {
  color: color-mix(in srgb, var(--gold) 74%, var(--muted));
}

.file-annotation {
  display: grid;
  gap: 3px;
  max-width: none;
  margin-left: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  min-width: 0;
}

.file-annotation small {
  overflow-wrap: anywhere;
}

.file-annotation a {
  width: fit-content;
  max-width: 100%;
  color: var(--gold);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.file-annotation a:hover {
  text-decoration: underline;
}

.doc-icon {
  width: 24px;
  height: 28px;
  border-radius: 4px;
  font-size: 11px;
}

.table-folder-icon {
  width: 26px;
  height: 24px;
  font-size: 12px;
}

.doc-pdf { background: linear-gradient(180deg, #ff756f, #d64943); }
.doc-xls { background: linear-gradient(180deg, #3dbd73, #18834c); }
.doc-doc { background: linear-gradient(180deg, #6fa8ff, #2f6ed4); }
.doc-ppt { background: linear-gradient(180deg, #f47d45, #c94d24); }
.doc-zip { background: linear-gradient(180deg, #f0bd5b, #b87923); }
.doc-mp4 { background: linear-gradient(180deg, #ab7df6, #7151cc); }
.doc-img { background: linear-gradient(180deg, #56c6bd, #247f88); }

.row-actions {
  justify-content: flex-end;
}

.row-actions button,
.row-actions a {
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.row-actions a.is-busy,
.ghost-btn.is-busy {
  gap: 7px;
}

.row-actions a .depositum-spinner,
.ghost-btn .depositum-spinner {
  --spinner-size: 18px;
}

.row-actions a .depositum-spinner i,
.ghost-btn .depositum-spinner i {
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  transform: rotate(calc(var(--i) * 30deg)) translateY(-7px);
}

.row-actions .danger { color: var(--danger); }
.actions-col { text-align: right; }

.file-action-menu {
  position: relative;
  display: inline-block;
}

.file-action-menu summary {
  width: 34px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  list-style: none;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.file-action-menu summary::-webkit-details-marker {
  display: none;
}

.file-action-menu[open] summary {
  border-color: var(--line-strong);
  color: var(--gold);
}

.file-action-panel {
  position: fixed;
  right: auto;
  top: 0;
  left: 0;
  z-index: 60;
  width: 176px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
}

.file-action-panel button,
.file-action-panel a {
  width: 100%;
  justify-content: flex-start;
}

.note-modal-card {
  max-width: 720px;
}

.select-col {
  width: 42px;
  text-align: center;
}

.select-col input,
.preview-select input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--gold);
}

.bulk-toolbar {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 10%, var(--panel-strong)), var(--panel-strong));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bulk-toolbar strong {
  color: var(--gold);
}

.bulk-toolbar button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

#bulkMapBtn {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  color: var(--green);
  background: color-mix(in srgb, var(--green) 8%, var(--panel-strong));
}

.selected-row td {
  background: color-mix(in srgb, var(--gold) 9%, transparent);
}

.empty-state { color: var(--muted); text-align: center; padding: 34px; }

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.preview-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 12px;
  min-width: 0;
  box-shadow: var(--shadow);
  position: relative;
}

.preview-card.selected-card {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--gold) 9%, var(--panel));
}

.preview-select {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel-strong) 90%, transparent);
  display: grid;
  place-items: center;
}

.preview-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 10px;
}

.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-thumb .folder-icon,
.preview-thumb .doc-icon {
  transform: scale(1.6);
}

.preview-card strong,
.preview-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-card strong {
  white-space: nowrap;
  font-weight: 700;
}

.preview-card strong .photo-badges {
  margin-left: 0;
  margin-top: 5px;
}

.preview-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, .72);
  padding: 28px;
  display: grid;
  place-items: center;
}

.preview-modal-card {
  width: min(1100px, 100%);
  max-height: calc(100vh - 56px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.conflict-modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 56px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.preview-modal-card header,
.conflict-modal-card header {
  min-height: 52px;
  padding: 0 14px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.preview-modal-card header strong,
.conflict-modal-card header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conflict-body {
  padding: 18px;
  overflow: auto;
  display: grid;
  gap: 14px;
}

.conflict-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.conflict-body select,
.conflict-body input {
  max-width: none;
  width: 100%;
}

.conflict-list {
  display: grid;
  gap: 8px;
}

.conflict-list article {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.conflict-list strong,
.conflict-list span {
  display: block;
  overflow-wrap: anywhere;
}

.conflict-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.conflict-more {
  padding: 0 4px;
}

.conflict-modal-card footer {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.conflict-modal-card footer button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
}

.conflict-modal-card footer .danger {
  color: var(--danger);
}

.transfer-folder-list {
  max-height: 230px;
  overflow: auto;
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-soft) 72%, transparent);
}

.transfer-folder-list button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 10px 7px calc(10px + (var(--depth) * 16px));
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 9px;
  align-items: center;
  text-align: left;
}

.transfer-folder-list button:hover,
.transfer-folder-list button.active {
  border-color: var(--line-strong);
  background: var(--panel-strong);
}

.transfer-folder-list span {
  color: var(--gold);
}

.transfer-folder-list small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.transfer-path-preview {
  margin: -2px 0 0;
  color: var(--gold);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.transfer-progress {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 12%, var(--panel-strong)), var(--panel-strong));
}

.transfer-progress.transfer-done {
  border-color: color-mix(in srgb, var(--green) 48%, var(--line-strong));
  background: linear-gradient(135deg, color-mix(in srgb, var(--green) 12%, var(--panel-strong)), var(--panel-strong));
}

.transfer-progress.transfer-done .transfer-progress-head span,
.transfer-progress.transfer-done strong {
  color: var(--green);
}

.transfer-progress.transfer-error {
  border-color: color-mix(in srgb, var(--danger) 52%, var(--line-strong));
}

.transfer-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.transfer-progress-head strong {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.transfer-progress-head span {
  color: var(--gold);
  font-weight: 900;
}

.speed-graph,
.transfer-speed-graph {
  height: 46px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--panel-soft) 68%, transparent);
  display: grid;
  grid-template-columns: repeat(28, minmax(2px, 1fr));
  align-items: end;
  gap: 6px;
  overflow: hidden;
}

.speed-graph i,
.transfer-speed-graph i {
  width: clamp(2px, 44%, 6px);
  justify-self: center;
  min-height: 2px;
  height: var(--h);
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold-2) 82%, #fff), var(--gold));
  box-shadow: 0 0 5px color-mix(in srgb, var(--gold) 22%, transparent);
  opacity: .72;
  transform-origin: bottom;
  transition: height .42s ease, opacity .42s ease, box-shadow .42s ease, transform .42s ease;
  transform: translateX(0);
}

.speed-graph i.is-idle,
.transfer-speed-graph i.is-idle {
  opacity: .26;
  box-shadow: none;
}

.speed-graph i.is-current,
.transfer-speed-graph i.is-current {
  opacity: .9;
  box-shadow: 0 0 7px color-mix(in srgb, var(--gold) 28%, transparent);
}

.upload-speed-graph {
  margin-top: 10px;
  height: 38px;
}

.transfer-progress small {
  color: var(--muted);
}

.preview-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.preview-modal-card header button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  font-size: 24px;
  line-height: 1;
}

.preview-modal-card header button:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.map-controls button {
  width: auto;
  min-width: 44px;
  padding: 0 12px;
}

.map-controls #mapLayerBtn {
  min-width: 92px;
}

.preview-body {
  min-height: 240px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .16);
  overflow: auto;
}

.preview-body img,
.preview-body video {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  display: block;
}

.pdf-preview-frame {
  width: min(100%, 1040px);
  height: calc(100vh - 124px);
  border: 0;
  background: #fff;
  display: block;
}

.document-preview {
  width: min(820px, 100%);
  min-height: min(920px, calc(100vh - 180px));
  margin: 24px;
  padding: clamp(24px, 4vw, 54px);
  background: #fffdf8;
  color: #172233;
  border: 1px solid #e3d7c4;
  border-radius: 6px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .22);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.72;
}

.document-preview p {
  margin: 0 0 1em;
  white-space: pre-wrap;
}

.document-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.1em 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.35;
}

.document-preview td {
  border: 1px solid #d8c9b4;
  padding: 8px 10px;
  vertical-align: top;
}

.document-preview-note,
.document-preview-loading {
  width: min(720px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: var(--shadow);
}

.document-preview-note {
  display: grid;
  gap: 16px;
  justify-items: start;
}

.document-preview-note p {
  margin: 0;
}

.document-preview-muted {
  color: #657084;
}

.photo-badges {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin-left: 8px;
  vertical-align: middle;
}

.photo-badge {
  min-height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 7px;
  background: color-mix(in srgb, var(--gold) 10%, var(--panel));
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
}

.gps-badge {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 48%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--panel));
}

.panorama-viewer {
  width: 100%;
  height: min(68vh, 620px);
  min-height: 360px;
  position: relative;
  cursor: grab;
  background-repeat: repeat-x;
  background-size: auto 100%;
  background-position: 50% 50%;
  overflow: hidden;
  user-select: none;
}

.panorama-viewer:active { cursor: grabbing; }

.panorama-viewer span {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  color: #fff;
  background: rgba(0,0,0,.44);
  font-weight: 800;
  pointer-events: none;
}

.map-modal-card { width: min(1180px, 100%); }

.map-body {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  background: var(--panel-soft);
}

.photo-map {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  background: #d9dccf;
}

.map-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  user-select: none;
  pointer-events: none;
}

.map-marker {
  position: absolute;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(0,0,0,.28);
  font-size: 12px;
  font-weight: 900;
}

.map-marker.panorama-marker { background: var(--gold); }

.map-list {
  border-left: 1px solid var(--line);
  background: var(--panel);
  overflow: auto;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.map-list button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  text-align: left;
  background: var(--panel-strong);
  color: var(--text);
}

.map-list button:hover { border-color: var(--line-strong); }

.map-list strong,
.map-list span { display: block; }

.map-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.right-rail {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
}

.usage-card,
.activity-card,
.share-card,
.account-grid section,
.public-card,
.empty-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.usage-card,
.activity-card {
  padding: 18px;
  min-width: 0;
  overflow: hidden;
}

.usage-card h2,
.activity-card h2 {
  margin: 0 0 22px;
  color: var(--text);
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 600;
}

.usage-body {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.usage-ring {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  background: conic-gradient(
    var(--gold) 0 var(--reclaimable-start, var(--usage)),
    color-mix(in srgb, var(--green) 70%, var(--gold-2)) var(--reclaimable-start, var(--usage)) var(--usage),
    color-mix(in srgb, var(--gold-2) 46%, transparent) var(--usage) var(--projected, var(--usage)),
    color-mix(in srgb, var(--muted) 22%, transparent) 0
  );
  position: relative;
}

.usage-ring::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--panel-strong);
}

.usage-ring strong,
.usage-ring span {
  position: relative;
  z-index: 1;
  display: block;
}

.usage-ring strong {
  font: 28px var(--font-serif);
}

.usage-ring span {
  color: var(--muted);
  font-size: 12px;
}

.usage-body dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.usage-body dt {
  color: var(--muted);
  font-size: 13px;
}

.usage-body dd {
  margin: -5px 0 8px;
  font-size: 16px;
  white-space: nowrap;
}

.usage-card .quota-bar {
  margin: 22px 0 18px;
}

.manage-btn {
  width: 100%;
  color: var(--gold);
  border-color: var(--line-strong);
  min-width: 0;
  white-space: normal;
  overflow: hidden;
  justify-content: center;
  line-height: 1.2;
}

.activity-list {
  display: grid;
  gap: 0;
}

.activity-item {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

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

.activity-item strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.activity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.solo-view {
  max-width: 980px;
  padding-top: 40px;
}

.users-view {
  max-width: 1180px;
}

#systemInfoView {
  max-width: 1120px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0 0 7px;
  font: 34px var(--font-serif);
}

.share-list {
  display: grid;
  gap: 12px;
}

.porta-list {
  margin-bottom: 18px;
}

.list-subheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.list-subheading h3 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
}

.server-storage-panel {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 22px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow);
}

.server-storage-chart {
  width: 168px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--panel-strong) 0 54%, transparent 55%),
    conic-gradient(
      var(--gold) 0 var(--used),
      color-mix(in srgb, #4e8bff 72%, var(--gold)) var(--used) var(--reserved),
      color-mix(in srgb, var(--muted) 22%, transparent) var(--reserved) 100%
    );
  box-shadow: inset 0 0 0 1px var(--line);
}

.server-storage-chart.over-reserved {
  background:
    radial-gradient(circle at center, var(--panel-strong) 0 54%, transparent 55%),
    conic-gradient(
      var(--gold) 0 var(--used),
      color-mix(in srgb, #4e8bff 72%, var(--gold)) var(--used) 100%
    );
  box-shadow: inset 0 0 0 1px var(--line), 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent);
}

.server-storage-chart strong,
.server-storage-chart span {
  grid-area: 1 / 1;
}

.server-storage-chart strong {
  font-size: 34px;
  transform: translateY(-8px);
}

.server-storage-chart span {
  color: var(--muted);
  transform: translateY(24px);
  font-size: 13px;
}

.server-storage-details h3 {
  margin: 0 0 14px;
  font-size: 21px;
}

.server-storage-details dl {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px 18px;
  margin: 0 0 14px;
}

.server-storage-details dt {
  color: var(--muted);
}

.server-storage-details dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.server-storage-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  position: relative;
  padding-left: 42px;
}

.server-storage-note::before {
  content: "";
  position: absolute;
  left: 0;
  top: .42em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 18px 0 0 color-mix(in srgb, #4e8bff 72%, var(--gold));
}

.server-storage-note.warning {
  color: var(--danger);
  font-weight: 700;
}

.porta-card.stopped {
  opacity: .68;
}

.share-card {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.admin-table-shell {
  background: var(--panel-strong);
}

.admin-create-user {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
  display: grid;
  gap: 16px;
}

.admin-create-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-create-header .ghost-btn {
  flex: 0 0 auto;
}

.admin-create-user.is-collapsed {
  padding: 18px 22px;
}

.admin-create-user.is-collapsed .admin-create-user-form {
  display: none;
}

.admin-create-user h3,
.admin-create-user p {
  margin: 0;
}

.admin-create-user p {
  color: var(--muted);
  line-height: 1.45;
}

.admin-create-user-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.admin-create-user-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.admin-create-user-form input,
.admin-create-user-form select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 11px;
  background: var(--panel);
  color: var(--text);
}

.admin-create-user-form .switch-row {
  align-self: end;
  min-height: 42px;
}

.password-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.password-toggle {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
}

.password-rules {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.password-rules span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--panel);
}

.password-rules span.ok {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green) 9%, var(--panel));
}

.password-match-message {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.password-match-message.success {
  color: var(--green);
}

input.input-error {
  border-color: color-mix(in srgb, var(--danger) 70%, var(--line)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent);
}

.admin-create-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#adminCreateUserMessage {
  grid-column: 1 / -1;
}

.first-login-badge {
  display: block;
  margin: 8px 0 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.users-table {
  min-width: 1080px;
}

.user-cell {
  display: grid;
  gap: 7px;
}

.user-cell strong {
  font-weight: 700;
}

.user-cell span,
.mini-usage small {
  color: var(--muted);
  font-size: 13px;
}

.blocked-user {
  opacity: .68;
}

.switch-label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.switch-label input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--gold);
}

.admin-email-input,
.role-select {
  width: min(100%, 280px);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: var(--panel);
  color: var(--text);
}

.role-select {
  margin-top: 10px;
  width: min(100%, 210px);
}

.role-select.admin-role {
  border-color: color-mix(in srgb, var(--danger) 58%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, var(--panel));
  color: color-mix(in srgb, var(--danger) 86%, var(--text));
  font-weight: 800;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--danger) 82%, var(--gold));
}

.unsaved-user-row td {
  background: color-mix(in srgb, var(--green) 4%, transparent);
}

.row-actions .save-pulse {
  border-color: color-mix(in srgb, var(--green) 72%, var(--line));
  color: color-mix(in srgb, var(--green) 82%, var(--text));
  background: color-mix(in srgb, var(--green) 10%, var(--panel));
  animation: save-pulse-glow 1.2s ease-in-out infinite;
}

@keyframes save-pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 30%, transparent);
  }
  50% {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 0%, transparent),
      0 0 18px color-mix(in srgb, var(--green) 26%, transparent);
  }
}

.quota-input {
  width: 92px;
  min-height: 36px;
}

.mini-usage {
  min-width: 170px;
  display: grid;
  gap: 6px;
}

.mini-usage span,
.mini-usage small {
  display: block;
}

.mini-usage b,
.mini-usage i {
  display: block;
  height: 6px;
  border-radius: 999px;
}

.mini-usage b {
  background: color-mix(in srgb, var(--muted) 20%, transparent);
  overflow: hidden;
}

.mini-usage i {
  max-width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
}

.share-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.share-url {
  color: var(--gold);
  overflow-wrap: anywhere;
}

.testimonium-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-strong) 72%, transparent);
  display: grid;
  gap: 10px;
}

.testimonium-box > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.testimonium-box > div strong {
  color: var(--gold);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.testimonium-box > div span,
.testimonium-box dt {
  color: var(--muted);
  font-size: 12px;
}

.testimonium-box dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 12px;
}

.testimonium-box dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.empty-card {
  padding: 24px;
  color: var(--muted);
}

.trash-view {
  display: none;
  gap: 16px;
}

.trash-view.active {
  display: grid;
}

.trash-settings-card,
.trash-summary-card,
.trash-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.trash-settings-card {
  padding: 22px;
  display: grid;
  gap: 16px;
}

.trash-settings-card h3,
.trash-settings-card p {
  margin: 0;
}

.trash-settings-card p {
  color: var(--muted);
  line-height: 1.45;
}

.switch-row {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 800;
}

.switch-row input {
  width: 19px;
  min-height: 19px;
  accent-color: var(--gold);
}

.trash-days-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
  max-width: 280px;
}

.trash-days-label input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--text);
}

.trash-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.trash-summary-card {
  padding: 18px 22px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.trash-summary-card div {
  display: grid;
  gap: 4px;
}

.trash-summary-card span,
.trash-item span,
.trash-item small {
  color: var(--muted);
}

.trash-summary-card strong {
  font-size: 24px;
}

.trash-list {
  display: grid;
  gap: 10px;
}

.trash-item {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.trash-item > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.trash-item strong,
.trash-item small {
  overflow-wrap: anywhere;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.account-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 22px;
}

.account-grid h2,
.admin-notifications h3 {
  margin: 0 0 16px;
  font-size: 20px;
}

.account-form {
  display: grid;
  gap: 14px;
}

.account-avatar-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}

.account-avatar-large {
  width: 88px;
  height: 88px;
  font-size: 42px;
}

.account-avatar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.account-avatar-actions small {
  flex-basis: 100%;
  color: var(--muted);
  line-height: 1.4;
}

.camera-modal-card {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.camera-modal-card header,
.camera-modal-card footer {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.camera-modal-card footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.camera-modal-card header button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
}

.camera-stage {
  position: relative;
  min-height: 320px;
  background: #05080c;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.camera-stage video,
.camera-stage canvas {
  width: 100%;
  max-height: min(62vh, 560px);
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.camera-reticle {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.camera-reticle::before {
  content: "";
  width: min(54%, 310px);
  aspect-ratio: .74;
  border: 2px solid color-mix(in srgb, var(--gold) 82%, #fff);
  border-radius: 50% 50% 45% 45%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .22), 0 0 24px color-mix(in srgb, var(--gold) 26%, transparent);
}

.camera-reticle span {
  position: absolute;
  width: min(68%, 390px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
}

.camera-reticle span::before,
.camera-reticle span::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, .24);
}

.camera-reticle span::before {
  left: 50%;
  top: 10%;
  bottom: 10%;
  width: 1px;
}

.camera-reticle span::after {
  top: 50%;
  left: 10%;
  right: 10%;
  height: 1px;
}

.camera-modal-card .form-message {
  padding: 0 18px;
  margin-top: 12px;
}

.account-form .ghost-btn,
.account-form .primary-btn {
  justify-self: start;
  padding: 0 16px;
}

.account-quota {
  margin-top: 20px;
  display: grid;
  gap: 8px;
}

.account-quota small,
.notification-card small {
  color: var(--muted);
}

.system-info {
  display: grid;
  gap: 16px;
}

.system-info section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 22px;
  box-shadow: var(--shadow);
}

.system-info h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.system-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.system-info p + p {
  margin-top: 10px;
}

.system-info ul,
.system-info ol {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.65;
}

.system-info li + li {
  margin-top: 6px;
}

.system-version-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content)) 1fr;
  gap: 18px 34px;
  align-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 14%, var(--panel-strong)), var(--panel-strong)) !important;
  border-color: var(--line-strong) !important;
}

.system-version-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.system-version-card strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}

.system-version-card p {
  color: var(--text);
  font-weight: 700;
}

.system-changelog {
  display: grid;
  gap: 12px;
}

.system-changelog article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--panel-soft) 70%, transparent);
}

.system-changelog header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.system-changelog header span {
  color: var(--muted);
  white-space: nowrap;
}

.danger-zone {
  border-color: color-mix(in srgb, var(--danger) 44%, var(--line)) !important;
}

.danger-zone p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.danger-action {
  min-height: 42px;
  border: 1px solid color-mix(in srgb, var(--danger) 55%, var(--line));
  border-radius: 7px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--danger) 10%, var(--panel));
  color: var(--danger);
  font-weight: 800;
}

.admin-notifications {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 10%, var(--panel-strong)), var(--panel-strong));
  display: grid;
  gap: 12px;
}

.notification-heading,
.notification-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.notification-heading h3 {
  margin-bottom: 0;
}

.notification-heading span {
  color: var(--gold);
  font-weight: 800;
}

.notification-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.notification-card strong {
  display: block;
}

.notification-card p {
  margin: 6px 0;
  color: var(--text);
}

dl {
  margin: 0;
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
}

dt { color: var(--muted); }
dd { margin: 0; font-weight: 700; }

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-panel {
  min-height: calc(100vh - 26px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: 30px;
  align-items: center;
}

.auth-brand {
  display: grid;
  place-items: center;
}

.auth-brand img {
  width: min(560px, 100%);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-form {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 7px;
  background: var(--panel-soft);
}

.segmented button {
  border: 0;
  border-radius: 6px;
  min-height: 38px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: var(--panel-strong);
  color: var(--text);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 44px;
  padding: 0 12px;
  background: color-mix(in srgb, var(--panel-strong) 70%, transparent);
  color: var(--text);
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 132px;
  padding: 12px;
  resize: vertical;
  background: color-mix(in srgb, var(--panel-strong) 70%, transparent);
  color: var(--text);
  font: inherit;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.form-message.success {
  color: var(--green);
}

.help-tooltip {
  position: fixed;
  z-index: 2000;
  width: min(360px, calc(100vw - 24px));
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-strong) 94%, transparent);
  color: var(--text);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .2);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.help-tooltip::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-left: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
}

.help-tooltip p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.help-tooltip button {
  min-height: 30px;
  margin-top: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  color: var(--gold);
  padding: 0 10px;
  font-weight: 800;
}

.public-body {
  min-height: 100vh;
}

.public-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 26px;
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.public-header .brand {
  min-height: 100px;
}

.public-header .brand-logo {
  width: 190px;
  height: 100px;
}

.public-card {
  padding: 38px;
}

.porta-card-public {
  display: grid;
  gap: 18px;
}

.public-card h1 {
  margin: 0 0 10px;
  font: 46px var(--font-serif);
}

.public-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0 6px;
}

.public-actions .disabled {
  opacity: .48;
  pointer-events: none;
}

.public-selected-count {
  color: var(--muted);
  font-weight: 700;
  padding: 0 4px;
}

.porta-picker {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
}

.porta-drop-zone {
  display: grid;
  margin: 0;
}

.public-list {
  margin-top: 24px;
  display: grid;
  gap: 10px;
}

.public-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.public-item.selectable {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}

.public-item.selectable.has-thumb {
  grid-template-columns: 28px auto minmax(0, 1fr) auto;
}

.public-select {
  display: grid;
  place-items: center;
}

.public-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}

.public-item-copy {
  min-width: 0;
}

.public-item.has-preview .public-item-copy {
  cursor: pointer;
}

.public-item.has-preview .public-item-copy:hover strong {
  color: var(--gold);
}

.public-item-copy:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--gold) 62%, transparent);
  outline-offset: 4px;
  border-radius: 5px;
}

.public-item .public-thumb + div {
  grid-column: auto;
}

.public-item strong {
  display: block;
  margin-bottom: 4px;
}

.public-item span {
  color: var(--muted);
}

.public-thumb {
  width: 88px;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0;
  overflow: hidden;
  background: var(--panel-strong);
}

.public-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.public-row-actions {
  justify-content: flex-end;
}

@media (max-width: 1180px) {
  .dashboard-grid.active {
    grid-template-columns: 1fr;
  }

  .right-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .folder-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    min-height: 112px;
  }

  .brand-logo {
    height: 118px;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-section,
  .secure-note {
    display: none;
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .action-row,
  .share-card,
  .public-item {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .search-box {
    width: 100%;
  }

  h1 {
    font-size: 39px;
  }

  .hero {
    min-height: 230px;
    align-items: start;
  }

  .hero::before {
    width: 260px;
    height: 230px;
    top: 30px;
    opacity: .35;
  }

  .roman-mark {
    display: none;
  }

  .folder-grid,
  .right-rail,
  .account-grid,
  .auth-panel,
  .system-version-card {
    grid-template-columns: 1fr;
  }

  .usage-body {
    grid-template-columns: 1fr;
  }

  .upload-batch header {
    grid-template-columns: 1fr;
  }

  .server-storage-panel {
    grid-template-columns: 1fr;
  }

  .server-storage-chart {
    justify-self: center;
  }

  .upload-batch header b {
    justify-items: start;
    min-width: 0;
  }
}
