:root {
  --bg-primary: #08080f;
  --bg-elevated: #0e0e1a;
  --bg-surface: rgba(255, 255, 255, 0.035);
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-active: rgba(255, 255, 255, 0.08);
  --text-primary: #f0f0f5;
  --text-secondary: #9090a5;
  --text-muted: #60607a;
  --accent: #6c6cf5;
  --accent-hover: #8585f8;
  --accent-soft: rgba(108, 108, 245, 0.12);
  --accent-glow: rgba(108, 108, 245, 0.2);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --error: #f87171;
  --error-soft: rgba(248, 113, 113, 0.12);
  --warning: #fbbf24;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(108, 108, 245, 0.3);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(108, 108, 245, 0.12);
  --easing: cubic-bezier(0.16, 1, 0.3, 1);
  --easing-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: 0.2s var(--easing);
  --transition-slow: 0.35s var(--easing);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #f5f5f8;
    --bg-elevated: #ffffff;
    --bg-surface: rgba(0, 0, 0, 0.02);
    --bg-hover: rgba(0, 0, 0, 0.04);
    --bg-active: rgba(0, 0, 0, 0.06);
    --text-primary: #1a1a2e;
    --text-secondary: #6c6c82;
    --text-muted: #9e9eb0;
    --accent: #5b5bd6;
    --accent-hover: #4a4ac0;
    --accent-soft: rgba(91, 91, 214, 0.08);
    --accent-glow: rgba(91, 91, 214, 0.15);
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 24px rgba(91, 91, 214, 0.08);
  }
}

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

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

::selection {
  background: var(--accent-soft);
  color: var(--text-primary);
}

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

/* ─── LAYOUT ─── */

.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

@media (min-width: 480px) {
  .container {
    padding: 2rem 1.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    padding: 2.5rem 2rem;
  }
}

/* ─── HEADER ─── */

header {
  margin-bottom: 1.25rem;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.logo-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
  flex-shrink: 0;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #818cf8, #a78bfa, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
}

@media (min-width: 480px) {
  .logo {
    font-size: 1.375rem;
  }
}

.lang-toggle {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition);
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

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

.subtitle {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 450;
  margin-top: 0.25rem;
  line-height: 1.5;
}

/* ─── STATS CARD ─── */

.stats-card {
    position: relative;
    background: var(--bg-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 2rem 1.5rem 1.75rem;
    margin-top: 1.5rem;
    margin-bottom: 0.875rem;
    text-align: center;
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
    animation: statsFadeIn 0.6s var(--easing);
}

.stats-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.stats-accent-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), #a78bfa, var(--accent), transparent);
    opacity: 0.7;
}

.stats-glow {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(108, 108, 245, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: statsGlowPulse 4s ease-in-out infinite;
}

@keyframes statsGlowPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.stats-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
    animation: statsFadeSlideUp 0.5s var(--easing) 0.1s both;
}

.stats-number-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    animation: statsFadeSlideUp 0.5s var(--easing) 0.2s both;
}

.stats-arrow {
    width: 1.75rem;
    height: 1.75rem;
    color: var(--success);
    flex-shrink: 0;
    opacity: 0.8;
}

.stats-number {
    font-size: 3.25rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    line-height: 1;
    background: linear-gradient(135deg, #818cf8, #a78bfa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 24px rgba(108, 108, 245, 0.25));
    transition: filter var(--transition-slow);
}

.stats-card:hover .stats-number {
    filter: drop-shadow(0 0 32px rgba(108, 108, 245, 0.4));
}

.stats-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
    animation: statsFadeSlideUp 0.5s var(--easing) 0.35s both;
}

.stats-number-inline {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    transition: color var(--transition);
}

.stats-card:hover .stats-number-inline {
    color: var(--accent);
}

@keyframes statsFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes statsFadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-color-scheme: light) {
    .stats-glow {
        background: radial-gradient(circle, rgba(91, 91, 214, 0.06) 0%, transparent 70%);
    }
    .stats-number {
        filter: drop-shadow(0 0 16px rgba(91, 91, 214, 0.2));
    }
    .stats-card:hover .stats-number {
        filter: drop-shadow(0 0 28px rgba(91, 91, 214, 0.35));
    }
}

