/* ============================================================
   0xFile.com — Privacy Polish
   System font stack (no external font requests for privacy)
   CSS variables for dark/light theming
   ============================================================ */

/* Theme tokens — DARK (default) */
:root,
:root[data-theme="dark"] {
  --bg: #0A0B0F;
  --surface-low: #101218;
  --surface: #161922;
  --surface-high: #1E2230;
  --surface-inset: #000000;

  --text: #F4F5F7;
  --text-muted: #9197A4;
  --text-subtle: #6A6F7B;

  --primary: #7C7AED;
  --primary-hover: #918FF1;
  --primary-tint: rgba(124, 122, 237, 0.08);

  --warn: #F5B543;
  --warn-tint: rgba(245, 181, 67, 0.10);

  --error: #F87171;
  --error-tint: rgba(248, 113, 113, 0.12);

  --ok: #5EEAD4;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --header-bg: rgba(10, 11, 15, 0.72);
}

/* Theme tokens — LIGHT (variant B from Stitch) */
:root[data-theme="light"] {
  --bg: #FAFAF7;
  --surface-low: #F4F4EE;
  --surface: #FFFFFF;
  --surface-high: #FFFFFF;
  --surface-inset: #F0F0EB;

  --text: #1A1B23;
  --text-muted: #4A4D58;
  --text-subtle: #6E7280;

  --primary: #6F6DDA;
  --primary-hover: #5C5AC8;
  --primary-tint: rgba(124, 122, 237, 0.10);

  --warn: #C28714;
  --warn-tint: rgba(245, 181, 67, 0.18);

  --error: #DC2626;
  --error-tint: rgba(220, 38, 38, 0.10);

  --ok: #0F9988;

  --border: rgba(26, 27, 35, 0.10);
  --border-strong: rgba(26, 27, 35, 0.18);

  --header-bg: rgba(250, 250, 247, 0.78);
}

/* ============================================================
   Reset + base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color-scheme: dark light; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text",
    "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main { flex: 1; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 {
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter",
    "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0 0 0.6em;
  line-height: 1.15;
}
h1 { font-size: clamp(28px, 5vw, 40px); }
h2 { font-size: clamp(20px, 3.5vw, 24px); }
h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }

p { margin: 0 0 1em; color: var(--text-muted); }

code, kbd, pre, .mono {
  font-family:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.label-sm {
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-subtle);
}

/* ============================================================
   Layout containers
   ============================================================ */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}
.container.wide { max-width: 1200px; }

@media (min-width: 768px) {
  .container { padding: 32px 24px; }
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 16px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter",
    "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.04em;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); text-decoration: none; }
.brand .accent { color: var(--primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  color: var(--text-muted);
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Language globe dropdown */
.lang-dropdown { position: relative; }
.lang-globe {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 8px;
  transition: color .15s;
}
.lang-globe:hover { color: var(--text); }
.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  min-width: 150px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  z-index: 70;
  animation: debugIn .12s ease;
}
.lang-menu[hidden] { display: none; }
/* Theme icon button */
.theme-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 8px;
  transition: color .15s;
}
.theme-icon:hover { color: var(--text); }
.theme-icon .icon-sun, .theme-icon .icon-moon { display: none; }

.lang-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .1s, color .1s;
}
.lang-item:hover { background: var(--surface-high); color: var(--text); }
.lang-item.active { color: var(--primary); font-weight: 500; }

@media (max-width: 480px) {
  .header-controls { gap: 4px; }
  .theme-toggle button, .lang-toggle button { padding: 5px 7px; font-size: 11px; }
}

.lang-toggle,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--border);
}
.lang-toggle button,
.theme-toggle button {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font: inherit;
  font-size: 13px;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
}
.lang-toggle button.active,
.theme-toggle button.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.theme-toggle button:hover { color: var(--text); }

/* ============================================================
   Debug panel
   ============================================================ */
.debug-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-subtle);
  padding: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, border-color .15s;
}
.debug-toggle:hover, .debug-toggle.active {
  color: var(--primary);
  border-color: var(--primary);
}

.debug-panel {
  position: fixed;
  top: 52px;
  right: 16px;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  width: 260px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: debugIn .15s ease;
}
.debug-panel[hidden] { display: none; }
@keyframes debugIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.debug-section { margin-bottom: 10px; }
.debug-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-subtle);
  margin-bottom: 6px;
  font-weight: 500;
}

.debug-pills {
  display: flex;
  gap: 2px;
  background: var(--surface-low);
  border-radius: 8px;
  padding: 2px;
}
.debug-pills button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-subtle);
  font: inherit;
  font-size: 12px;
  padding: 5px 4px;
  border-radius: 6px;
  cursor: pointer;
}
.debug-pills button.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.debug-pills button:hover { color: var(--text); }

