:root {
  --bg: #004888;
  --card: #141418;
  --panel: #1a1a20;
  --panel-border: #2a2a34;
  --text: #f4f2f6;
  --muted: #8b8794;
  --accent: #ff2d8a;
  --accent-end: #ff4d6d;
  --accent-glow: rgba(255, 45, 138, 0.4);
  --success: #3ddc84;
  --cyan: #00d4ff;
  --orange: #ff8c42;
  --radius-card: 20px;
  --radius-panel: 16px;
  --radius-btn: 12px;
  --font: "Inter", system-ui, sans-serif;
  --font-pixel: "DS Pixel Cyr", monospace;
  --alpha-checker-light: #e6e6e6;
  --alpha-checker-dark: #cccccc;
  --alpha-checker-size: 14px;
  --fasces-half-height: 175px;
  --upload-chrome-offset: 6.5rem;
}

@font-face {
  font-family: "DS Pixel Cyr";
  src: url("/static/fonts/ds-pixel-cyr-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

.page {
  min-height: 100vh;
  padding: 1.5rem 1rem 3rem;
}

.brand {
  max-width: 1280px;
  margin: 0 auto 1.25rem;
  padding: 0 0.5rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.brand-logo-img {
  display: block;
  width: auto;
  height: 96px;
  max-width: min(380px, 90vw);
}

@media (max-width: 900px) {
  .brand-logo-img {
    height: 80px;
    max-width: min(320px, 88vw);
  }
}

.shell {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.28fr);
  grid-template-rows: 528px;
  align-items: stretch;
  width: 100%;
  max-width: 1248px;
  height: 528px;
  max-height: 528px;
  margin: 0 auto;
  background: #1c1c22;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.65);
}

.card-art {
  position: relative;
  min-height: 0;
  height: 100%;
  background: #101014;
  overflow: hidden;
}

.card-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% center;
  display: block;
}

.card-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 528px;
  overflow: hidden;
  padding: 1.5rem 1.5rem 1.5rem 1.15rem;
  background: #1a1a20;
}

.card-panel-results,
.card-panel-upload {
  padding-top: 1.5rem;
}

.panel-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  padding: 1.5rem 1.35rem 1.35rem;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: #24242c;
}

.panel-screen {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.panel-screen[hidden] {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.list-scroll {
  flex: 1 1 0;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0.35rem 0 1rem;
  padding-right: 0.35rem;
  -webkit-overflow-scrolling: touch;
}

.list-scroll::-webkit-scrollbar {
  width: 6px;
}

.list-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

.panel {
  width: 100%;
}

.panel-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
}

.panel-title.inline {
  text-align: left;
  font-size: 1.35rem;
  font-weight: 700;
}

.panel-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.panel-hint {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
}

.upload-status {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 45, 138, 0.12);
  color: var(--accent);
  font-size: 0.85rem;
  text-align: center;
}

.upload-status[hidden] {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.panel-hint code {
  color: var(--accent);
  font-size: 0.85em;
}

.upload-status.is-error {
  background: rgba(255, 68, 68, 0.12);
  color: #ff6b6b;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.panel-head-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.panel-head-left .panel-title.inline {
  margin: 0;
}

.panel-meta {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #4a4a54;
  color: #e4e2ea;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
}

.dropzone {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-panel);
  background: #1e1e26;
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 1.5rem;
}

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

.dropzone.dragover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 40px var(--accent-glow);
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: radial-gradient(circle at 30% 30%, var(--accent), #a020f0);
  box-shadow: 0 0 32px var(--accent-glow);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.panel-actions-secondary {
  margin-top: 0.75rem;
}

.btn {
  flex: 1 1 8rem;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.12s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-end) 100%);
  box-shadow: 0 8px 28px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-outline {
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-small {
  flex: 0 0 auto;
  padding: 0.55rem 0.85rem;
  font-size: 0.8rem;
}

.btn-icon {
  flex-shrink: 0;
}

.file-list,
.queue-list,
.links-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-list[hidden],
.panel-actions[hidden],
#after-upload-actions[hidden] {
  display: none !important;
}

.queue-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: start;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.queue-item:last-child {
  border-bottom: none;
}

.ext-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #0a0a0c;
  flex-shrink: 0;
}

.ext-badge.jpg,
.ext-badge.jpeg {
  background: var(--accent);
}

.ext-badge.png {
  background: var(--cyan);
}

.ext-badge.gif,
.ext-badge.webp {
  background: var(--orange);
}

.ext-badge.mp4 {
  background: #6c5ce7;
  color: #fff;
}

.ext-badge.default {
  background: #6b6b78;
  color: #fff;
}

.queue-body {
  min-width: 0;
}

.queue-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-size {
  font-size: 0.78rem;
  color: var(--muted);
}

.progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  margin-top: 0.4rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-end));
  border-radius: 2px;
  transition: width 0.15s;
}

.progress-fill.done {
  background: var(--success);
}

.queue-status {
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 4.5rem;
  text-align: right;
}

.queue-status.done {
  color: var(--success);
}

.queue-remove {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #7a7585;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.queue-remove:hover {
  color: #b8b3c0;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.queue-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
  min-width: 4.25rem;
}

.queue-copy {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 45, 138, 0.42);
  background: rgba(255, 45, 138, 0.14);
  color: #ff4d7a;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.queue-copy:hover {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 77, 122, 0.55) 0%, rgba(233, 30, 99, 0.5) 100%);
  border-color: rgba(255, 77, 138, 0.75);
  box-shadow: 0 0 14px rgba(255, 45, 138, 0.28);
}

.queue-copy-icon {
  display: block;
  stroke: currentColor;
}

.queue-item-link {
  grid-template-columns: 52px minmax(0, 1fr) auto;
  column-gap: 0.85rem;
}

.queue-item-link .queue-name {
  cursor: default;
}

.queue-item-link .queue-name:hover {
  color: inherit;
}

.queue-item-album .queue-copy {
  background: rgba(255, 45, 138, 0.22);
  border-color: rgba(255, 45, 138, 0.55);
}

.queue-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e65a4;
}

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

.queue-thumb .ext-badge {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  font-size: 0.68rem;
}

.panel-head-queue {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
}

.panel-head-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.panel-head-top .panel-title.inline {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.panel-head-top .badge {
  flex-shrink: 0;
  min-width: 1.75rem;
  height: 1.75rem;
  border-radius: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e8e6ee;
  font-size: 0.8rem;
}

.panel-weight-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.panel-weight-label {
  font-size: 0.72rem;
  color: var(--muted);
}

.panel-weight-value {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.queue-progress-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.4rem;
}

.queue-progress-row .progress-bar {
  flex: 1;
  margin: 0;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.queue-progress-row .progress-fill {
  border-radius: 999px;
  background: linear-gradient(90deg, #ff4d7a, #e91e63);
}

.queue-progress-pct {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 2.4rem;
  text-align: right;
  flex-shrink: 0;
}

.queue-done-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.queue-done-icon {
  color: var(--success);
  font-size: 0.85rem;
  line-height: 1;
}

.queue-done-text {
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 500;
}

.queue-error-row {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: #ff6b6b;
}

.queue-link {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.queue-link:hover {
  color: #fff;
}

.queue-item-empty {
  grid-template-columns: 1fr;
}

.queue-item-empty .queue-name {
  color: var(--muted);
  font-weight: 400;
}

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

.panel-screen .panel-head {
  flex-shrink: 0;
  margin-bottom: 0.35rem;
}

.panel-screen .panel-actions {
  flex-shrink: 0;
  margin-top: auto;
}

.panel-screen .panel-hint {
  flex-shrink: 0;
  margin-top: auto;
}

#panel-select .dropzone {
  flex-shrink: 0;
}

#panel-select .panel-actions {
  margin-top: 0;
}

#panel-select .panel-hint {
  margin-top: 0.75rem;
}

.upload-select-head {
  display: none;
}

.btn-label-full {
  display: none;
}

.btn-label-short {
  display: inline;
}

.links-list li {
  padding: 0.55rem 0;
  border-bottom: none;
}

.links-list a {
  color: #f0eef3;
  font-size: 0.92rem;
  font-weight: 400;
  word-break: break-all;
  text-decoration: none;
  line-height: 1.4;
}

.links-list a:hover {
  color: #fff;
}

.link-row {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
}

.link-field {
  flex: 1;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text);
  padding: 0.65rem 0.75rem;
  font-family: inherit;
  font-size: 0.85rem;
}

.media-frame {
  border-radius: var(--radius-panel);
  overflow: hidden;
  background: #000;
  margin: 0.75rem 0 0;
}

.media-frame img,
.media-frame video {
  display: block;
  width: 100%;
  max-height: 42vh;
  object-fit: contain;
}

.media-frame iframe {
  width: 100%;
  height: 50vh;
  border: none;
}

.media-frame audio {
  display: block;
  width: 100%;
  padding: 1rem;
}

.media-frame-empty {
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
}

.file-title {
  text-align: left;
  word-break: break-word;
}

.file-meta-line {
  text-align: left;
  margin-bottom: 0.5rem;
}

.toast {
  position: fixed;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0));
  left: 50%;
  transform: translateX(-50%);
  background: #0080ff;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 17px;
  z-index: 300;
  box-shadow: 0 8px 24px rgba(0, 48, 96, 0.32);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: transform, opacity;
  contain: layout style paint;
}

.toast.is-visible {
  visibility: visible;
  animation: toast-show 0.26s ease-out forwards;
}

.toast.is-visible.is-leaving {
  animation: toast-hide 0.2s ease-in forwards;
}

@keyframes toast-show {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes toast-hide {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.98);
  }
}

.toast[hidden] {
  display: none !important;
}

/* ——— Страница просмотра файла ——— */
.body-file {
  background: var(--bg);
}

.shell-file {
  max-width: 1020px;
}

.file-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.file-promo {
  --promo-radius: 0.875rem;
  background: var(--card);
  border: 1px solid var(--panel-border);
  border-radius: var(--promo-radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  max-width: 100%;
  padding: 0;
}

.file-promo-banner-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
}