@media (max-width: 480px) {
    .stats-card {
        padding: 1.5rem 1rem 1.25rem;
        margin-top: 1.25rem;
    }
    .stats-number {
        font-size: 2.5rem;
    }
    .stats-arrow {
        width: 1.375rem;
        height: 1.375rem;
    }
    .stats-text {
        font-size: 0.75rem;
    }
}

@media (min-width: 768px) {
    .stats-number {
        font-size: 3.75rem;
    }
}

/* ─── PERSISTENT RETRIEVE BAR ─── */

.retrieve-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.875rem;
  padding: 0.375rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.35s var(--easing), background 0.35s var(--easing), box-shadow 0.35s var(--easing);
}

.retrieve-bar:focus-within {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.retrieve-bar.success {
  border-color: rgba(52, 211, 153, 0.4);
  background: var(--success-soft);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.08);
}

.retrieve-bar.error {
  border-color: rgba(248, 113, 113, 0.4);
  background: var(--error-soft);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.08);
  animation: retrieveShake 0.35s var(--easing);
}

.retrieve-bar-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.retrieve-bar-input-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
}

.retrieve-bar-input {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.4rem 1.5rem;
  outline: none;
  min-width: 0;
}

.retrieve-bar-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
  font-size: 0.8125rem;
  opacity: 0.6;
}

.retrieve-bar-status-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  opacity: 0;
  transition: opacity 0.2s var(--easing);
  pointer-events: none;
}

.retrieve-bar-status-success {
  right: 0.25rem;
  color: var(--success);
}

.retrieve-bar-status-error {
  right: 0.25rem;
  color: var(--error);
}

.retrieve-bar.success .retrieve-bar-status-success,
.retrieve-bar.error .retrieve-bar-status-error {
  opacity: 1;
}

@keyframes retrieveShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.retrieve-bar-helper {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--error);
  margin-top: 0.35rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s var(--easing), transform 0.25s var(--easing);
  pointer-events: none;
  min-height: 1.2em;
  line-height: 1.4;
}

.retrieve-bar-helper.visible {
  opacity: 1;
  transform: translateY(0);
}

.retrieve-bar-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.3;
  white-space: nowrap;
}

.retrieve-bar-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.retrieve-bar-btn:active {
  transform: scale(0.97);
}

.retrieve-bar-btn svg {
  width: 1rem;
  height: 1rem;
}

/* ─── MAIN CARD ─── */

.main-card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem;
  width: 100%;
  transition: border-color var(--transition);
  animation: fadeSlideIn 0.35s var(--easing);
}

@media (min-width: 480px) {
  .main-card {
    padding: 1.5rem;
  }
}

/* ─── SEGMENTED CONTROL ─── */

.segmented-control {
  display: inline-flex;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  padding: 0.1875rem;
  gap: 0.125rem;
  margin-bottom: 1.125rem;
  border: 1px solid var(--border);
  width: 100%;
}

.seg-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.3;
  white-space: nowrap;
}

.seg-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.seg-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.seg-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.seg-btn.active:hover {
  background: var(--accent-hover);
}

/* ─── TAB CONTENT ─── */

.tab-panel {
  display: none;
  animation: fadeSlideIn 0.25s var(--easing);
}

.tab-panel.active {
  display: block;
}

/* ─── TEXT INPUT ─── */

.text-input-wrap {
  position: relative;
}

textarea {
  width: 100%;
  min-height: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.65;
  padding: 0.875rem;
  resize: vertical;
  outline: none;
  transition: var(--transition);
}

textarea:focus {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.char-count {
  position: absolute;
  bottom: 0.625rem;
  right: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.char-count.warning {
  color: var(--warning);
}

.char-count.over {
  color: var(--error);
}

/* ─── DROPZONE ─── */

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  padding: 2.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.dropzone:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  border-style: solid;
}

.dropzone-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.dropzone.dragover .dropzone-icon {
  color: var(--accent);
  transform: translateY(-3px) scale(1.05);
}

.dropzone-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.dropzone-browse {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dropzone-limits {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── FILE DETAILS ─── */

.file-details {
  margin-top: 0.875rem;
  animation: fadeSlideIn 0.25s var(--easing);
}

.file-details-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 0.875rem;
}

.file-details-icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--accent);
  flex-shrink: 0;
}