.debug-panel select {
  width: 100%;
  background: var(--surface-inset);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239197A4' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.debug-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.debug-check input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-subtle);
}
.site-footer a { color: var(--text-muted); }

/* ============================================================
   Hero
   ============================================================ */
.hero { margin: 32px 0 24px; }
.hero h1 { margin-bottom: 8px; }
.hero .subhead { font-size: clamp(16px, 2vw, 17px); color: var(--text-muted); margin-bottom: 18px; }
.hero .pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", monospace;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.pill .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
}
.card.inset {
  background: var(--surface-low);
  border: 1px solid var(--border);
}
@media (min-width: 768px) {
  .card { padding: 24px; }
}

/* ============================================================
   Forms
   ============================================================ */
label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
label.field .field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

input[type="text"],
input[type="number"],
input[type="password"],
select {
  width: 100%;
  background: var(--surface-inset);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-variant-numeric: tabular-nums;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239197A4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 600px) {
  .field-row { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* ============================================================
   Dropzone
   ============================================================ */
.dropzone-wrap {
  border: 2px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-low);
  transition: border-color .15s ease, background .15s ease;
  overflow: hidden;
}
.dropzone-wrap.is-dragover { border-color: var(--primary); background: var(--primary-tint); }

/* Empty state — big centered drop area */
.dz-empty {
  display: flex;
  min-height: 320px;
}
.dz-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  cursor: pointer;
  transition: background .15s ease;
}
.dz-label:hover { background: var(--primary-tint); }
.dz-label input[type="file"] { display: none; }
.dz-icon {
  display: inline-flex;
  width: 56px; height: 56px;
  align-items: center; justify-content: center;
  border-radius: 14px;
  background: var(--primary-tint);
  color: var(--primary);
  margin-bottom: 12px;
}
.dz-title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.dz-sub { font-size: 13px; color: var(--text-subtle); margin: 0; }

/* When files present — empty state hides, list shows inside dropzone */
.dropzone-wrap.has-files .dz-empty { display: none; }
.dropzone-wrap.has-files { border-style: solid; border-color: var(--border); }

/* File list inside dropzone */
.dropzone-wrap .file-upload-list { padding: 10px; }

/* Add-more strip at bottom */
.dz-add-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  cursor: pointer;
  color: var(--text-subtle);
  font-size: 14px;
  font-weight: 500;
  border-top: 1px dashed var(--border);
  transition: background .15s ease, color .15s ease;
}
.dz-add-more:hover { background: var(--primary-tint); color: var(--primary); }
.dz-add-more input[type="file"] { display: none; }

/* ============================================================
   Stepper (passwords count)
   ============================================================ */
.stepper {
  display: inline-flex;
  align-items: center;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.stepper button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 36px; height: 38px;
  font-size: 18px;
  cursor: pointer;
}
.stepper button:hover { color: var(--text); background: var(--surface); }
.stepper input {
  width: 48px;
  background: transparent;
  border: none;
  color: var(--text);
  text-align: center;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 15px;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  line-height: 1.2;
  text-decoration: none;
}
.btn:hover { background: var(--surface-high); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}
.btn.btn-primary:hover { background: var(--primary-hover); color: #FFFFFF; }
.btn.btn-block { width: 100%; }
.btn.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }
.btn.btn-danger { color: var(--error); border: 1px solid var(--border); background: transparent; }
.btn.btn-danger:hover { background: var(--error-tint); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   Trust strip
   ============================================================ */
.trust {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 24px 0;
}
@media (min-width: 600px) {
  .trust { grid-template-columns: repeat(3, 1fr); }
}
.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-low);
  border-radius: 10px;
  padding: 12px 14px;
}
.trust-item svg { color: var(--primary); flex-shrink: 0; margin-top: 2px; }
.trust-item .t-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.trust-item .t-sub { font-size: 12px; color: var(--text-subtle); margin: 0; }

/* ============================================================
   Banner / disclosure
   ============================================================ */
.banner {
  background: var(--warn-tint);
  border-left: 3px solid var(--warn);
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text);
}
.banner small { display: block; color: var(--text-subtle); margin-top: 4px; font-size: 12px; }

.error-msg {
  background: var(--error-tint);
  border-left: 3px solid var(--error);
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  color: var(--text);
  font-size: 14px;
}

.notice {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--surface-low);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-subtle);
  line-height: 1.5;
}

/* ============================================================
   Result page (post-upload)
   ============================================================ */
.result-section { margin-bottom: 28px; }
.result-section .label-sm { margin-bottom: 8px; }

.url-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
}
.url-box .url-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.url-box .url-text a { color: var(--text); text-decoration: none; }
.url-box .url-text a:hover { color: var(--primary); text-decoration: none; }
.copy-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 5px 9px;
  cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }
.copy-btn.copied { color: var(--ok); }