.file-promo-text {
  padding: 1.35rem 1.5rem 1.5rem;
  text-align: center;
}

.file-promo-html p {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #e8e6ec;
}

.file-promo-html p:last-child {
  margin-bottom: 0;
}

.file-promo-html a {
  color: #ff4da8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.file-promo-html a:hover {
  color: #ff7fc4;
}

.file-promo-html ul,
.file-promo-html ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  text-align: left;
  display: inline-block;
}

.file-showcase {
  margin-bottom: 1rem;
  max-width: 100%;
  min-width: 0;
}

.file-showcase-frame {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
  line-height: 0;
  max-width: 100%;
  min-width: 0;
}

.file-showcase-frame-image {
  background-color: var(--bg);
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 16px 16px;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
}

.file-showcase-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  vertical-align: top;
  background: transparent;
}

.file-showcase-iframe {
  width: 100%;
  height: 70vh;
  border: none;
  display: block;
}

.file-showcase-fallback,
.file-showcase-frame-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  line-height: 1.5;
  color: var(--muted);
  background: #0a0a0c;
}

.file-showcase-meta {
  margin: 0.5rem 0 1rem;
  font-size: 0.85rem;
}

.file-gps-overlay {
  position: absolute;
  left: 10px;
  bottom: 10px;
  right: auto;
  max-width: min(92%, 320px);
  padding: 0.5rem 0.65rem;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 4px;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.file-gps-overlay p {
  margin: 0 0 0.15rem;
  font-size: 0.68rem;
  color: #1a1a1a;
  text-shadow: none;
}

.file-gps-overlay p:last-child {
  margin-bottom: 0;
}

.file-gps-label {
  font-weight: 600;
}

.file-gps-desc {
  margin-top: 0.35rem !important;
}

.file-page-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 2rem;
}

.btn-compact {
  flex: 0 0 auto;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
}

/* ——— Авторизация ——— */
.body-login {
  background: #004888;
}

.page-login {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  min-height: 96px;
  padding: 12px 60px;
}

.login-header .login-brand-logo {
  height: 112px;
  max-width: min(220px, 90vw);
  width: auto;
}

.page-login .brand {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 4px 60px;
  min-height: 68px;
  align-self: flex-start;
}

.login-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  padding: 0 60px 3rem;
  margin-top: -16px;
}

.login-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 426px;
  flex-shrink: 0;
}

.login-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding: 26px 0;
  gap: 20px;
  border-radius: 20px;
}

.login-title {
  margin: 0;
  font-family: var(--font-pixel);
  font-style: normal;
  font-weight: 400;
  font-size: 32px;
  line-height: 36px;
  text-align: center;
  color: #f3eef9;
}

.login-error {
  margin: -8px 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(255, 77, 109, 0.15);
  color: #ffb4c4;
  font-size: 14px;
  line-height: 17px;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-field {
  box-sizing: border-box;
  position: relative;
  display: block;
  height: 49px;
  border-radius: 10px;
  background: #3b79b0;
  cursor: text;
}

.login-field-float .login-field-label {
  position: absolute;
  left: 16px;
  right: 16px;
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  transform-origin: left top;
  transition: top 0.15s ease, transform 0.15s ease, font-size 0.15s ease, line-height 0.15s ease, color 0.15s ease;
}

.login-field-float:not(:focus-within):has(.login-field-input:placeholder-shown) .login-field-label {
  top: 50%;
  transform: translateY(-50%);
}

.login-field-float:focus-within .login-field-label,
.login-field-float:has(.login-field-input:not(:placeholder-shown)) .login-field-label {
  top: 8px;
  transform: none;
  font-size: 10px;
  line-height: 12px;
  color: #fff;
}

.login-field-input {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 8px;
  height: 17px;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
}

.login-field-float:not(:focus-within):has(.login-field-input:placeholder-shown) .login-field-input {
  opacity: 0;
}

.login-field-input::placeholder {
  color: transparent;
}

.login-field-input:focus {
  outline: none;
  opacity: 1;
}

.login-field-password .login-field-input {
  right: 40px;
}

.login-field-password .login-password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: color 0.15s;
}

.login-password-toggle:hover {
  color: rgba(255, 255, 255, 0.85);
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: color 0.15s;
}

.password-toggle:hover {
  color: rgba(255, 255, 255, 0.7);
}

.password-toggle-icon {
  display: block;
}

.password-toggle .password-toggle-hide {
  display: none;
}

.password-toggle.is-password-visible .password-toggle-show {
  display: none;
}

.password-toggle.is-password-visible .password-toggle-hide {
  display: block;
}

.password-toggle-icon[hidden] {
  display: none;
}

.login-welcome {
  display: block;
  width: 100%;
  max-width: 426px;
  height: auto;
  margin: 0 auto 2rem;
}

.btn-login {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 49px;
  padding: 16px 24px;
  border: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  font-weight: 600;
  color: #fff;
  background: #0080ff;
  cursor: pointer;
  transition: filter 0.15s;
  flex: 0 0 auto;
}

.btn-login:hover:not(:disabled) {
  filter: brightness(1.08);
}

@media (max-width: 900px) {
  .login-fasces {
    display: none;
  }

  .login-shell {
    padding: 0 1.25rem 2.5rem;
    margin-top: 0;
  }

  .login-header {
    padding: 12px 1.25rem;
  }

  .login-header .login-brand-logo {
    height: 88px;
    max-width: min(180px, 88vw);
  }

  .login-title {
    font-size: clamp(22px, 6vw, 32px);
    line-height: 1.15;
  }

  .page-login .brand {
    padding: 4px 1.25rem;
  }
}

.field-input {
  width: 100%;
  padding: 1rem 1.1rem;
  border: none;
  border-radius: 14px;
  background: rgba(26, 34, 82, 0.85);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  box-sizing: border-box;
}

.field-input::placeholder {
  color: #6f6a78;
}

.field-input:focus {
  outline: 2px solid rgba(42, 98, 255, 0.55);
  outline-offset: 0;
}

/* ——— Загрузка фото ——— */
.page-upload {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 2rem 0;
  flex-wrap: wrap;
}

.site-header-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  margin-left: auto;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
}

.site-nav-link {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s;
}

.site-nav-link:hover {
  color: #fff;
}

.site-nav-link.is-active {
  color: #fff;
}

.site-nav-link-muted {
  opacity: 0.55;
  pointer-events: none;
}

.site-nav-profile-form {
  margin: 0;
}

a.site-nav-profile {
  text-decoration: none;
}

.site-nav-profile {
  display: flex;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  opacity: 0.9;
  transition: opacity 0.15s, filter 0.15s;
}

.site-nav-profile-icon {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.site-nav-profile.is-active .site-nav-profile-icon {
  filter: brightness(1.15) drop-shadow(0 0 6px rgba(184, 217, 255, 0.45));
}

.site-nav-profile:hover {
  opacity: 1;
}

.upload-shell {
  flex: 1;
  display: grid;
  grid-template-columns: auto minmax(0, min(calc(100vw - 2rem), 650px)) auto;
  justify-content: center;
  align-items: center;
  gap: 0;
  min-height: calc(100vh - var(--upload-chrome-offset));
  padding: 0 2vw 2rem;
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

.upload-fasces,
.public-fasces {
  position: sticky;
  top: calc(50vh - var(--fasces-half-height));
  align-self: center;
  flex: 0 0 auto;
  width: clamp(90px, 11vw, 180px);
  height: clamp(220px, 42vh, 460px);
  object-fit: contain;
  object-position: center;
  user-select: none;
  pointer-events: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.body-upload-home .upload-fasces-left,
.body-note-create .upload-fasces-left,
.body-results .upload-fasces-left,
.body-profile .upload-fasces-left {
  margin-right: clamp(1rem, 5.9vw, 85px);
}

.body-upload-home .upload-fasces-right,
.body-note-create .upload-fasces-right,
.body-results .upload-fasces-right,
.body-profile .upload-fasces-right {
  margin-left: clamp(1rem, 5.9vw, 85px);
}

.body-public-file .public-fasces-left,
.body-public-album .public-fasces-left {
  margin-right: clamp(1rem, 3.1vw, 45px);
}

.body-public-file .public-fasces-right,
.body-public-album .public-fasces-right {
  margin-left: clamp(1rem, 3.1vw, 45px);
}

.login-fasces {
  flex-shrink: 0;
  width: 150px;
  height: 350px;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.upload-stage {
  grid-column: 2;
  width: 100%;
  position: relative;
  z-index: 2;
  align-self: center;
}

/* Создание записки — по макету Figma (1440×766) */
.body-note-create .upload-shell {
  justify-content: center;
  padding-bottom: 2rem;
}

.body-note-create .upload-fasces {
  height: 350px;
  width: auto;
  max-width: 150px;
}

/* Загрузка файлов — Figma (1440×766) */
.body-upload-home .upload-shell {
  justify-content: center;
  padding-bottom: 2rem;
}

.body-upload-home .upload-fasces {
  height: 350px;
  width: auto;
  max-width: 150px;
}

.body-upload-home .upload-stage {
  width: min(calc(100vw - 2rem), 650px);
  flex: 0 0 min(calc(100vw - 2rem), 650px);
  align-items: stretch;
}

.body-upload-home .upload-stage .panel-screen {
  flex: 0 0 auto;
  min-height: auto;
  max-height: none;
  overflow: visible;
}

#panel-select .upload-card {
  height: 554px;
  min-height: 400px;
  padding: 40px 32px;
  gap: 40px;
  border-radius: 12px;
  box-shadow: none;
  justify-content: center;
}

#panel-select .upload-cat {
  width: 212px;
  height: 212px;
  margin: 0;
  flex-shrink: 0;
}

#panel-select .upload-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 305px;
  pointer-events: none;
}

#panel-select .upload-title {
  margin: 0;
  font-size: 32px;
  line-height: 36px;
  letter-spacing: 0;
  text-transform: none;
  color: #fff;
}

#panel-select .upload-hint {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  color: #fff;
  max-width: none;
}

#panel-select .upload-hint-formats {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 15px;
  color: rgba(255, 255, 255, 0.65);
}