.file-details-meta {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.file-details-name {
  font-weight: 600;
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-details-size {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.05rem;
}

.file-details-remove {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.file-details-remove:hover {
  color: var(--error);
  background: var(--error-soft);
}

.file-details-remove svg {
  width: 1rem;
  height: 1rem;
}

/* ─── PROGRESS ─── */

.progress-wrap {
  margin-top: 1rem;
  animation: fadeSlideIn 0.2s var(--easing);
}

.progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.progress-track {
  background: var(--bg-elevated);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  height: 100%;
  width: 0%;
  transition: width 0.2s var(--easing);
  border-radius: 3px;
}

.progress-fill.indeterminate {
  width: 30% !important;
  animation: shimmer 1.5s ease-in-out infinite;
}

.progress-pct {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.2rem;
  text-align: right;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* ─── SUCCESS VIEW ─── */

.success-view {
  animation: popIn 0.4s var(--easing-spring);
}

.success-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.success-icon-wrap {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.success-icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--success);
}

.success-header-text {
  flex: 1;
  min-width: 0;
}

.success-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.15rem;
}

.success-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 450;
  line-height: 1.4;
}

/* ─── SHARE CARD ─── */

.share-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  transition: border-color var(--transition);
}

.share-card:hover {
  border-color: var(--border-hover);
}

.share-qr-wrap {
  flex-shrink: 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
  line-height: 0;
}

.share-qr-wrap:hover {
  box-shadow: 0 0 0 2px var(--border-accent);
}

.share-qr-wrap canvas {
  display: block;
  border-radius: var(--radius-sm);
  background: #fff;
  width: 88px;
  height: 88px;
  image-rendering: pixelated;
}

.share-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.share-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
}

.share-divider {
  height: 1px;
  background: var(--border);
}

.share-link-text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition);
}

.share-link-text:hover {
  color: var(--text-primary);
}

.share-code-text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.06em;
  user-select: all;
  cursor: pointer;
  transition: color var(--transition);
}

.share-code-text:hover {
  color: var(--accent);
}

.share-copy-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.share-copy-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
  border-color: var(--border-hover);
}

.share-copy-btn:active {
  transform: scale(0.92);
}

.share-copy-btn.copied {
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.3);
  background: var(--success-soft);
}

.share-copy-icon,
.share-copy-check {
  width: 1rem;
  height: 1rem;
}

.share-actions {
  display: flex;
  gap: 0.5rem;
}

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

/* ─── QR LIGHTBOX ─── */

.qr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--easing);
}

.qr-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.qr-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 15, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: backdrop-filter 0.35s var(--easing), background 0.35s var(--easing);
}

.qr-lightbox-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.9);
  transition: transform 0.35s var(--easing-spring);
}

.qr-lightbox.open .qr-lightbox-content {
  transform: scale(1);
}

.qr-lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: -0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.qr-lightbox-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.qr-lightbox-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.qr-lightbox canvas {
  display: block;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-lg);
  max-width: min(80vw, 400px);
  max-height: min(80vh, 400px);
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

@media (prefers-color-scheme: light) {
  .qr-lightbox-backdrop {
    background: rgba(245, 245, 248, 0.7);
  }
}

/* ─── RETRIEVE RESULT ─── */

.retrieve-result {
  animation: fadeSlideIn 0.3s var(--easing);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge svg {
  width: 0.75rem;
  height: 0.75rem;
}

.badge.text {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge.file {
  background: var(--success-soft);
  color: var(--success);
}

.expiry-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.text-display-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  margin-bottom: 1rem;
  overflow: auto;
  max-height: 420px;
}

.text-display {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.file-result-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.25rem;
  text-align: center;
  margin-bottom: 1rem;
}

.file-result-icon {
  width: 3.5rem;
  height: 3.5rem;
  color: var(--accent);
  margin: 0 auto 0.75rem;
}

.file-result-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  word-break: break-all;
  line-height: 1.3;
}

