/* ─── Light theme (default) ─── */
:root {
  --canvas: #f4f4f5;
  --surface: #ffffff;
  --surface-raised: #fafafa;
  --border: #e4e4e7;
  --border-soft: #f4f4f5;
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --accent-success: #16a34a;
  --accent-danger: #e11d48;
  --r-control: 6px;
  --r-surface: 8px;
  --r-full: 9999px;
  --shadow-float: 0 10px 30px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-pop: 0 4px 16px rgba(0, 0, 0, 0.06);
  --font-sans: 'Inter', 'Inter-fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 16px;
  --sp-4: 24px;
  --sp-5: 32px;
  --sp-6: 40px;
  --sp-7: 56px;

  /* Component-specific tokens */
  --btn-primary-hover: #3f3f46;
  --drop-hover: rgba(0, 0, 0, 0.02);
  --drop-active: rgba(0, 0, 0, 0.04);
  --error-text: #be123c;
  --error-bg: rgba(225, 29, 72, 0.08);
  --error-border: rgba(225, 29, 72, 0.2);
  --success-text: #15803d;

  /* Drop ring (Variant D) */
  --drop-ring-bg: #f0fdf4;
  --drop-ring-border: #bbf7d0;
  --drop-ring-icon: #16a34a;
}

/* ─── Dark theme ─── */
[data-theme="dark"] {
  --canvas: #09090b;
  --surface: #18181b;
  --surface-raised: #1c1c1f;
  --border: #27272a;
  --border-soft: #3f3f46;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --shadow-float: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 4px 16px rgba(0, 0, 0, 0.3);

  --btn-primary-hover: #d4d4d8;
  --drop-hover: rgba(255, 255, 255, 0.02);
  --drop-active: rgba(255, 255, 255, 0.04);
  --error-text: #fca5a5;
  --error-bg: rgba(225, 29, 72, 0.1);
  --error-border: rgba(225, 29, 72, 0.25);
  --success-text: #86efac;

  --drop-ring-bg: rgba(22, 163, 74, 0.1);
  --drop-ring-border: rgba(22, 163, 74, 0.25);
  --drop-ring-icon: #4ade80;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--canvas);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea {
  font-family: inherit;
  font-size: 14px;
}

ul, ol {
  list-style: none;
}

/* ─── Theme Toggle (fixed corner) ─── */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-control);
  color: var(--text-muted);
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
}

.theme-toggle--fixed {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
}

.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--border);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Show sun in dark mode, moon in light mode */
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ─── Page Footer controls ─── */

.page-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 0 8px;
}

.footer-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  padding: 3px 6px;
  border-radius: var(--r-control);
  transition: color 0.12s, background 0.12s;
}

.footer-theme-btn:hover {
  color: var(--text-secondary);
  background: var(--border-soft);
}

.footer-theme-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Show sun in dark mode, moon in light mode */
.footer-theme-btn .icon-sun { display: none; }
.footer-theme-btn .icon-moon { display: block; }
[data-theme="dark"] .footer-theme-btn .icon-sun { display: block; }
[data-theme="dark"] .footer-theme-btn .icon-moon { display: none; }

.footer-sep {
  width: 1px;
  height: 12px;
  background: var(--border);
  flex-shrink: 0;
}

.footer-lang {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-lang-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  padding: 2px 4px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  transition: color 0.12s, background 0.12s;
}

.footer-lang-btn:hover {
  color: var(--text-secondary);
}

.footer-lang-btn.active {
  color: var(--text-primary);
}

.footer-lang-dot {
  font-size: 12px;
  color: var(--border);
  user-select: none;
}

/* ─── Page Hero ─── */

.page-hero {
  text-align: center;
  margin-bottom: 8px;
}

.hero-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
}

.hero-logo em {
  font-style: normal;
  color: #16a34a;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  line-height: 1;
  flex-shrink: 0;
  font-style: normal;
}

.hero-tagline {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ─── Page Layout ─── */

.page-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  min-height: 100vh;
  padding: var(--sp-7) 20px var(--sp-7);
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

.page-main--narrow {
  max-width: 520px;
}

/* ─── Upload Card ─── */

.upload-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-float);
  overflow: hidden;
}