#panel-select .btn-upload-select {
  width: auto;
  min-width: 147px;
  height: 49px;
  padding: 16px 24px;
  border-radius: 10px;
  background: #0080ff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 17px;
  flex: none;
}

#panel-select .btn-upload-select:hover:not(:disabled) {
  background: #1a8cff;
  transform: none;
}

.upload-stage {
  width: 50vw;
  flex: 0 0 50vw;
  max-width: none;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.upload-stage:has(.upload-card-queue) {
  width: min(calc(100vw - 2rem), 650px);
  flex: 0 0 min(calc(100vw - 2rem), 650px);
  align-items: stretch;
}

.upload-stage:has(.upload-card-profile) {
  width: min(48vw, 480px);
  flex: 0 0 min(48vw, 480px);
}

.upload-stage:has(.profile-card) {
  width: min(calc(100vw - 2rem), 650px);
  flex: 0 0 min(calc(100vw - 2rem), 650px);
}

.upload-stage:has(.history-card) {
  width: min(calc(100vw - 2rem), 650px);
  flex: 0 0 min(calc(100vw - 2rem), 650px);
  align-items: stretch;
}

.upload-stage:has(.upload-card-history) {
  width: min(calc(100vw - 2rem), 650px);
  flex: 0 0 min(calc(100vw - 2rem), 650px);
}

.upload-stage:has(.panel-note) {
  width: min(calc(100vw - 2rem), 650px);
  flex: 0 0 min(calc(100vw - 2rem), 650px);
}

.upload-stage:has(.panel-note) .panel-note {
  flex: 0 0 auto;
  min-height: auto;
  max-height: none;
  overflow: visible;
}

.upload-card {
  background: #0a589c;
  border-radius: 28px;
  padding: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 4vw, 3.5rem) clamp(2rem, 4vw, 3rem);
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: box-shadow 0.2s;
  width: 100%;
  min-height: clamp(420px, 48vh, 554px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.upload-card.dragover,
.upload-card-queue.dragover {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28), 0 16px 48px rgba(0, 0, 0, 0.22);
}

.upload-cat {
  display: block;
  width: auto;
  height: clamp(160px, 22vh, 260px);
  margin: 0 auto clamp(1.25rem, 2.5vh, 2rem);
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

.upload-title {
  margin: 0 0 clamp(1rem, 2vh, 1.5rem);
  font-family: var(--font-pixel);
  font-size: clamp(1.75rem, 3.2vw, 2.85rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: #fff;
  pointer-events: none;
  text-transform: uppercase;
}

.upload-hint {
  margin: 0 0 clamp(1.5rem, 3vh, 2.25rem);
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.5;
  pointer-events: none;
  max-width: 36ch;
}

.btn-upload-select {
  width: 100%;
  max-width: 100%;
  padding: clamp(0.95rem, 1.5vh, 1.15rem) 1.5rem;
  border-radius: 16px;
  border: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  background: #1a7fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  flex: 1 1 auto;
}

.btn-upload-select:hover:not(:disabled) {
  background: #3390ff;
  transform: translateY(-1px);
}

.btn-upload-select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-upload-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.9rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex: 1 1 auto;
}

.btn-upload-outline:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.upload-album-link {
  display: block;
  width: 100%;
  margin: 1rem auto 0;
  padding: 0;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  font: inherit;
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  text-align: center;
}

.upload-album-link:hover {
  color: rgba(255, 255, 255, 0.85);
}

.upload-card-queue {
  box-sizing: border-box;
  width: 100%;
  max-width: 650px;
  height: 554px;
  min-height: 400px;
  padding: 32px;
  background: #0a589c;
  border-radius: 20px;
  box-shadow: none;
  text-align: left;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  overflow: visible;
}

.upload-card.dragover,
.upload-card.dragover *,
.upload-card-queue.dragover,
.upload-card-queue.dragover *,
.panel-queue.dragover,
.panel-queue.dragover * {
  cursor: copy !important;
}

.upload-card-queue.dragover .queue-drop-hint {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.queue-title {
  margin: 0;
  padding: 0;
  font-family: var(--font-pixel);
  font-size: 20px;
  line-height: 22px;
  font-weight: 400;
  letter-spacing: 0;
  color: #f3eef9;
  text-transform: none;
  flex-shrink: 0;
}

.queue-toolbar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
}

.queue-field {
  flex: 0 1 360px;
  min-width: 0;
  max-width: 360px;
}

.queue-date {
  width: 100%;
  height: 41px;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  box-sizing: border-box;
  color-scheme: dark;
}

.queue-date::-webkit-calendar-picker-indicator {
  filter: brightness(0) invert(1);
  cursor: pointer;
  opacity: 0.95;
}

.queue-select-wrap {
  position: relative;
  width: 100%;
}

.queue-select-trigger {
  width: 100%;
  height: 41px;
  padding: 12px 16px 12px 12px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  box-sizing: border-box;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  transition: background 0.15s;
}

.queue-select-trigger:hover {
  background: rgba(255, 255, 255, 0.26);
}

.queue-select-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.28);
}

.queue-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-select-chevron {
  flex-shrink: 0;
  width: 8px;
  height: 4px;
  margin-left: auto;
  margin-top: -3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4' viewBox='0 0 8 4'%3E%3Cpath d='M1 1l3 2 3-2' stroke='%23ffffff' stroke-width='1' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.15s;
}

.queue-select-trigger[aria-expanded="true"] .queue-select-chevron {
  transform: rotate(180deg);
}

.queue-select-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #083a65;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  z-index: 20;
  max-height: 240px;
  overflow-y: auto;
}

.queue-select-list[hidden] {
  display: none !important;
}

.queue-select-option {
  padding: 10px 12px;
  border-radius: 6px;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  cursor: pointer;
  user-select: none;
}

.queue-select-option:hover,
.queue-select-option.is-focused {
  background: rgba(255, 255, 255, 0.12);
}

.queue-select-option.is-selected {
  background: rgba(0, 128, 255, 0.32);
}

.queue-drop-hint {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px dashed rgba(255, 255, 255, 0.32);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
}

.queue-drop-hint kbd {
  display: inline-block;
  margin: 0 1px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.18);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.3;
  color: #fff;
}

.queue-date {
  margin-top: 8px;
  height: auto;
}

.queue-date[hidden] {
  display: none;
}

.queue-password-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  min-width: 0;
  height: 41px;
  padding: 0 12px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  white-space: nowrap;
}

.queue-password-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.queue-password-btn.is-set {
  color: #b8d9ff;
}

.queue-mp-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  height: 41px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.queue-mp-label input {
  margin: 0;
  accent-color: #7eb8ff;
}

.queue-list-scroll {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.upload-card-queue .queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.upload-card-queue .queue-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  min-height: 52px;
  padding: 0;
  border: none;
}

.upload-card-queue .queue-thumb {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #1e65a4;
  overflow: hidden;
  box-sizing: border-box;
}

.upload-card-queue .queue-thumb .ext-badge {
  width: 100%;
  height: 100%;
  border-radius: 5px;
  font-size: 0.68rem;
}

.upload-card-queue .queue-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  background: transparent;
}

.upload-card-queue .queue-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 52px;
}

.upload-card-queue .queue-body::after {
  content: "";
  display: block;
  flex: 0 0 15px;
  min-height: 15px;
  margin-top: auto;
}

.upload-card-queue .queue-body:has(.queue-progress-wrap)::after,
.upload-card-queue .queue-body:has(.queue-done-row)::after,
.upload-card-queue .queue-body:has(.queue-error-row)::after {
  display: none;
}

.upload-card-queue .queue-name {
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  font-weight: 400;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-card-queue .queue-size {
  font-family: var(--font);
  font-size: 11px;
  line-height: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.upload-card-queue .queue-progress-wrap {
  width: 100%;
  flex: 0 0 15px;
  min-height: 15px;
  margin-top: auto;
}

.upload-card-queue .queue-progress-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  margin-top: 0;
}

.upload-card-queue .progress-bar {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 6px;
  margin: 0;
  border-radius: 200px;
  background: #083a65;
  overflow: hidden;
}

.upload-card-queue .progress-fill {
  border-radius: 190px;
  background: #0080ff;
  max-width: 100%;
}

.upload-card-queue .queue-item-side {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
  min-width: 24px;
}

.upload-card-queue .queue-progress-pct {
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  font-family: var(--font);
  font-size: 11px;
  line-height: 13px;
  color: #fff;
  text-align: right;
}

.upload-card-queue .queue-done-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 15px;
  min-height: 15px;
  margin-top: auto;
}

.upload-card-queue .queue-error-row {
  flex: 0 0 15px;
  min-height: 15px;
  margin-top: auto;
}

.upload-card-queue .queue-done-text {
  font-family: var(--font);
  font-size: 10px;
  line-height: 12px;
  font-weight: 400;
  color: #11d331;
}

.upload-card-queue .queue-remove {
  width: 24px;
  height: 24px;
  border-radius: 100px;
  border: none;
  background: #3b79b0;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.upload-card-queue .queue-remove:hover {
  background: #4588bf;
  color: #fff;
}

.queue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  flex-shrink: 0;
  margin-top: auto;
  padding: 10px;
  background: #083a65;
  border-radius: 12px;
  border-top: none;
}