.file-result-size {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.action-row {
  display: flex;
  gap: 0.5rem;
}

.action-row .btn {
  flex: 1;
}

.result-back {
  text-align: center;
  margin-top: 1rem;
}

/* ─── BUTTONS ─── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-align: center;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
}

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

.btn-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
}



/* ─── RETRIEVE SPINNER ─── */

.retrieve-spinner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ─── SKELETON ─── */

.skeleton {
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

.skeleton-line {
  height: 0.75rem;
  margin-bottom: 0.5rem;
  width: 100%;
}

.skeleton-line:last-child {
  width: 65%;
}

.skeleton-block {
  height: 120px;
  width: 100%;
  margin-bottom: 0.75rem;
}

.skeleton-badge {
  width: 3rem;
  height: 1rem;
  display: inline-block;
}

@keyframes skeletonPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

/* ─── LOADING OVERLAY ─── */

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 8, 15, 0.65);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    opacity: 0;
    transition: opacity 0.35s var(--easing), backdrop-filter 0.35s var(--easing);
    pointer-events: none;
    will-change: opacity;
}

.loading-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.loading-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(108, 108, 245, 0.06);
    max-width: 340px;
    width: calc(100% - 2rem);
    position: relative;
    overflow: hidden;
}

.loading-accent-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), #a78bfa, transparent);
    opacity: 0.5;
}

.loading-loader {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
}

.loading-glow {
    position: absolute;
    inset: -16px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    animation: loadingGlowPulse 2s ease-in-out infinite;
    pointer-events: none;
}

.loading-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--accent), #a78bfa, #c084fc, var(--accent));
    padding: 2.5px;
    animation: loadingRingSpin 1s linear infinite;
    z-index: 2;
}

.loading-ring-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-elevated);
}

.loading-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    z-index: 3;
    animation: loadingDotPulse 1.5s ease-in-out infinite;
}

.loading-status {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
    transition: opacity 0.2s ease, transform 0.2s ease;
    min-height: 1.5em;
}

.loading-status.fade {
    opacity: 0;
    transform: translateY(6px);
}

.loading-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    line-height: 1.4;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
    animation: loadingHintIn 0.4s var(--easing);
}

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

@keyframes loadingGlowPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.85); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

@keyframes loadingDotPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.8); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

@keyframes loadingHintIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-color-scheme: light) {
    .loading-overlay {
        background: rgba(245, 245, 248, 0.7);
    }
    .loading-card {
        box-shadow: var(--shadow-lg), 0 0 60px rgba(91, 91, 214, 0.04);
    }
}

/* ─── TOAST ─── */

.toast-container {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(12px);
  transition: transform 0.3s var(--easing), opacity 0.2s var(--easing);
  pointer-events: auto;
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--error);
}

.toast.success {
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--success);
}

/* ─── CLIP VIEW PAGE ─── */

.clip-hero {
  text-align: center;
  margin-bottom: 1.25rem;
}

.clip-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.clip-hero-badge.file {
  background: var(--success-soft);
  color: var(--success);
}