/* ─── Drop Zone ─── */

.drop-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin: 20px;
  border: 1.5px dashed var(--border);
  border-radius: var(--r-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  user-select: none;
}

.drop-zone:hover {
  border-color: var(--text-muted);
  background: var(--drop-hover);
}

.drop-zone--active {
  border-color: var(--text-secondary);
  background: var(--drop-active);
}

.drop-zone__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 24px;
  text-align: center;
}

.drop-zone__icon {
  color: var(--text-muted);
  margin-bottom: 4px;
}

.drop-zone__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.drop-zone__hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── File List ─── */

.file-list {
  margin: 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-surface);
  overflow: hidden;
}

.file-list[hidden] {
  display: none;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

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

.file-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.file-item__name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item__size {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.file-item__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-control);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.12s, background 0.12s;
}

.file-item__remove:hover {
  color: var(--accent-danger);
  background: var(--border);
}

/* ─── Upload Form ─── */

.upload-form {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.file-list + .upload-form {
  padding-top: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ─── Expiry Chips ─── */

.expiry-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.chip--active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--surface);
}

.chip--active:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  color: var(--surface);
}

/* ─── Password Row ─── */

.password-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ─── Downloads Row ─── */

.downloads-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ─── Form Inputs ─── */

.form-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--text-muted);
  box-shadow: 0 0 0 2px rgba(113, 113, 122, 0.15);
}

.form-input--narrow {
  width: 100px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.4;
}

/* ─── Buttons ─── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--surface);
  background: var(--text-primary);
  border: 1px solid var(--text-primary);
  border-radius: var(--r-control);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
}

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

.btn-primary:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 2px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.btn-outline:hover {
  background: var(--border);
}

.btn-outline:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 2px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border-radius: var(--r-control);
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--border);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
}

.btn-send {
  width: 100%;
  padding: 11px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ─── Progress Section ─── */

.progress-section {
  padding: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.progress-section[hidden] {
  display: none;
}

.progress-bar {
  width: 100%;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: var(--r-full);
  background: var(--border);
  overflow: hidden;
}

.progress-bar::-webkit-progress-bar {
  background: var(--border);
  border-radius: var(--r-full);
}

.progress-bar::-webkit-progress-value {
  background: var(--accent-success);
  border-radius: var(--r-full);
  transition: width 0.2s ease;
}

.progress-bar::-moz-progress-bar {
  background: var(--accent-success);
  border-radius: var(--r-full);
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-text {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ─── Error Message ─── */

.error-message {
  margin: 0 20px 20px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--error-text);
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--r-control);
}

.error-message[hidden] {
  display: none;
}

/* ─── Result Card ─── */

.result-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-float);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.result-card[hidden] {
  display: none;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--success-text);
  align-self: stretch;
}

.result-header svg {
  color: var(--accent-success);
  flex-shrink: 0;
}

.link-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.link-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  cursor: default;
}

.qr-canvas {
  border-radius: var(--r-surface);
  display: block;
}

.result-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ─── Download Card ─── */

.download-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-float);
  overflow: hidden;
}

.download-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.download-header__icon {
  color: var(--text-muted);
}

.download-header__label {
  color: var(--text-primary);
}

/* ─── Download File List ─── */

.file-list-dl {
  padding: 0;
}

.file-list-dl__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.file-list-dl__item:last-child {
  border-bottom: none;
}

.file-list-dl__info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.file-list-dl__info svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.file-list-dl__name {
  font-size: 14px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list-dl__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.file-list-dl__size {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ─── Meta Row ─── */

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.meta-item svg {
  flex-shrink: 0;
}

/* ─── Password Gate ─── */

.password-gate {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.password-gate__header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.password-gate__form {
  display: flex;
  gap: 8px;
}

.password-gate__form .form-input {
  flex: 1;
}

/* ─── Password Success ─── */

.success-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--success-text);
  border-top: 1px solid var(--border);
}

.success-msg svg {
  color: var(--accent-success);
  flex-shrink: 0;
}

/* ─── Download QR ─── */

.download-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  border-top: 1px solid var(--border);
}

.download-qr__hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Gone Card ─── */

.gone-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-float);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.gone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--border);
  border-radius: var(--r-surface);
  color: var(--text-muted);
  margin-bottom: 4px;
}