.queue-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.queue-stats-label {
  font-family: var(--font);
  font-size: 10px;
  line-height: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.queue-stats-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.queue-stats-item {
  font-family: var(--font);
  font-size: 11px;
  line-height: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.queue-stats-item strong {
  font-size: 12px;
  line-height: 15px;
  font-weight: 700;
  color: #fff;
}

.queue-footer-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.queue-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 41px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 17px;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.queue-btn-secondary {
  background: #1e65a4;
}

.queue-btn-secondary:hover:not(:disabled) {
  background: #2270b3;
}

.queue-btn-primary {
  background: #0080ff;
}

.queue-btn-primary:hover:not(:disabled) {
  background: #1a8cff;
}

.queue-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.upload-card-results {
  box-sizing: border-box;
  width: 100%;
  max-width: 650px;
  height: 637px;
  min-height: min(400px, calc(100vh - 8rem));
  padding: 32px;
  background: #0a589c;
  border-radius: 20px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 16px;
  overflow: hidden;
  cursor: default;
  text-align: left;
}

.results-head,
.results-content,
.results-footer {
  width: 100%;
  align-self: stretch;
  box-sizing: border-box;
}
.body-results .upload-shell {
  justify-content: center;
  padding-bottom: 2rem;
}

.body-results .upload-fasces {
  height: 350px;
  width: auto;
  max-width: 150px;
}

.body-results .upload-stage {
  width: min(calc(100vw - 2rem), 650px);
  flex: 0 0 min(calc(100vw - 2rem), 650px);
  align-items: stretch;
}

.body-results .upload-stage .panel-screen {
  flex: 0 0 auto;
  min-height: auto;
  max-height: none;
  overflow: visible;
}

.upload-stage:has(.upload-card-results) {
  width: min(calc(100vw - 2rem), 650px);
  flex: 0 0 min(calc(100vw - 2rem), 650px);
  align-items: stretch;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.page-head-row,
.results-head-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 1 auto;
}

.history-head-row {
  width: 100%;
  flex-shrink: 0;
}

.back-btn,
.results-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 100px;
  background: #3b79b0;
  color: #fff;
  text-decoration: none;
  transition: background 0.15s;
}

.back-btn:hover,
.results-back-btn:hover {
  background: #4588bf;
}

.back-btn-icon,
.results-back-icon {
  display: block;
}

.results-title {
  margin: 0;
  padding: 0;
  font-family: var(--font-pixel);
  font-size: 20px;
  line-height: 22px;
  font-weight: 400;
  color: #f3eef9;
  text-transform: none;
  letter-spacing: 0;
  flex: 0 1 auto;
}

.results-format {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 4px 4px 4px 8px;
  gap: 8px;
  background: #1e65a4;
  border-radius: 6px;
  flex: 0 1 auto;
}

.results-format-label {
  font-family: var(--font);
  font-size: 12px;
  line-height: 14px;
  font-weight: 400;
  color: #fff;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.format-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

.format-switch-btn {
  border: none;
  background: #3b79b0;
  color: #fff;
  font-family: var(--font);
  font-size: 10px;
  line-height: 12px;
  font-weight: 400;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1px transparent;
  transition: background 0.15s, box-shadow 0.15s;
}

.format-switch-btn + .format-switch-btn {
  margin-left: 0;
}

.format-switch-btn.is-active {
  background: #3b79b0;
  box-shadow: inset 0 0 0 1px #fff;
  color: #fff;
}

.format-switch-btn:hover:not(.is-active) {
  background: #4588bf;
  color: #fff;
}

.results-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.results-meta {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  padding: 0;
}

.results-meta-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1 1 0;
}

.results-meta-label {
  font-family: var(--font);
  font-size: 10px;
  line-height: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.results-meta-value {
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  font-weight: 400;
  color: #fff;
  word-break: break-word;
}

.results-divider {
  width: 100%;
  height: 0;
  margin: 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.results-batch {
  padding: 0;
  flex-shrink: 0;
}

.results-batch-label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font);
  font-size: 10px;
  line-height: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.results-meta,
.results-batch,
.results-divider {
  width: 100%;
}

.results-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.results-link-text {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.results-link-text:hover {
  color: #b8d9ff;
}

.results-link-text-static {
  cursor: default;
  pointer-events: none;
}

.results-link-text-static:hover {
  color: #fff;
}

.results-link-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.results-link-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 40px;
  padding: 0 14px;
  border-radius: 100px;
  background: #3b79b0;
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.results-link-open:hover {
  background: #4588bf;
  color: #fff;
}

.results-link-copy {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 100px;
  border: none;
  background: #3b79b0;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}

.results-link-copy:hover {
  background: #4588bf;
}

.results-link-copy svg {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.results-copy-icon,
.results-btn-icon {
  display: block;
  flex-shrink: 0;
}

.results-list-scroll {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.results-list-toolbar {
  width: 100%;
  flex-shrink: 0;
}

.results-copy-all-btn {
  width: 100%;
  min-height: 44px;
}

.upload-card-results .list-scroll {
  margin: 0;
  padding: 0;
  padding-right: 0;
}

.results-links-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.results-links-list .results-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: none;
}

.results-link-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.results-link-item .queue-thumb {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #1e65a4;
  overflow: hidden;
  box-sizing: border-box;
}

.results-link-item .queue-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.results-link-body {
  flex: 1 1 auto;
  min-width: 0;
}

.results-link-body .results-link-text {
  display: block;
}

.results-link-item .results-link-actions {
  flex-shrink: 0;
}

.results-link-item .results-link-copy {
  flex-shrink: 0;
}

.results-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  margin-top: auto;
  padding: 10px;
  background: #1e65a4;
  border-radius: 12px;
  border-top: none;
}

.results-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 0 4px;
}

.results-stats-label {
  font-family: var(--font);
  font-size: 10px;
  line-height: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.results-stats-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.results-stats-item {
  font-family: var(--font);
  font-size: 11px;
  line-height: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.results-stats-item strong {
  font-size: 12px;
  line-height: 15px;
  font-weight: 700;
  color: #fff;
}

.results-footer-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.results-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  height: 41px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 17px;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.results-btn-secondary {
  background: #3b79b0;
}

.results-btn-secondary:hover:not(:disabled) {
  background: #4588bf;
}

.results-btn-primary {
  background: #0080ff;
}

.results-btn-primary:hover:not(:disabled) {
  background: #1a8cff;
}

.body-profile .upload-card.upload-card-profile {
  min-height: unset;
  height: auto;
  padding: 2rem 2.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  text-align: left;
  align-items: stretch;
  justify-content: flex-start;
  cursor: default;
  position: relative;
  z-index: 1;
}

/* Профиль — Figma (1440×766) */
.body-profile .upload-shell {
  justify-content: center;
  padding-bottom: 2rem;
}

.body-profile .upload-fasces {
  height: 350px;
  width: auto;
  max-width: 150px;
}

.profile-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 650px;
  height: 273px;
  padding: 32px;
  background: #0a589c;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  cursor: default;
}

.profile-card-title {
  margin: 0 auto;
  width: 100%;
  max-width: 331px;
  font-family: var(--font-pixel);
  font-size: 20px;
  line-height: 22px;
  font-weight: 400;
  color: #f3eef9;
  text-align: center;
  flex-shrink: 0;
}

.profile-history-link {
  margin: 0 auto;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  font-weight: 400;
  text-decoration: none;
  flex-shrink: 0;
}

.profile-history-link:hover {
  color: #b8d9ff;
}

.profile-settings {
  align-self: stretch;
  width: 100%;
  max-width: 586px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex-shrink: 0;
}

.profile-security {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  margin: 0;
  padding: 0;
  border: 0;
}

.profile-settings-link {
  display: inline-flex;
  align-items: center;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  font-weight: 400;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.profile-settings-link:hover {
  color: #b8d9ff;
}

.upload-card-profile {
  width: 100%;
  max-width: none;
}

.profile-menu-link {
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  font-weight: 400;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.profile-menu-link:hover {
  color: #b8d9ff;
}

.profile-divider {
  width: 100%;
  height: 0;
  margin: 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.profile-logout-form {
  margin: 0;
}

.profile-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: none;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  font-weight: 400;
  cursor: pointer;
  padding: 8px 0;
}

.profile-logout-btn:hover {
  color: #b8d9ff;
}

.profile-logout-btn svg {
  flex-shrink: 0;
}

.history-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 650px;
  min-height: 554px;
  height: 554px;
  padding: 32px;
  background: #0a589c;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  cursor: default;
}

.history-card-title {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 20px;
  line-height: 22px;
  font-weight: 400;
  color: #f3eef9;
  flex-shrink: 0;
}

.history-list {
  width: 100%;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
}

.history-head,
.history-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  width: 100%;
}

.history-row-fields {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  min-width: 0;
}

.history-row-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.history-row {
  min-height: 24px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s;
}

.history-row:hover {
  opacity: 0.88;
}

.history-col-id {
  width: 64px;
  flex-shrink: 0;
}

.history-col-time {
  width: 64px;
  flex-shrink: 0;
}

.history-col-date {
  width: 100px;
  flex-shrink: 0;
}

.history-col-count {
  width: 64px;
  flex-shrink: 0;
}

.history-col-action {
  width: 24px;
  flex-shrink: 0;
}

.history-head .history-col {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  line-height: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.history-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.history-row .history-col {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 17px;
  color: #fff;
}

.history-empty {
  margin: 0;
  padding: 1rem 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
}

.history-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 100px;
  background: #3b79b0;
}

.history-open-btn::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  transform: translateX(-1.5px) rotate(-45deg);
}

.history-back-row {
  width: 100%;
  margin: 0 0 16px;
}

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: auto;
  padding-top: 24px;
  flex-shrink: 0;
}

.history-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
}

.history-page-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.history-page-btn.is-active {
  background: #3b79b0;
  font-weight: 600;
}

.history-page-btn.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.history-page-btn-nav {
  min-width: 32px;
  font-size: 18px;
  line-height: 1;
}

.upload-card-history {
  width: 100%;
  max-width: 650px;
}

.profile-history-title {
  margin: 0 0 1.25rem;
}

.history-table-wrap {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.history-table th {
  text-align: left;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0 0.75rem 0.85rem 0;
  font-weight: 500;
}

.history-table td {
  padding: 0.85rem 0.75rem 0.85rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.profile-back-row {
  margin-top: 1.5rem;
}

.modal-card-profile {
  max-width: 420px;
}

.modal-overlay-profile,
.modal-overlay-twofa {
  background: rgba(0, 24, 55, 0.72);
}

.modal-card-password {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 426px;
  max-width: calc(100vw - 2rem);
  min-height: 354px;
  padding: 16px;
  border-radius: 12px;
  background: #0a589c;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.modal-card-password:not(:has(#password-totp)) {
  min-height: 297px;
}

.profile-modal-head {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 22px;
  margin-bottom: 11px;
}

.profile-modal-title {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 20px;
  line-height: 22px;
  font-weight: 400;
  color: #f3eef9;
}

.profile-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.profile-modal-close-icon {
  position: relative;
  display: block;
  width: 8px;
  height: 8px;
}

.profile-modal-close-icon::before,
.profile-modal-close-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 0;
  border-top: 1px solid #fff;
  transform-origin: center;
}

.profile-modal-close-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.profile-modal-close-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.profile-modal-error {
  margin: 0 0 8px;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  color: #ff9db5;
}

.profile-password-fields {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.profile-password-field {
  display: block;
  width: 100%;
}

.profile-password-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 49px;
  padding: 16px;
  gap: 8px;
  border-radius: 10px;
  background: #3b79b0;
}

.profile-password-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
}

.profile-password-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.profile-password-input:focus {
  outline: none;
}

.profile-password-input-code {
  text-align: center;
  letter-spacing: 0.35em;
  font-weight: 600;
}

.profile-password-input-code::placeholder {
  letter-spacing: normal;
  font-weight: 400;
}

.profile-password-toggle {
  position: static;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  padding: 0;
  color: rgba(255, 255, 255, 0.6);
}

.profile-password-toggle:hover {
  color: rgba(255, 255, 255, 0.85);
}

.profile-modal-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: auto;
  padding-top: 16px;
}