.password-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 8px;
}
.password-list li {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.password-list code.password-display {
  flex: 1;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.password-list .pw-num {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-subtle);
  min-width: 28px;
}

/* ============================================================
   Gate (password entry)
   ============================================================ */
.gate-wrap { max-width: 440px; margin: 60px auto 0; }
.gate-icon {
  display: inline-flex;
  width: 56px; height: 56px;
  align-items: center; justify-content: center;
  border-radius: 14px;
  background: var(--primary-tint);
  color: var(--primary);
  margin-bottom: 18px;
}
.gate-form { display: grid; gap: 12px; margin-top: 18px; }

/* ============================================================
   Gallery — photo grid (images with preview)
   ============================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 24px 0;
}
@media (min-width: 600px) {
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
}

.photo-card {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 1;
  text-decoration: none;
  border: 1px solid transparent;
  transition: border-color .15s ease, transform .1s ease;
}
.photo-card:hover {
  text-decoration: none;
  border-color: var(--border-strong);
  transform: scale(1.02);
  cursor: pointer;
}
.photo-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
}
.photo-name {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.photo-size {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
}

/* View-only protection layer */
.photo-grid.view-only .photo-card img,
.lightbox-img.protected {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}
.photo-shield,
.lightbox-shield {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
}
.lightbox-shield { cursor: default; }

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 92vw;
  max-height: 92vh;
  z-index: 1;
}

.lightbox-img {
  display: block;
  max-width: 90vw;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface);
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  width: 100%;
  max-width: 90vw;
  flex-wrap: wrap;
}

.lightbox-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.lightbox-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lightbox-size {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.lightbox-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background .15s ease;
  z-index: 2;
}
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.15);
}
.lightbox-prev { left: max(8px, calc(50% - 47vw)); }
.lightbox-next { right: max(8px, calc(50% - 47vw)); }

@media (max-width: 600px) {
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-bar { flex-direction: column; align-items: stretch; text-align: center; }
  .lightbox-actions { justify-content: center; }
}

/* ============================================================
   Gallery — file list (non-image files)
   ============================================================ */
.file-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 16px 0;
}

.file-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  transition: border-color .15s ease, background .15s ease;
  max-width: 100%;
  overflow: hidden;
}
.file-card:hover {
  text-decoration: none;
  border-color: var(--border-strong);
  background: var(--surface-high);
}
.file-card .file-icon {
  width: 40px; height: 40px;
  background: var(--primary-tint);
  color: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.file-card .file-meta {
  flex: 1; min-width: 0;
}
.file-card .file-name {
  font-size: 14px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-card .file-size {
  font-family: ui-monospace, monospace;
  font-size: 11px; color: var(--text-subtle); margin-top: 2px;
}

/* ============================================================
   Manage dashboard
   ============================================================ */
.dashboard-grid {
  display: grid; grid-template-columns: 1fr; gap: 16px;
  margin: 24px 0;
}
@media (min-width: 768px) {
  .dashboard-grid { grid-template-columns: repeat(3, 1fr); }
}
.stat-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px 18px;
}
.stat-card .stat-label {
  text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 11px; color: var(--text-subtle); margin-bottom: 6px; font-weight: 500;
}
.stat-card .stat-value {
  font-family: ui-monospace, monospace;
  font-size: 26px; color: var(--text); font-weight: 600;
}
.stat-card .stat-sub { font-size: 12px; color: var(--text-subtle); margin-top: 4px; }

table.events {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border-radius: 12px; overflow: hidden;
}
table.events th, table.events td {
  text-align: left; padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
table.events th {
  background: var(--surface-low);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 11px; color: var(--text-subtle); font-weight: 500;
}
table.events td { color: var(--text-muted); }
table.events td.mono {
  font-family: ui-monospace, monospace;
  color: var(--text);
  font-size: 12px;
}
table.events tr:last-child td { border-bottom: none; }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 36px; margin-bottom: 12px;
}
.section-title h2 { margin: 0; font-size: 18px; }
.section-title .count {
  font-family: ui-monospace, monospace;
  font-size: 12px; color: var(--text-subtle);
}

.password-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.password-row:last-child { border-bottom: none; }
.password-row .pw-status {
  text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 10px; padding: 3px 8px; border-radius: 999px;
  font-weight: 600;
}
.pw-status.active { background: var(--primary-tint); color: var(--primary); }
.pw-status.used   { background: var(--surface-low); color: var(--text-subtle); }
.pw-status.revoked{ background: var(--error-tint); color: var(--error); }
.password-row .pw-time {
  font-family: ui-monospace, monospace;
  font-size: 11px; color: var(--text-subtle); margin-left: auto;
}

/* ============================================================
   Empty / muted lists
   ============================================================ */
.empty {
  padding: 24px; text-align: center;
  color: var(--text-subtle); font-size: 13px;
  background: var(--surface-low); border-radius: 12px;
}