.clip-hero-code {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.clip-hero-expiry {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ─── FOOTER ─── */

footer {
  text-align: center;
  padding-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 450;
}

/* ─── ANIMATIONS ─── */

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ─── RTL ─── */

[dir="rtl"] .header-top {
  flex-direction: row-reverse;
}

[dir="rtl"] .lang-toggle {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .retrieve-bar-icon {
  margin-left: 0;
  margin-right: 0.5rem;
}

[dir="rtl"] .retrieve-bar-status-success {
  right: auto;
  left: 0.25rem;
}

[dir="rtl"] .retrieve-bar-status-error {
  right: auto;
  left: 0.25rem;
}

[dir="rtl"] .char-count {
  right: auto;
  left: 0.75rem;
}

[dir="rtl"] .share-card {
  flex-direction: row-reverse;
}

[dir="rtl"] .share-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .qr-lightbox-close {
  right: auto;
  left: -0.5rem;
}

[dir="rtl"] .success-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .progress-pct {
  text-align: left;
}

[dir="rtl"] .text-display {
  direction: rtl;
}

[dir="rtl"] .retrieve-bar-input {
  direction: ltr;
}

[dir="rtl"] .retrieve-bar-helper {
  text-align: right;
}

[dir="rtl"] .file-details-card {
  flex-direction: row-reverse;
}

[dir="rtl"] .result-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .result-meta {
  flex-direction: row-reverse;
}

/* ─── REDUCED MOTION ─── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── RESPONSIVE ─── */

@media (max-width: 480px) {
  .container {
    padding: 0.875rem 0.75rem;
  }

  header {
    margin-bottom: 0.875rem;
  }

  .logo {
    font-size: 1.125rem;
  }

  .logo-icon {
    width: 1.3rem;
    height: 1.3rem;
  }

  .subtitle {
    font-size: 0.75rem;
  }

  .retrieve-bar {
    padding: 0.25rem;
    border-radius: var(--radius-md);
  }

  .retrieve-bar-input {
    font-size: 0.875rem;
    padding: 0.3rem 0.2rem;
  }

  .retrieve-bar-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.65rem;
  }

  .main-card {
    padding: 0.875rem;
    border-radius: var(--radius-lg);
  }

  .seg-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
  }

  .seg-btn svg {
    width: 0.875rem;
    height: 0.875rem;
  }

  textarea {
    min-height: 140px;
    font-size: 0.8125rem;
    padding: 0.75rem;
  }

  .share-card {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .share-qr-wrap canvas {
    width: 80px;
    height: 80px;
  }

  .share-fields {
    width: 100%;
  }

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

  .share-actions .btn {
    width: 100%;
  }

  .dropzone {
    padding: 1.75rem 1rem;
  }

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

  .action-row .btn {
    width: 100%;
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .toast {
    font-size: 0.75rem;
    padding: 0.45rem 0.9rem;
  }

  .clip-hero-code {
    font-size: 1.25rem;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .container {
    padding: 1.25rem 1rem;
  }
}

@media (min-width: 1025px) {
  .container {
    padding: 3rem 2rem;
  }
}

/* ─── MULTI-FILE UPLOAD ─── */

.file-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.file-list {
  margin: 0.25rem 0 0.75rem;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.5rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

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

.file-row-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent);
  flex-shrink: 0;
}

.file-row-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.file-row-name {
  font-size: 0.8125rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row-size {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.05rem;
}

.file-row-progress {
  width: 80px;
  flex-shrink: 0;
}

.file-progress-track {
  background: var(--bg-elevated);
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
}

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

.file-row-status {
  width: 2rem;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  flex-shrink: 0;
}

.file-row-remove {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.file-row-remove:hover {
  color: var(--error);
  background: var(--error-soft);
}

.file-row-remove svg {
  width: 0.875rem;
  height: 0.875rem;
}

.file-row-remove:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Upload progress per file */
.file-upload-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.75rem;
}

.file-upload-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-weight: 500;
}

.file-upload-progress .file-progress-track {
  width: 80px;
  flex-shrink: 0;
}

.file-upload-pct {
  width: 2.5rem;
  text-align: right;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.6875rem;
  flex-shrink: 0;
}

.file-upload-pct.success {
  color: var(--success);
}

.file-upload-pct.error {
  color: var(--error);
}

/* ─── SESSION VIEW ─── */

.session-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.session-meta-divider {
  color: var(--text-muted);
}

.session-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}

.session-file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.session-file-item:hover {
  border-color: var(--border-hover);
}

.session-file-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent);
  flex-shrink: 0;
}

.session-file-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.session-file-name {
  font-size: 0.8125rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-file-size {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.05rem;
}

.session-file-item .btn {
  flex-shrink: 0;
}

.session-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 1.5rem 0;
}

/* ─── FILE UPLOAD AREA ─── */

#file-upload-area {
  animation: fadeSlideIn 0.25s var(--easing);
}

/* Responsive */
@media (max-width: 480px) {
  .file-row {
    flex-wrap: wrap;
    gap: 0.375rem;
    padding: 0.375rem 0.25rem;
  }

  .file-row-progress {
    width: 60px;
  }

  .session-file-item {
    flex-wrap: wrap;
    padding: 0.5rem;
  }

  .session-file-item .btn {
    width: 100%;
    margin-top: 0.25rem;
  }

  .file-upload-progress {
    flex-wrap: wrap;
  }
}



/* ─── RTL OVERRIDES ─── */
[dir="rtl"] .file-row-icon {
  margin-left: 0.5rem;
  margin-right: 0;
}

[dir="rtl"] .file-upload-pct {
  text-align: left;
}

[dir="rtl"] .session-file-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .file-list-header {
  flex-direction: row-reverse;
}