.profile-modal-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 49px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 17px;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.profile-modal-btn-cancel {
  background: #1e65a4;
}

.profile-modal-btn-cancel:hover {
  background: #2874b8;
}

.profile-modal-btn-save {
  background: #0080ff;
}

.profile-modal-btn-save:hover {
  background: #006fd9;
}

.modal-card-twofa {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 426px;
  max-width: calc(100vw - 2rem);
  min-height: 378px;
  padding: 16px;
  border-radius: 8px;
  background: #0a589c;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.twofa-modal-head {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 22px;
  margin-bottom: 13px;
}

.twofa-modal-title {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 20px;
  line-height: 22px;
  font-weight: 400;
  color: #f3eef9;
}

.twofa-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.twofa-modal-close-icon {
  position: relative;
  display: block;
  width: 8px;
  height: 8px;
}

.twofa-modal-close-icon::before,
.twofa-modal-close-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 0;
  border-top: 1px solid #fff;
  transform-origin: center;
}

.twofa-modal-close-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.twofa-modal-close-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.twofa-modal-sub {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  font-weight: 400;
  color: #fff;
}

.twofa-modal-error {
  margin: 12px 0 0;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  color: #ff9db5;
}

.twofa-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 24px;
}

.twofa-qr-frame {
  display: inline-block;
  padding: 16px;
  background: #fff;
  border-radius: 4px;
  line-height: 0;
}

.twofa-qr {
  display: block;
  width: 158px;
  height: 158px;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

.twofa-secret-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  margin-top: 12px;
}

.twofa-secret {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  font-weight: 400;
  color: #fff;
  text-align: center;
  word-break: break-all;
}

.twofa-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 100px;
  background: #3b79b0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.twofa-copy-btn:hover {
  background: #4a88bf;
}

.twofa-code-field {
  display: block;
  width: 100%;
  margin-top: 16px;
}

.twofa-code-input {
  display: block;
  width: 100%;
  height: 49px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: #1e65a4;
  color: #fff;
  font-family: var(--font);
  font-size: 20px;
  font-weight: 600;
  line-height: 49px;
  letter-spacing: 0.4em;
  text-align: center;
  box-sizing: border-box;
  appearance: none;
  transition: background 0.15s, box-shadow 0.15s;
}

.twofa-code-input::placeholder {
  color: #fff;
  opacity: 0.35;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.twofa-code-input:focus {
  outline: none;
  background: #3b79b0;
  box-shadow: 0 0 0 2px rgba(0, 128, 255, 0.45);
}

.twofa-modal-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: auto;
  padding-top: 24px;
}

.twofa-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 49px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 17px;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.twofa-btn-cancel {
  background: #1e65a4;
}

.twofa-btn-cancel:hover {
  background: #2874b8;
}

.twofa-btn-save {
  background: #0080ff;
}

.twofa-btn-save:hover {
  background: #006fd9;
}

@media (max-width: 480px) {
  .modal-card-twofa {
    width: 100%;
    min-height: auto;
    padding: 16px 14px;
  }

  .twofa-code-input {
    font-size: 18px;
    letter-spacing: 0.3em;
  }
}

.twofa-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

@media (max-width: 720px) {
  .body-results .upload-stage,
  .upload-stage:has(.upload-card-results) {
    width: 100%;
    max-width: min(calc(100vw - 2rem), 650px);
  }

  .body-results .upload-fasces {
    display: none;
  }

  .upload-card-results {
    height: auto;
    min-height: min(637px, calc(100vh - 8rem));
    padding: 24px 20px;
  }

  .results-head {
    flex-direction: column;
    align-items: stretch;
  }

  .results-format {
    width: 100%;
    flex-wrap: wrap;
  }

  .format-switch {
    flex-wrap: wrap;
  }

  .results-meta {
    flex-direction: column;
  }

  .results-footer {
    flex-wrap: wrap;
  }

  .results-footer-actions {
    width: 100%;
    justify-content: stretch;
  }

  .results-btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 24, 55, 0.72);
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-overlay-page {
  position: fixed;
  background: var(--bg);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 2rem 1.75rem 1.75rem;
  border-radius: 22px;
  background: #005fa8;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.modal-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-pixel);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #fff;
  text-transform: uppercase;
}

.modal-sub {
  margin: 0 0 1.25rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

.modal-error {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: #ff9db5;
}

.modal-field {
  display: block;
  margin-bottom: 0.75rem;
}

.modal-field-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
}

.modal-field-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 0.75rem 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(0, 40, 80, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-field-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
}

.modal-field-input:focus {
  outline: none;
}

.modal-password-toggle {
  position: static;
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.modal-actions .btn {
  flex: 1;
}

.body-upload .upload-status {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

.body-upload .upload-status.is-error {
  color: #ff9db5;
}

@media (max-width: 900px) {
  .upload-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .upload-stage,
  .upload-stage:has(.upload-card-queue),
  .upload-stage:has(.upload-card-profile),
  .upload-stage:has(.profile-card),
  .upload-stage:has(.history-card),
  .upload-stage:has(.upload-card-history),
  .upload-stage:has(.panel-note),
  .upload-stage:has(.upload-card-results),
  .body-upload-home .upload-stage,
  .body-results .upload-stage {
    grid-column: 1;
    width: 100%;
    max-width: min(calc(100vw - 2rem), 650px);
    flex: 1 1 auto;
  }

  .upload-fasces {
    display: none;
  }

  .body-public-file .public-stage,
  .body-public-album .public-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .body-public-file .public-content,
  .body-public-album .public-content {
    grid-column: 1;
  }

  .site-header {
    padding: 0.5rem 1rem 0;
  }

  .site-nav-link-muted {
    display: none;
  }

  .upload-shell {
    padding: 1rem 1rem 2rem;
  }

  .upload-stage:has(.upload-card-queue),
  .upload-stage:has(.upload-card-profile),
  .upload-stage:has(.profile-card),
  .upload-stage:has(.history-card),
  .upload-stage:has(.upload-card-history),
  .upload-stage:has(.panel-note),
  .body-upload-home .upload-stage {
    width: 100%;
    max-width: min(calc(100vw - 2rem), 650px);
  }

  .body-upload-home .upload-fasces {
    display: none;
  }

  #panel-select .upload-card {
    height: auto;
    min-height: 400px;
    padding: 32px 24px;
    gap: 28px;
  }

  #panel-select .upload-cat {
    width: clamp(140px, 40vw, 212px);
    height: clamp(140px, 40vw, 212px);
  }

  #panel-select .upload-title {
    font-size: clamp(24px, 7vw, 32px);
    line-height: 1.125;
  }

  .upload-stage:has(.upload-card-profile) {
    width: 100%;
    max-width: min(calc(100vw - 2rem), 480px);
  }

  .upload-stage:has(.profile-card) {
    width: 100%;
    max-width: min(calc(100vw - 2rem), 650px);
  }

  .body-profile .upload-fasces {
    display: none;
  }

  .history-card {
    height: auto;
    min-height: min(554px, calc(100vh - 8rem));
    padding: 24px 20px;
  }

  .history-col-date {
    width: auto;
    min-width: 72px;
  }

  .upload-stage:has(.history-card) {
    width: 100%;
    max-width: min(calc(100vw - 2rem), 650px);
  }

  .profile-card {
    height: auto;
    min-height: 273px;
    gap: 1.5rem;
    justify-content: flex-start;
  }

  .upload-stage:has(.upload-card-history) {
    width: 100%;
    max-width: min(calc(100vw - 2rem), 650px);
  }

  .upload-stage:has(.upload-card-queue) {
    width: 100%;
    max-width: min(calc(100vw - 2rem), 650px);
  }

  .upload-card-queue {
    height: auto;
    min-height: min(554px, calc(100vh - 8rem));
    padding: 24px 20px;
    gap: 12px;
  }

  .queue-toolbar {
    flex-wrap: wrap;
  }

  .queue-field {
    flex: 1 1 100%;
    max-width: none;
  }

  .queue-footer {
    flex-wrap: wrap;
  }

  .queue-footer-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .upload-stage:has(.panel-note) {
    width: min(92vw, 650px);
  }

  .note-card {
    height: auto;
    min-height: 480px;
    max-height: min(520px, calc(100vh - 8rem));
  }

  .body-note-create .upload-fasces {
    display: none;
  }

  .upload-cat {
    height: clamp(130px, 28vw, 180px);
  }

  .upload-card {
    min-height: 0;
    padding: 2.25rem 1.75rem 2rem;
  }

  .upload-title {
    font-size: clamp(1.45rem, 7vw, 2rem);
  }
}

.brand-with-logout,
.brand-admin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logout-form {
  margin: 0;
}

/* ——— Админка ——— */
.body-admin {
  background: var(--bg);
}