.gone-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.gone-body {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

/* ─── QR canvas shared ─── */

#qr-canvas {
  display: block;
  border-radius: var(--r-surface);
}

/* ─── Logo accent ─── */

.site-logo__accent {
  font-style: normal;
  color: #16a34a;
}

/* ─── Drop ring (Variant D) ─── */

.drop-ring {
  width: 72px;
  height: 72px;
  border-radius: var(--r-full);
  background: var(--drop-ring-bg);
  border: 2px solid var(--drop-ring-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.drop-ring svg {
  width: 32px;
  height: 32px;
  stroke: var(--drop-ring-icon);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-cta {
  margin-top: 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ─── Zip overlay ─── */

.zip-overlay {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border-radius: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.zip-overlay[hidden] { display: none; }

.zip-overlay__spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.zip-overlay__text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.zip-overlay__sub {
  font-size: 12px;
  color: var(--text-muted);
  min-height: 16px;
}

/* ─── Files section (Variant D) ─── */

.files-section {
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
}

.files-section[hidden] {
  display: none;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.1s;
}

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

.file-row:hover {
  background: var(--surface-raised);
}

.ext-badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--r-control);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ext-badge--rose   { background: #fff1f2; color: #be123c; }
.ext-badge--blue   { background: #eff6ff; color: #1d4ed8; }
.ext-badge--amber  { background: #fef3c7; color: #92400e; }
.ext-badge--green  { background: #dcfce7; color: #15803d; }
.ext-badge--violet { background: #f5f3ff; color: #6d28d9; }
.ext-badge--purple { background: #faf5ff; color: #7e22ce; }
.ext-badge--indigo { background: #eef2ff; color: #3730a3; }
.ext-badge--zinc   { background: var(--border); color: var(--text-secondary); }

[data-theme="dark"] .ext-badge--rose   { background: rgba(190, 18, 60, 0.15);  color: #fb7185; }
[data-theme="dark"] .ext-badge--blue   { background: rgba(29, 78, 216, 0.15);  color: #60a5fa; }
[data-theme="dark"] .ext-badge--amber  { background: rgba(146, 64, 14, 0.2);   color: #fbbf24; }
[data-theme="dark"] .ext-badge--green  { background: rgba(21, 128, 61, 0.15);  color: #4ade80; }
[data-theme="dark"] .ext-badge--violet { background: rgba(109, 40, 217, 0.15); color: #a78bfa; }
[data-theme="dark"] .ext-badge--purple { background: rgba(126, 34, 206, 0.15); color: #c084fc; }
[data-theme="dark"] .ext-badge--indigo { background: rgba(55, 48, 163, 0.15);  color: #818cf8; }

.file-row__info {
  flex: 1;
  min-width: 0;
}

.file-row__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row__size {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

.file-row__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--r-control);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.12s, background 0.12s;
}

.file-row__remove:hover {
  color: var(--accent-danger);
  background: var(--border-soft);
}

/* ─── Settings row (Variant D) ─── */

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-top: 1px solid var(--border-soft);
  flex-wrap: nowrap;
}

.settings-sep--push {
  flex: 1;
  width: auto;
  background: none;
}

.chip-group {
  display: flex;
  gap: 4px;
}

.settings-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

.input-sm {
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  outline: none;
  transition: border-color 0.15s;
  font-family: var(--font-sans);
}

.input-sm::placeholder {
  color: var(--text-muted);
  font-size: 12px;
}

.input-sm:focus {
  border-color: var(--text-muted);
}


/* ─── Password switch ─── */

.pw-switch-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.pw-switch {
  width: 28px;
  height: 16px;
  background: var(--border);
  border-radius: var(--r-full);
  position: relative;
  transition: background 0.18s;
  flex-shrink: 0;
}

.pw-switch.on {
  background: var(--text-primary);
}

.pw-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: var(--r-full);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.18s;
}

.pw-switch.on::after {
  transform: translateX(12px);
}

/* ─── Password slide-down row ─── */

.pw-row {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.18s ease, opacity 0.18s ease;
  opacity: 0;
  padding: 0 24px;
  border-top: 1px solid transparent;
}

.pw-row[hidden] {
  display: grid !important;
}

.pw-row__inner {
  overflow: hidden;
  min-height: 0;
}

.pw-field {
  position: relative;
}

.pw-field__input {
  width: 100%;
  padding: 9px 110px 9px 12px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  outline: none;
  font-family: var(--font-sans);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.pw-field__input::placeholder {
  color: var(--text-muted);
}

.pw-field__input:focus {
  border-color: var(--text-muted);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .pw-field__input:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.pw-field__actions {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0;
}

.pw-field__sep {
  width: 1px;
  height: 14px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 2px;
}

.pw-field__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  color: var(--text-muted);
  transition: color 0.12s, background 0.12s;
}

.pw-field__btn:hover {
  color: var(--text-primary);
  background: var(--border-soft);
}

.pw-field__btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Eye toggle: show open-eye by default, off-eye when .showing */
.pw-eye-btn .eye-off-icon { display: none; }
.pw-eye-btn--showing .eye-icon { display: none; }
.pw-eye-btn--showing .eye-off-icon { display: block; }

.pw-row--open {
  grid-template-rows: 1fr;
  opacity: 1;
  padding-top: 12px;
  padding-bottom: 12px;
  border-top-color: var(--border-soft);
}

/* ─── Progress row (Variant D) ─── */

.progress-row-d {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-top: 1px solid var(--border-soft);
}

.progress-row-d[hidden] {
  display: none;
}

.progress-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-fill {
  height: 4px;
  background: var(--accent-success);
  border-radius: var(--r-full);
  width: 0%;
  transition: width 0.2s ease;
}

/* ─── Action row (Variant D) ─── */

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-soft);
}

.files-total {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.action-row__btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Result overlay (Variant D) ─── */

.result-overlay {
  border-top: 3px solid var(--accent-success);
}

.result-overlay[hidden] {
  display: none;
}

.result-overlay__inner {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-overlay__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-overlay__icon {
  width: 36px;
  height: 36px;
  background: var(--drop-ring-bg);
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-overlay__icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent-success);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-overlay__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.result-overlay__sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.qr-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.qr-row .result-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ─── Responsive ─── */

@media (max-width: 480px) {
  .page-main {
    padding: var(--sp-4) 16px var(--sp-6);
  }

  .site-tagline {
    display: none;
  }

  .upload-card,
  .download-card {
    border-radius: 10px;
  }

  .gone-card {
    padding: 36px 24px;
  }

  .link-row {
    flex-direction: column;
  }

  .link-row .btn-outline {
    width: 100%;
  }

  .file-list-dl__item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .file-list-dl__actions {
    align-self: stretch;
    justify-content: space-between;
  }

  .password-gate__form {
    flex-direction: column;
  }

  .password-gate__form .btn-primary {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════
   Download page — Variant D (receipt style)
═══════════════════════════════════════════════════════ */

.dl-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.dl-receipt {
  width: 100%;
  max-width: 540px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-surface);
  overflow: hidden;
}

/* ── Header ── */
.dl-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.dl-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.dl-head-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.dl-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-control);
  font-size: 11px;
  font-weight: 500;
  background: #dcfce7;
  color: #166534;
  white-space: nowrap;
  flex-shrink: 0;
}

[data-theme="dark"] .dl-status-badge {
  background: rgba(22, 163, 74, 0.15);
  color: #4ade80;
}

.dl-status-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: #16a34a;
}

[data-theme="dark"] .dl-status-dot {
  background: #4ade80;
}

.dl-head-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Meta grid ── */
.dl-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border-soft);
}

.dl-meta-item {
  padding: 12px 16px;
}

.dl-meta-item + .dl-meta-item {
  border-left: 1px solid var(--border-soft);
}

.dl-meta-k {
  font-size: 10px;
  font-weight: 500;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 3px;
}

.dl-meta-v {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.dl-meta-v-sm {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

/* ── Password bar ── */
.dl-pw-bar {
  padding: 11px 24px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fffbeb;
  cursor: default;
}

[data-theme="dark"] .dl-pw-bar {
  background: rgba(217, 119, 6, 0.08);
}

.dl-pw-bar-left {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #92400e;
}

[data-theme="dark"] .dl-pw-bar-left {
  color: #fbbf24;
}

.dl-pw-bar-left svg {
  stroke: #d97706;
  flex-shrink: 0;
}

.dl-pw-bar > svg {
  stroke: #d97706;
  flex-shrink: 0;
}

.dl-pw-body {
  padding: 12px 24px;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
}

[data-theme="dark"] .dl-pw-body {
  background: rgba(217, 119, 6, 0.06);
  border-bottom-color: rgba(217, 119, 6, 0.2);
}

.dl-pw-form {
  display: flex;
  gap: 8px;
}

.dl-pw-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #fde68a;
  border-radius: var(--r-control);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
  min-width: 0;
}

.dl-pw-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

.dl-pw-submit {
  padding: 8px 16px;
  background: #92400e;
  color: #fff;
  border: none;
  border-radius: var(--r-control);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
}

.dl-pw-submit:hover {
  background: #78350f;
}

/* ── Files header ── */
.dl-files-head {
  padding: 8px 24px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dl-files-head-label,
.dl-files-head-size {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #a1a1aa;
}

/* ── File rows ── */
.dl-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-bottom: 1px solid var(--border-soft);
}

.dl-file-no {
  font-size: 12px;
  color: #d4d4d8;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  width: 22px;
  flex-shrink: 0;
}

[data-theme="dark"] .dl-file-no {
  color: #52525b;
}

.dl-file-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dl-file-size {
  font-size: 12px;
  color: #a1a1aa;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  margin-right: 8px;
}

.dl-btn-download {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}

.dl-btn-download:hover {
  background: var(--border);
}

.dl-btn-download--locked {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Total row ── */
.dl-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 24px;
  border-top: 2px solid var(--text-primary);
  border-bottom: 1px solid var(--border-soft);
}

.dl-total-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.dl-total-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ── Footer ── */
.dl-foot {
  padding: 16px 24px;
  background: var(--surface-raised);
  border-top: 1px solid var(--border-soft);
  display: flex;
  gap: 16px;
  align-items: center;
}

.dl-foot-link {
  flex: 1;
  min-width: 0;
}

.dl-foot-url {
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.dl-copy-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-control);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text-primary);
  cursor: pointer;
}

.dl-copy-btn:hover {
  background: var(--surface-raised);
}

.dl-qr-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dl-qr-wrap canvas {
  border-radius: 4px;
}

.dl-qr-hint {
  font-size: 11px;
  color: #a1a1aa;
  text-align: center;
}

/* ── Result overlay — uploading/error states ── */
.result-overlay__icon--uploading .result-icon-spinner {
  animation: spin 1s linear infinite;
}

.result-overlay__icon--error {
  background: rgba(225, 29, 72, 0.1);
}

/* ── Pending badge ── */
.dl-status-badge--pending {
  background: #fef3c7;
  color: #92400e;
}

[data-theme="dark"] .dl-status-badge--pending {
  background: rgba(217, 119, 6, 0.15);
  color: #fbbf24;
}

.dl-status-dot--pending {
  background: #d97706;
  animation: blink-dot 1.5s ease-in-out infinite;
}

@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Pending banner ── */
.dl-pending-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 12px;
  color: #92400e;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
}

[data-theme="dark"] .dl-pending-banner {
  background: rgba(217, 119, 6, 0.08);
  border-bottom-color: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
}

.dl-pending-spinner {
  flex-shrink: 0;
  animation: spin 1s linear infinite;
}

/* ── Upload failed block ── */
.dl-upload-failed {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  font-size: 13px;
  color: var(--error-text);
  background: var(--error-bg);
  border-top: 1px solid var(--error-border);
  border-bottom: 1px solid var(--error-border);
}

/* ── Pending file row ── */
.dl-file-row--pending .dl-file-name {
  color: var(--text-muted);
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .dl-head-title { font-size: 15px; }
  .dl-meta-grid { grid-template-columns: 1fr 1fr; }
  .dl-meta-item:last-child { grid-column: 1 / -1; border-left: none; border-top: 1px solid var(--border-soft); }
  .dl-foot { flex-direction: column; align-items: flex-start; }
  .dl-qr-wrap { align-self: center; }
}
}