.body-admin .site-header {
  justify-content: space-between;
}

.admin-logout-form {
  margin: 0;
}

.upload-shell-admin {
  align-items: flex-start;
}

.admin-stage {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.admin-shell {
  width: 100%;
}

.admin-page-title {
  margin: 0 0 1.25rem;
  font-family: var(--font-pixel);
  font-size: 20px;
  line-height: 22px;
  font-weight: 400;
  color: #f3eef9;
  text-align: center;
}

.shell-admin {
  max-width: 1020px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  background: rgba(10, 88, 156, 0.55);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  text-decoration: none;
  transition: background 0.15s;
}

.admin-tab:hover {
  background: rgba(10, 88, 156, 0.85);
}

.admin-tab.is-active {
  background: #0a589c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.admin-card {
  box-sizing: border-box;
  width: 100%;
  padding: 32px;
  background: #0a589c;
  border-radius: 12px;
}

.admin-card-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-pixel);
  font-size: 20px;
  line-height: 22px;
  font-weight: 400;
  color: #f3eef9;
}

.admin-panel {
  background: #0a589c;
  border-radius: 12px;
  padding: 32px;
}

.admin-title {
  margin: 0 0 1rem;
  font-family: var(--font-pixel);
  font-size: 20px;
  line-height: 22px;
  color: #f3eef9;
}

.admin-subtitle {
  margin: 0 0 0.75rem;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.admin-hint {
  margin: 0 0 1.25rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.45;
}

.admin-hint code {
  font-size: 0.85em;
  color: #b8d9ff;
}

.admin-form-block {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-form-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-field-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 49px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: #3b79b0;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
}

.admin-field-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.admin-field-select {
  width: auto;
  min-width: 11rem;
  flex: 0 0 auto;
}

.admin-field-textarea {
  min-height: 96px;
  padding-top: 12px;
  padding-bottom: 12px;
  resize: vertical;
}

.admin-field-label {
  display: block;
  margin: 0;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.tg-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tg-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(8, 58, 101, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tg-editor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: #1e65a4;
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, filter 0.15s;
}

.tg-editor-btn:hover {
  background: #4588bf;
}

.tg-editor-btn b,
.tg-editor-btn i,
.tg-editor-btn u,
.tg-editor-btn s {
  font-size: 13px;
  color: inherit;
}

.tg-editor-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
  min-height: 120px;
}

.tg-editor-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(8, 58, 101, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tg-editor-preview-label {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.tg-editor-preview-body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: #fff;
  white-space: pre-wrap;
  word-break: break-word;
}

.tg-editor-preview-empty {
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
}

.tg-editor-preview-body a {
  color: #b8d9ff;
  text-decoration: underline;
}

.tg-editor-preview-body code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
}

.tg-editor-preview-body pre {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
}

.tg-editor-preview-body tg-spoiler,
.tg-editor-preview-body .tg-spoiler {
  border-radius: 4px;
  padding: 0 3px;
  background: rgba(255, 255, 255, 0.18);
  filter: blur(3px);
}

.tg-editor-hint {
  margin: 0;
}

.tg-editor-hint code {
  margin: 0 2px;
}

.admin-field-file {
  padding-top: 11px;
  padding-bottom: 11px;
}

.admin-btn-primary,
.admin-btn-secondary {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 49px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: filter 0.15s;
}

.admin-btn-primary {
  background: #0080ff;
}

.admin-btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.admin-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-btn-secondary {
  background: #1e65a4;
}

.admin-btn-secondary:hover {
  filter: brightness(1.08);
}

.admin-btn-compact {
  min-height: 40px;
  padding: 0 16px;
}

.admin-checkbox-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.admin-stat-card {
  padding: 1rem 1.1rem;
  border-radius: 10px;
  background: rgba(59, 121, 176, 0.35);
}

.admin-stat-label {
  margin: 0 0 0.35rem;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.admin-stat-value {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 28px;
  line-height: 1.1;
  color: #f3eef9;
}

.admin-stat-meta {
  margin: 0.35rem 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.admin-security-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.admin-security-status {
  margin: 0;
  font-size: 16px;
  color: #fff;
}

.admin-promo-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.admin-promo-form .btn {
  flex: 0 0 auto;
  align-self: flex-start;
}

.admin-quill-wrap {
  position: relative;
}

.admin-quill-editor {
  background: #141418;
  border-radius: 14px;
  overflow: visible;
}

.admin-quill-editor .ql-toolbar.ql-snow {
  border: none;
  border-bottom: 1px solid #2a2a34;
  background: #1a1a20;
  padding: 0.65rem 0.75rem;
  border-radius: 14px 14px 0 0;
}

.admin-quill-editor .ql-container.ql-snow {
  border: none;
  font-family: inherit;
  font-size: 1rem;
  background: #141418;
  border-radius: 0 0 14px 14px;
  overflow: visible;
}

.admin-quill-editor .ql-editor {
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
  color: var(--text);
  line-height: 1.5;
  padding: 1rem 1.1rem;
}

.admin-quill-editor .ql-editor.ql-blank::before {
  color: #6f6a78;
  font-style: normal;
}

.admin-quill-editor .ql-snow .ql-stroke {
  stroke: #b8b4c0;
}

.admin-quill-editor .ql-snow .ql-fill {
  fill: #b8b4c0;
}

.admin-quill-editor .ql-snow .ql-picker-label {
  color: #b8b4c0;
}

.admin-quill-editor .ql-snow .ql-picker-options {
  background: #1a1a20;
  border-color: #2a2a34;
}

.admin-quill-editor .ql-snow a {
  color: var(--accent);
}

.admin-quill-editor .ql-tooltip {
  z-index: 30;
  background: #1a1a20;
  border: 1px solid #3a3a44;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  color: #f0eef4;
  padding: 0.55rem 0.7rem;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  max-width: calc(100% - 1.5rem);
  box-sizing: border-box;
}

.admin-quill-editor .ql-tooltip.ql-editing {
  top: 48px !important;
}

.admin-quill-editor .ql-tooltip input[type="text"] {
  width: min(280px, calc(100vw - 4rem));
  max-width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid #2a2a34;
  border-radius: 8px;
  background: #141418;
  color: #f0eef4;
  font: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.admin-quill-editor .ql-tooltip a.ql-action,
.admin-quill-editor .ql-tooltip a.ql-remove {
  color: #ff4da8;
}

.admin-quill-editor .ql-tooltip a.ql-action:hover,
.admin-quill-editor .ql-tooltip a.ql-remove:hover {
  color: #ff7fc4;
}

.admin-textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  line-height: 1.5;
  font-family: inherit;
}

.editor-wrap {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
}

.editor-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  transition: background 0.15s, opacity 0.15s;
  font-size: 13px;
}

.editor-btn:hover {
  background: rgba(255,255,255,0.1);
  opacity: 1;
}

.editor-sep {
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,0.15);
  margin: 0 4px;
}

.admin-editor {
  width: 100%;
  min-height: 220px;
  padding: 12px 14px;
  line-height: 1.6;
  outline: none;
  border: none;
  border-radius: 0;
  box-sizing: border-box;
  font-family: inherit;
  font-size: inherit;
}

.admin-editor:focus {
  outline: none;
  box-shadow: none;
}

.admin-editor ul,
.admin-editor ol {
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.shell-admin .admin-panel + .admin-panel {
  margin-top: 1.25rem;
}

.admin-flash {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(0, 128, 255, 0.18);
  color: #b8d9ff;
}

.admin-back {
  margin: 0 0 1rem;
}

.admin-back a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.admin-back a:hover {
  color: var(--text);
}

.admin-create-form {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-form-row .field-input {
  flex: 1 1 180px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-table th {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.82rem;
  font-weight: 600;
}

.admin-table-wrap-spaced {
  margin-top: 1.25rem;
}

.admin-link {
  color: #b8d9ff;
  text-decoration: none;
}

.admin-link:hover {
  text-decoration: underline;
}

.admin-empty {
  color: rgba(255, 255, 255, 0.65);
}

.status-active {
  color: #8ef0b8;
}

.status-inactive {
  color: #ffb4c4;
}

.admin-courier-head {
  margin-bottom: 1.25rem;
}

.admin-meta {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.admin-actions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-inline-form {
  flex: 1 1 320px;
}

.admin-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
}

.admin-link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: #7eb8ff;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}

.admin-link-btn:hover {
  color: #b8d9ff;
}

.admin-link-danger {
  color: #ffb4c4;
}

.admin-btn-danger {
  color: #ffb4c4;
  box-shadow: inset 0 0 0 1px rgba(255, 180, 196, 0.35);
}

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

.admin-photo-card {
  background: rgba(59, 121, 176, 0.35);
  border-radius: 12px;
  padding: 0.75rem;
}

.admin-photo-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #0a0a0c;
}

.admin-photo-file {
  display: block;
  padding: 1rem 0.5rem;
  color: var(--text);
  text-decoration: none;
  word-break: break-all;
}

.admin-photo-meta {
  margin: 0.5rem 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.album-showcase {
  margin-bottom: 1rem;
}

.album-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.album-item {
  margin: 0;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.album-item-img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #0a0a0c;
}

.album-item-fallback {
  padding: 1.5rem 0.75rem;
  text-align: center;
}

.album-item-meta {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
}

@media (max-width: 900px) {
  :root {
    --upload-chrome-offset: 5.5rem;
  }

  .upload-shell {
    min-height: calc(100vh - var(--upload-chrome-offset));
    padding-bottom: 1.5rem;
  }

  .body-upload {
    background: var(--bg);
  }

  .body-upload .page {
    padding: 0 0 2rem;
  }

  .body-upload .brand {
    max-width: none;
    margin: 0;
    padding: 1.25rem 1.25rem 0;
  }

  .body-upload .shell {
    padding: 0 1rem;
  }

  .body-upload .card {
    display: block;
    height: auto;
    max-height: none;
    min-height: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }

  .body-upload .card-art {
    display: none;
  }

  .body-upload .card-panel {
    padding: 0.75rem 0 0;
    background: transparent;
    max-height: none;
    min-height: 0;
  }

  .body-upload .panel-inner {
    border: none;
    background: #242428;
    border-radius: 28px;
    padding: 2rem 1.25rem 2.25rem;
    min-height: calc(100vh - 7.5rem);
    max-height: none;
    overflow: visible;
  }

  .body-upload #panel-select {
    justify-content: flex-start;
    min-height: 100%;
  }

  .upload-select-head {
    display: block;
    text-align: center;
    margin-bottom: 1.75rem;
  }

  .upload-select-title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
  }

  .upload-select-desc {
    margin: 0;
    color: #8b8794;
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .body-upload .dropzone-desktop {
    display: none !important;
  }

  .upload-select-actions {
    flex-direction: column;
    gap: 0.85rem;
    margin-top: auto;
    padding-top: 1.5rem;
  }

  .upload-select-actions .btn {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    padding: 1rem 1.25rem;
    border-radius: 999px;
    font-size: 0.92rem;
  }

  .upload-select-actions .btn-primary {
    background: linear-gradient(180deg, #ff4d7a 0%, #e91e63 100%);
    box-shadow: none;
  }

  .upload-select-actions .btn-outline {
    border-color: rgba(255, 255, 255, 0.22);
    background: transparent;
  }

  .btn-label-full {
    display: inline;
  }

  .btn-label-short {
    display: none;
  }

  .body-upload .panel-head-top .panel-title.inline,
  .body-results .panel-head-top .panel-title.inline {
    font-size: 1.15rem;
  }

  .body-upload #panel-queue,
  .body-results .panel-results {
    min-height: 100%;
    display: flex;
    flex-direction: column;
  }

  .body-upload #panel-queue .list-scroll,
  .body-results .panel-results .list-scroll {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    margin-bottom: 1.25rem;
  }

  .body-upload .panel-actions-queue,
  .body-results .panel-actions-queue {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.65rem;
    margin-top: auto;
    padding-top: 0.25rem;
  }

  .body-upload .panel-actions-queue .btn,
  .body-results .panel-actions-queue .btn {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding: 0.95rem 0.65rem;
    border-radius: 999px;
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .body-upload .panel-actions-queue .btn-primary,
  .body-results .panel-actions-queue .btn-primary {
    background: linear-gradient(180deg, #ff4d7a 0%, #e91e63 100%);
    box-shadow: none;
  }

  .body-upload .panel-actions-queue .btn-outline,
  .body-results .panel-actions-queue .btn-outline {
    border-color: rgba(255, 255, 255, 0.22);
    background: transparent;
  }

  .body-results {
    background: var(--bg);
  }

  .body-results .page {
    padding: 0 0 2rem;
  }

  .body-results .brand {
    max-width: none;
    margin: 0;
    padding: 1.25rem 1.25rem 0;
  }

  .body-results .shell {
    padding: 0 1rem;
  }

  .body-results .card {
    display: block;
    height: auto;
    max-height: none;
    min-height: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }

  .body-results .card-art {
    display: none;
  }

  .body-results .card-panel {
    padding: 0.75rem 0 0;
    background: transparent;
    max-height: none;
    min-height: 0;
  }

  .body-results .panel-inner {
    border: none;
    background: #242428;
    border-radius: 28px;
    padding: 2rem 1.25rem 2.25rem;
    min-height: calc(100vh - 7.5rem);
    max-height: none;
    overflow: visible;
  }

  .body-file {
    background: var(--bg);
    overflow-x: hidden;
  }

  .body-file .page {
    padding: 0 0 2.5rem;
    overflow-x: hidden;
  }

  .body-file .brand {
    max-width: none;
    margin: 0;
    padding: 1.25rem 1.25rem 0.75rem;
  }

  .body-file .shell-file {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    padding: 0 1rem;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .body-file .file-page,
  .body-file .file-promo,
  .body-file .file-showcase,
  .body-file .file-showcase-frame,
  .body-file .album-item,
  .body-file .album-stack {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .body-file .file-promo {
    --promo-radius: 0.625rem;
    background: var(--card);
    border: 1px solid var(--panel-border);
    border-radius: var(--promo-radius);
    margin-bottom: 1rem;
    overflow: hidden;
    padding: 0;
  }

  .body-file .file-promo-banner-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .body-file .file-promo-text {
    padding: 1.25rem 1.15rem 1.35rem;
    text-align: left;
  }

  .body-file .file-promo-html p {
    font-size: 0.82rem;
    line-height: 1.55;
    color: #f0eef4;
    margin-bottom: 0.85rem;
  }

  .body-file .file-showcase {
    margin-bottom: 0.75rem;
  }

  .body-file .file-showcase-frame {
    border-radius: 0;
    background: transparent;
    overflow: hidden;
  }

  .body-file .file-showcase-img,
  .body-file video.file-showcase-img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    border-radius: 0;
  }

  .body-file .album-stack {
    gap: 0.85rem;
  }

  .body-file .file-gps-overlay {
    left: 8px;
    bottom: 8px;
    padding: 0.45rem 0.55rem;
    max-width: calc(100% - 16px);
  }

  .body-file .file-gps-overlay p {
    font-size: 0.65rem;
    line-height: 1.35;
  }

  .body-file .file-page-actions {
    display: none;
  }
}

@media (max-width: 900px) {
  body:not(.body-upload) .card {
    grid-template-columns: 1fr;
    grid-template-rows: 320px auto;
    height: auto;
    max-height: none;
    min-height: 0;
    max-width: 100%;
  }

  body:not(.body-upload) .card-art {
    min-height: 320px;
    height: 320px;
  }

  .card-panel {
    max-height: none;
    height: auto;
    min-height: 420px;
  }

  .list-scroll {
    max-height: 280px;
    flex: none;
  }

  .card-panel {
    padding: 1.5rem 1.25rem 1.75rem;
  }

  .panel-actions {
    flex-direction: column;
  }

}

/* Secure notes — Figma */
.panel-note {
  width: 100%;
}

.note-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 650px;
  height: 520px;
  margin: 0 auto;
  padding: 32px 30px;
  background: #0a589c;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  overflow: hidden;
}

.note-card-title {
  margin: 0 0 25px;
  padding-left: 2px;
  font-family: var(--font-pixel);
  font-size: 20px;
  line-height: 22px;
  font-weight: 400;
  color: #f3eef9;
  text-transform: uppercase;
  letter-spacing: 0;
  flex-shrink: 0;
}

.note-card-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.note-card-body-success {
  overflow-y: auto;
}

.note-textarea {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 16px;
  border: none;
  border-radius: 10px;
  background: #3b79b0;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
  resize: none;
  box-sizing: border-box;
}

.note-textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.note-textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 128, 255, 0.45);
}

.note-card-actions {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-shrink: 0;
}

.note-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
  height: 41px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 17px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.note-btn-cancel {
  background: #1e65a4;
}

.note-btn-cancel:hover {
  background: #2270b3;
}

.note-btn-create {
  background: #0080ff;
}

.note-btn-create:hover:not(:disabled) {
  background: #1a8cff;
}

.note-btn-create:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.note-body {
  padding: 0 1.5rem 1.25rem;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.note-hint {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.62);
}

.note-hint-warning {
  margin: 1rem 0 0;
  color: rgba(255, 180, 120, 0.9);
}

.note-link-block {
  margin-top: 0.25rem;
}

.note-link-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
}

.note-error {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
  color: #ffb4b4;
}

.note-error-block {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.note-content-text {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 40, 80, 0.55);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-height: min(50vh, 420px);
  overflow: auto;
}

.note-view-status {
  margin: 0;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
}

.note-view-card {
  min-height: min(360px, calc(100vh - 12rem));
}

.body-note-view .site-header {
  justify-content: center;
}

.body-note-view .site-nav {
  display: none;
}

/* Public view pages (files, notes, password) */
.body-public {
  background: var(--bg);
}

.page-public {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4.17vw, 60px) 2.5rem;
  box-sizing: border-box;
}

.public-header {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 4px 0;
  margin-bottom: 0;
}

.brand-logo-img-compact {
  height: 60px;
  width: auto;
  max-width: none;
}

.public-main {
  width: 100%;
}

.public-banner {
  width: min(1100px, 100%);
  margin: 16px auto 35px;
  border-radius: 24px;
  overflow: hidden;
  line-height: 0;
  background-color: var(--alpha-checker-light);
  background-image:
    linear-gradient(45deg, var(--alpha-checker-dark) 25%, transparent 25%),
    linear-gradient(-45deg, var(--alpha-checker-dark) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--alpha-checker-dark) 75%),
    linear-gradient(-45deg, transparent 75%, var(--alpha-checker-dark) 75%);
  background-size: var(--alpha-checker-size) var(--alpha-checker-size);
  background-position:
    0 0,
    0 calc(var(--alpha-checker-size) / 2),
    calc(var(--alpha-checker-size) / 2) calc(var(--alpha-checker-size) / -2),
    calc(var(--alpha-checker-size) / -2) 0;
}

.public-banner-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: contain;
  object-position: center;
}

.public-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  width: 100%;
}

.body-public-file .public-stage,
.body-public-album .public-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 650px) auto;
  justify-content: center;
  align-items: start;
  gap: 0;
  max-width: 1040px;
  margin: 0 auto;
}

.body-public-file .public-main:not(:has(.public-banner)) .public-stage,
.body-public-album .public-main:not(:has(.public-banner)) .public-stage {
  margin-top: clamp(0.5rem, 2vw, 1rem);
}

.public-fasces {
  height: clamp(220px, 42vh, 350px);
  width: clamp(90px, 11vw, 150px);
}

.body-public-file .public-fasces,
.body-public-album .public-fasces {
  height: 350px;
  width: auto;
  max-width: 150px;
  top: calc(50vh - 175px);
}

.public-content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(100%, 640px);
}

.body-public-file .public-content,
.body-public-album .public-content {
  grid-column: 2;
  flex: 0 1 650px;
  max-width: 650px;
  width: 100%;
}

.public-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 0;
  text-align: center;
}

.public-gate-title {
  margin: 0 0 1.5rem;
  font-family: var(--font-pixel);
  font-size: clamp(1.1rem, 2.5vw, 1.55rem);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: #fff;
  text-transform: uppercase;
}

.public-gate-title-regular {
  font-family: var(--font);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: #fff;
}

.public-gate-sub {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
}

.public-gate-error {
  margin: 0;
  color: #ffb4b4;
  font-size: 0.92rem;
}

.public-note-message {
  margin: 0;
  max-width: 26rem;
  font-family: var(--font);
  font-weight: 400;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  line-height: 1.45;
  color: #fff;
  text-align: center;
}

.public-gate-btn,
.public-unlock-btn {
  min-width: 11rem;
  width: auto;
  display: inline-flex;
}

.public-unlock {
  gap: 20px;
  width: 100%;
}

.public-unlock-title {
  margin: 0;
  width: min(426px, 100%);
  font-family: var(--font-pixel);
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 400;
  line-height: 1.125;
  color: #f3eef9;
  text-align: center;
}

.public-unlock-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: min(426px, 100%);
  margin: 0 auto;
}

.public-unlock-field {
  width: 100%;
}

.public-unlock-row {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 49px;
  padding: 16px;
  gap: 8px;
  border-radius: 10px;
  background: #3b79b0;
}

.public-unlock-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  line-height: 17px;
}

.public-unlock-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.public-unlock-input:focus {
  outline: none;
}

.public-unlock-toggle {
  position: static;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  padding: 0;
  color: rgba(255, 255, 255, 0.4);
}

.public-unlock-toggle:hover {
  color: rgba(255, 255, 255, 0.7);
}

.public-unlock-submit {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 49px;
  padding: 16px 24px;
  border: none;
  border-radius: 10px;
  background: #0080ff;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 17px;
  cursor: pointer;
  transition: background 0.15s;
}

.public-unlock-submit:hover {
  background: #006fd9;
}

.public-note-warn {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.62);
}

.public-note-content .note-content-text {
  max-height: min(58vh, 520px);
  min-height: 180px;
}

.public-file,
.public-album {
  width: 100%;
}

.body-public-file .file-showcase-frame,
.body-public-album .file-showcase-frame {
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.body-public-file .file-showcase-frame-image,
.body-public-album .file-showcase-frame-image {
  background-color: transparent;
  background-image: none;
}

.body-public-file .file-showcase-img,
.body-public-file video.file-showcase-img,
.body-public-album .file-showcase-img,
.body-public-album video.file-showcase-img {
  width: 100%;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
}

.public-album .album-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-banner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.admin-banner-card {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--alpha-checker-light);
  background-image:
    linear-gradient(45deg, var(--alpha-checker-dark) 25%, transparent 25%),
    linear-gradient(-45deg, var(--alpha-checker-dark) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--alpha-checker-dark) 75%),
    linear-gradient(-45deg, transparent 75%, var(--alpha-checker-dark) 75%);
  background-size: var(--alpha-checker-size) var(--alpha-checker-size);
  background-position:
    0 0,
    0 calc(var(--alpha-checker-size) / 2),
    calc(var(--alpha-checker-size) / 2) calc(var(--alpha-checker-size) / -2),
    calc(var(--alpha-checker-size) / -2) 0;
}

.admin-banner-preview {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: contain;
  object-position: center;
}

.admin-banner-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .body-public-file .public-fasces,
  .body-public-album .public-fasces {
    height: clamp(200px, 38vh, 280px);
    max-width: clamp(72px, 14vw, 110px);
  }

  .body-public-file .public-content,
  .body-public-album .public-content {
    flex: 1 1 auto;
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .public-fasces {
    display: none;
  }

  .body-public-file .public-main:not(:has(.public-banner)) .public-stage,
  .body-public-album .public-main:not(:has(.public-banner)) .public-stage {
    margin-top: 1rem;
  }

  .public-content {
    max-width: 100%;
  }
}

/* ——— Мобильные телефоны ——— */
@media (max-width: 600px) {
  :root {
    --upload-chrome-offset: 7.5rem;
  }

  html,
  body {
    overflow-x: hidden;
  }

  .page-upload {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .site-header {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: max(0.5rem, env(safe-area-inset-top, 0)) 0.75rem 0;
  }

  .site-header-nav {
    display: flex;
    align-items: center;
    width: 100%;
    margin-left: 0;
    padding: 5px;
    gap: 6px;
    background: rgba(10, 88, 156, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0, 24, 55, 0.22);
  }

  .site-nav {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 0 2px;
  }

  .site-nav-link {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 8px;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    color: rgba(255, 255, 255, 0.72);
    background: transparent;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  }

  .site-nav-link.is-active {
    color: #fff;
    background: #3b79b0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
  }

  .site-nav-profile {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    border-radius: 50%;
    background: #1e65a4;
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow: 0 2px 10px rgba(0, 24, 55, 0.2);
  }

  .site-nav-profile.is-active {
    background: #4588bf;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), 0 2px 10px rgba(0, 24, 55, 0.2);
  }

  .site-nav-profile.is-active .site-nav-profile-icon {
    filter: brightness(1.08);
  }

  .brand-logo-img {
    height: 56px;
    max-width: min(220px, 78vw);
  }

  .site-nav-profile-icon {
    width: 26px;
    height: 26px;
  }

  .upload-shell {
    min-height: auto;
    align-items: stretch;
    padding: 0.75rem 0.75rem 1.25rem;
  }

  .upload-stage,
  .upload-stage:has(.upload-card-queue),
  .upload-stage:has(.profile-card),
  .upload-stage:has(.history-card),
  .upload-stage:has(.panel-note),
  .upload-stage:has(.upload-card-results),
  .body-upload-home .upload-stage,
  .body-results .upload-stage {
    max-width: calc(100vw - 1.5rem);
  }

  #panel-select .upload-card {
    min-height: min(480px, calc(100dvh - 10rem));
    padding: 24px 18px;
    gap: 20px;
    border-radius: 16px;
  }

  #panel-select .upload-cat {
    width: clamp(120px, 36vw, 180px);
    height: clamp(120px, 36vw, 180px);
  }

  #panel-select .upload-title {
    font-size: clamp(20px, 6.5vw, 28px);
  }

  #panel-select .upload-hint {
    font-size: 12px;
    line-height: 1.45;
  }

  .upload-card-queue {
    min-height: min(520px, calc(100dvh - 10rem));
    padding: 18px 16px;
    border-radius: 16px;
  }

  .queue-title {
    font-size: 18px;
    line-height: 1.2;
  }

  .queue-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .queue-password-btn {
    width: 100%;
    justify-content: center;
  }

  .queue-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .queue-footer-actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .queue-btn {
    width: 100%;
    min-height: 44px;
  }

  .queue-drop-hint kbd {
    display: none;
  }

  .upload-card-results,
  .history-card,
  .profile-card,
  .note-card {
    padding: 18px 16px;
    border-radius: 16px;
  }

  .upload-card-results {
    min-height: min(560px, calc(100dvh - 10rem));
  }

  .results-head-title-row {
    flex: 1 1 100%;
  }

  .results-title,
  .history-card-title,
  .queue-title {
    font-size: 18px;
    line-height: 1.2;
  }

  .results-format {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 6px;
  }

  .format-switch {
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .format-switch-btn {
    min-height: 28px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .results-link-text {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-all;
    font-size: 13px;
    line-height: 1.35;
  }

  .results-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }

  .results-footer-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .results-btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .results-link-copy {
    width: 44px;
    height: 44px;
  }

  .results-link-open {
    height: 44px;
    padding: 0 16px;
    font-size: 13px;
  }

  .results-link-copy svg {
    width: 20px;
    height: 20px;
  }

  .history-head {
    display: none;
  }

  .history-row {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 40px 12px 12px;
    border-radius: 10px;
    background: rgba(8, 58, 101, 0.35);
  }

  .history-row-fields {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
  }

  .history-row-meta {
    flex-wrap: wrap;
    gap: 8px 14px;
    width: 100%;
  }

  .history-col-id,
  .history-col-time,
  .history-col-date,
  .history-col-count {
    width: auto;
    font-size: 13px;
  }

  .history-col-count::before {
    content: "Фото: ";
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
  }

  .history-open-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
  }

  .history-pagination {
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 16px;
  }

  .profile-card {
    padding: 24px 18px;
    gap: 1.25rem;
  }

  .profile-settings-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .modal-overlay {
    padding: 1rem 1rem 0;
    align-items: flex-end;
  }

  .modal-card,
  .modal-card-password,
  .modal-card-twofa {
    width: 100%;
    max-width: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0));
  }

  .modal-actions,
  .profile-modal-actions,
  .twofa-modal-actions {
    flex-direction: column;
    gap: 8px;
  }

  .modal-actions .btn,
  .profile-modal-btn,
  .twofa-modal-btn {
    width: 100%;
    min-height: 44px;
  }

  .note-card {
    min-height: min(440px, calc(100dvh - 10rem));
    max-height: none;
    padding: 18px 16px;
  }

  .note-card-body textarea,
  .note-card-body .note-textarea {
    min-height: 180px;
  }

  .public-main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .public-content {
    padding: 0 0 1.25rem;
  }

  .file-showcase-frame,
  .file-page,
  .album-stack {
    border-radius: 0;
  }

  .upload-shell-admin {
    padding: 0.75rem;
  }

  .admin-stage {
    max-width: 100%;
  }

  .admin-tabs {
    gap: 0.35rem;
  }

  .admin-tab {
    font-size: 0.78rem;
    padding: 0.45rem 0.65rem;
  }
}

@media (max-width: 380px) {
  :root {
    --upload-chrome-offset: 9rem;
  }

  .site-nav-link {
    font-size: 0.7rem;
    padding: 9px 6px;
  }

  .site-nav-profile {
    width: 38px;
    height: 38px;
  }

  .site-nav-profile-icon {
    width: 24px;
    height: 24px;
  }

  .results-meta {
    flex-direction: column;
    gap: 10px;
  }

  .history-page-btn {
    min-width: 28px;
    height: 28px;
    font-size: 12px;
  }
}

