/* Self-hosted fonts */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-latin-400-normal.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

/* toast notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--card-bg);
  color: var(--text-bright);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  border: 1px solid var(--primary-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  transition:
    transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  font-weight: bold;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.storage-text {
  cursor: pointer;
  text-decoration: underline dotted;
  transition: color 0.3s ease;
}

.storage-text:hover {
  color: var(--text-bright);
}

@keyframes breathe {
  0%,
  100% {
    box-shadow: 0 0 5px var(--primary-color);
  }
  50% {
    box-shadow: 0 0 20px var(--primary-color);
  }
}

.first-visit-glow {
  animation: breathe 3s infinite ease-in-out !important;
  border: 1px solid var(--primary-color) !important;
}

/* Theme Variables */
:root {
  /* Basic Mode Theme - Now the default theme */
  --background: #121212;
  --text: rgba(255, 255, 255, 0.87);
  --text-muted: rgba(255, 255, 255, 0.6);
  --text-bright: rgba(255, 255, 255, 1);
  --card-bg: rgba(30, 30, 30, 1);
  --card-hover: rgba(40, 40, 40, 1);
  --border: rgba(60, 60, 60, 1);
  --hover-border: rgba(80, 80, 80, 1);
  --button-bg: rgba(60, 60, 60, 1);
  --button-hover: rgba(80, 80, 80, 1);
  --highlight-bg: rgba(80, 80, 80, 1);
  --highlight-text: rgba(255, 255, 255, 1);
  --link-color: var(--primary-color);
  --link-hover: color-mix(in srgb, var(--primary-color), white 15%);
  --link-bright: color-mix(in srgb, var(--primary-color), white 30%);
  --primary-color: #90caf9;
  --notification-success-bg: rgba(76, 175, 80, 1);
  --notification-error-bg: rgba(244, 67, 54, 1);
  --notification-info-bg: rgba(33, 150, 243, 1);
  --input-bg: rgba(0, 0, 0, 0.2);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-12: 4rem;
}

/* Pink Theme */
[data-theme="pink"] {
  --background: #000000;
  --text: rgba(255, 192, 203, 0.85);
  --text-muted: rgba(255, 192, 203, 0.5);
  --text-bright: rgba(255, 192, 203, 0.95);
  --card-bg: rgba(255, 192, 203, 0.1);
  --card-hover: rgba(255, 192, 203, 0.15);
  --border: rgba(255, 192, 203, 0.2);
  --hover-border: rgba(255, 192, 203, 0.4);
  --button-bg: rgba(255, 192, 203, 0.15);
  --button-hover: rgba(255, 192, 203, 0.25);
  --highlight-bg: rgba(255, 192, 203, 0.3);
  --highlight-text: rgba(255, 255, 255, 0.95);
  --link-color: var(--primary-color);
  --link-hover: color-mix(in srgb, var(--primary-color), white 15%);
  --link-bright: color-mix(in srgb, var(--primary-color), white 30%);
  --primary-color: #ff9eb5;
  --notification-success-bg: rgba(80, 250, 123, 0.8);
  --notification-error-bg: rgba(255, 85, 85, 0.8);
  --notification-info-bg: rgba(255, 192, 203, 0.8);
}

/* White Theme */
[data-theme="white"] {
  --background: #000000;
  --text: rgba(255, 255, 255, 0.85);
  --text-muted: rgba(255, 255, 255, 0.5);
  --text-bright: rgba(255, 255, 255, 0.95);
  --card-bg: rgba(255, 255, 255, 0.1);
  --card-hover: rgba(255, 255, 255, 0.15);
  --border: rgba(255, 255, 255, 0.2);
  --hover-border: rgba(255, 255, 255, 0.4);
  --button-bg: rgba(255, 255, 255, 0.15);
  --button-hover: rgba(255, 255, 255, 0.25);
  --highlight-bg: rgba(255, 255, 255, 0.3);
  --highlight-text: rgba(255, 255, 255, 0.95);
  --link-color: var(--primary-color);
  --link-hover: color-mix(in srgb, var(--primary-color), white 15%);
  --link-bright: color-mix(in srgb, var(--primary-color), white 30%);
  --primary-color: #ffffff;
  --notification-success-bg: rgba(80, 250, 123, 0.8);
  --notification-error-bg: rgba(255, 85, 85, 0.8);
  --notification-info-bg: rgba(255, 255, 255, 0.8);
}

/* Rose Theme */
[data-theme="rose"] {
  --background: #000000;
  --text: rgba(255, 182, 193, 0.85);
  --text-muted: rgba(255, 182, 193, 0.5);
  --text-bright: rgba(255, 182, 193, 0.95);
  --card-bg: rgba(255, 182, 193, 0.1);
  --card-hover: rgba(255, 182, 193, 0.15);
  --border: rgba(255, 182, 193, 0.2);
  --hover-border: rgba(255, 182, 193, 0.4);
  --button-bg: rgba(255, 182, 193, 0.15);
  --button-hover: rgba(255, 182, 193, 0.25);
  --highlight-bg: rgba(255, 182, 193, 0.3);
  --highlight-text: rgba(255, 255, 255, 0.95);
  --link-color: var(--primary-color);
  --link-hover: color-mix(in srgb, var(--primary-color), white 15%);
  --link-bright: color-mix(in srgb, var(--primary-color), white 30%);
  --primary-color: #ffb6c1;
  --notification-success-bg: rgba(80, 250, 123, 0.8);
  --notification-error-bg: rgba(255, 85, 85, 0.8);
  --notification-info-bg: rgba(255, 182, 193, 0.8);
}

/* Wine Theme */
[data-theme="wine"] {
  --background: #000000;
  --text: rgba(193, 84, 108, 0.85);
  --text-muted: rgba(193, 84, 108, 0.5);
  --text-bright: rgba(193, 84, 108, 0.95);
  --card-bg: rgba(193, 84, 108, 0.1);
  --card-hover: rgba(193, 84, 108, 0.15);
  --border: rgba(193, 84, 108, 0.2);
  --hover-border: rgba(193, 84, 108, 0.4);
  --button-bg: rgba(193, 84, 108, 0.15);
  --button-hover: rgba(193, 84, 108, 0.25);
  --highlight-bg: rgba(193, 84, 108, 0.3);
  --highlight-text: rgba(255, 255, 255, 0.95);
  --link-color: var(--primary-color);
  --link-hover: color-mix(in srgb, var(--primary-color), white 15%);
  --link-bright: color-mix(in srgb, var(--primary-color), white 30%);
  --primary-color: #c1546c;
  --notification-success-bg: rgba(80, 250, 123, 0.8);
  --notification-error-bg: rgba(255, 85, 85, 0.8);
  --notification-info-bg: rgba(193, 84, 108, 0.8);
}

/* Peach Theme */
[data-theme="peach"] {
  --background: #000000;
  --text: rgba(255, 218, 185, 0.85);
  --text-muted: rgba(255, 218, 185, 0.5);
  --text-bright: rgba(255, 218, 185, 0.95);
  --card-bg: rgba(255, 218, 185, 0.1);
  --card-hover: rgba(255, 218, 185, 0.15);
  --border: rgba(255, 218, 185, 0.2);
  --hover-border: rgba(255, 218, 185, 0.4);
  --button-bg: rgba(255, 218, 185, 0.15);
  --button-hover: rgba(255, 218, 185, 0.25);
  --highlight-bg: rgba(255, 218, 185, 0.3);
  --highlight-text: rgba(255, 255, 255, 0.95);
  --link-color: var(--primary-color);
  --link-hover: color-mix(in srgb, var(--primary-color), white 15%);
  --link-bright: color-mix(in srgb, var(--primary-color), white 30%);
  --primary-color: #ffdab9;
  --notification-success-bg: rgba(80, 250, 123, 0.8);
  --notification-error-bg: rgba(255, 85, 85, 0.8);
  --notification-info-bg: rgba(255, 218, 185, 0.8);
}

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

::selection {
  background-color: var(--link-hover);
  color: var(--background);
}
::-moz-selection {
  background-color: var(--link-hover);
  color: var(--background);
}

body {
  background-color: var(--background);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

@keyframes flicker-in {
  0% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    filter: brightness(2);
  }
  50% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    filter: brightness(1.5);
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    filter: brightness(1);
  }
}

@keyframes glitch-in {
  0% {
    opacity: 0;
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes wave-in {
  0% {
    opacity: 0;
    transform: scale(0.9);
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes fade-rotate-in {
  0% {
    opacity: 0;
    transform: perspective(1000px) rotateX(-90deg);
  }
  100% {
    opacity: 1;
    transform: perspective(1000px) rotateX(0);
  }
}

@keyframes border-pulse {
  0% {
    border-color: var(--border);
  }
  50% {
    border-color: var(--link-color);
    box-shadow: 0 0 10px var(--card-hover);
  }
  100% {
    border-color: var(--border);
  }
}

.settings-group {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.settings-group h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--text-bright);
}

.toggle-group {
  display: flex;
  align-items: center;
}

.toggle-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.toggle-container input {
  margin-right: 0.75rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.toggle-label {
  font-size: 0.9rem;
  color: var(--text);
}

.noise-bg {
  position: fixed;
  top: -50%; left: -50%; right: -50%; bottom: -50%;
  width: 200%; height: 200vh;
  background: transparent url('noise.png') repeat 0 0;
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
  animation: noise-animation 0.2s infinite;
}
@keyframes noise-animation {
  0% { transform: translate(0,0) }
  10% { transform: translate(-5%,-5%) }
  20% { transform: translate(-10%,5%) }
  30% { transform: translate(5%,-10%) }
  40% { transform: translate(-5%,15%) }
  50% { transform: translate(-10%,5%) }
  60% { transform: translate(15%,0) }
  70% { transform: translate(0,10%) }
  80% { transform: translate(-15%,0) }
  90% { transform: translate(10%,5%) }
  100% { transform: translate(5%,0) }
}

/* OKLCH Gradient Background */
body.gradient-mode h1 {
  background: var(--gradient-primary, linear-gradient(135deg, oklch(70% 0.1 250), oklch(60% 0.15 200)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.gradient-mode .button-primary {
  background: var(--gradient-primary, linear-gradient(135deg, oklch(65% 0.1 250), oklch(55% 0.15 200)));
  border: none;
}

body.gradient-mode .upload-progress-bar,
body.gradient-mode .progress-fill {
  background: var(--gradient-primary, linear-gradient(90deg, oklch(65% 0.1 250), oklch(55% 0.15 200))) !important;
}

body.gradient-mode .file-item.success {
  border-image: var(--gradient-primary, linear-gradient(135deg, oklch(65% 0.1 250), oklch(55% 0.15 200))) 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
}

h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 3rem;
  margin-bottom: 0.5rem;
  text-align: center;
  color: var(--text-bright);
  font-weight: normal;
  text-wrap: balance;
}

/* Stream hero */
.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
  font-style: italic;
  transition: letter-spacing 0.4s ease, color 0.3s ease;
}

.hero-stream:hover .hero-subtitle {
  letter-spacing: 0.04em;
  color: var(--text);
}

.hero-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.75rem 0 0;
  opacity: 0.7;
}

/* Drop zone */
.drop-zone {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--button-bg);
  border: 2px dashed transparent;
  border-radius: 12px;
  cursor: pointer;
  padding: 3rem;
  text-align: center;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.drop-zone:hover,
.drop-zone:focus-visible {
  border-color: var(--text-muted);
  box-shadow: inset 0 0 35px rgba(0,0,0,0.3);
  outline: none;
}

.drop-zone p {
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
  transition: letter-spacing 0.25s ease;
}

.drop-zone:hover p,
.drop-zone:focus-visible p {
  letter-spacing: 0.06em;
}

.drop-zone-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.7;
  font-style: normal;
  margin: 0;
}

.drop-zone.drag-over {
  border-color: var(--primary-color);
  background: var(--button-hover);
}

.drop-zone.files-added {
  border-color: var(--primary-color);
  border-style: solid;
}

/* First visit glow animation */
.drop-zone.first-visit-glow {
  animation: glow-pulse 2s ease-in-out infinite;
  border-color: var(--primary-color);
}

@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(144, 202, 249, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(144, 202, 249, 0.6);
  }
}

/* main layout replaces .container */
main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--space-6);
}



.file-input {
  display: none;
}

.upload-history {
  display: none; /* Hidden - drawer is used instead */
  padding: var(--space-5) 0 var(--space-8);
}

#fileList {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

#fileList:empty {
  display: none;
}

.file-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  animation: slideIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0;
  min-height: 140px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes success-flash {
  0% {
    background-color: var(--card-bg);
    border-color: var(--border);
    opacity: 1;
  }
  50% {
    background-color: var(--card-bg);
    border-color: var(--border);
    opacity: 1;
  }
  100% {
    background-color: var(--card-bg);
    border-color: var(--border);
    opacity: 1;
  }
}

.file-item.success {
  animation: success-flash 1s ease-out forwards;
  opacity: 1;
}

.file-item:hover {
  border-color: var(--hover-border);
  background: var(--card-bg);
}

.file-name {
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.file-name a {
  color: var(--link-bright);
  text-decoration: none;
  transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.file-name a:hover {
  color: var(--text-bright);
}

.file-stats {
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  gap: 1rem;
}

/* Flip animation container */
.flip-container {
  perspective: 1000px;
  width: 100%;
  height: 40px;
  position: relative;
}

.flipper {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-container.flipped .flipper {
  transform: rotateX(180deg);
}

.flip-front,
.flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
}

.flip-back {
  transform: rotateX(180deg);
}

/* File preview thumbnail */
.file-preview {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  margin-right: 0.75rem;
  opacity: 0.85;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.file-preview:hover {
  opacity: 1;
  transform: scale(1.05);
}

.file-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.file-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.control-btn {
  background: var(--button-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 4px 10px;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.control-btn:hover {
  background: var(--button-hover);
  border-color: var(--hover-border);
  color: var(--text-bright);
}

.pause-btn {
  color: var(--primary-color);
  border-color: var(--primary-color);
}
.file-info-left {
  display: flex;
  align-items: center;
  flex: 1;
}

/* Image modal styles */
.image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  cursor: zoom-out;
}

.image-modal.show {
  display: block;
}

.image-modal img {
  position: absolute;
  max-width: calc(100vw - 100px);
  max-height: calc(100vh - 100px);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: zoom-in;
  transition: transform 0.3s ease;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
}

.image-modal img.zoomed {
  cursor: move;
}

.image-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  color: white;
  font-size: 24px;
  font-weight: bold;
}

.image-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

@keyframes blink-cursor {
  0%,
  49% {
    border-right-color: var(--text-bright);
  }
  50%,
  100% {
    border-right-color: transparent;
  }
}

.link-input {
  width: 100%;
  height: 40px; /* Fixed height for consistency */
  padding: 0 0.75rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-bright);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  cursor: text;
  user-select: all;
  text-align: left;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

@keyframes flow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

.upload-progress-wrapper {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  margin-top: 0.5rem;
}

.upload-progress-bar {
  width: 0%;
  height: 100%;
  background-color: var(--primary-color) !important;
  background-image: none !important;
  transition: width 0.1s linear;
  position: relative;
}

/* Shimmer overlay removed to eliminate tint effect */

/* Old text style removal or adjustment */
.upload-progress-text {
  /* Moving this out of the bar/wrapper visually */
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.link-input:focus {
  outline: none;
  border-color: var(--border);
  background: var(--input-bg);
}

.status {
  text-align: center;
  padding: 0.5rem;
  margin-top: 1rem;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s ease, background-color 0.3s ease;
}

.status.show {
  opacity: 1;
}

.migration-banner {
  padding: 0.6rem var(--space-5);
  font-size: 0.85rem;
  text-align: center;
  background: rgba(255, 85, 85, 0.1);
  color: var(--text-bright);
  width: 100%;
  border-radius: 0 !important;
  margin: 0;
  box-sizing: border-box;
  position: relative;
}
.migration-banner .small-text {
  font-size: 0.8rem;
  margin-top: 4px;
}
.migration-banner.dismissed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.banner-dismiss {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.15s ease;
}
.banner-dismiss:hover {
  color: var(--text-bright);
}
footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.footer-left {
  flex: 1;
  text-align: left;
  margin-bottom: 0.5rem;
}
.footer-storage-info {
  cursor: pointer;
  text-decoration: underline dotted;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.footer-links {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  flex: 1;
}
.footer-btn {
  background: none;
  border: none;
  color: var(--link-bright);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.3s ease;
  padding: 0;
}
.footer-btn:hover {
  color: var(--text-bright);
}
.seo-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 5px;
  text-align: left;
}

@media (max-width: 640px) {
  /* Migration banner mobile */
  .migration-banner {
    padding: 0.5rem var(--space-3);
    font-size: 0.8rem;
  }
  .migration-banner .small-text {
    font-size: 0.7rem;
  }
  .banner-dismiss {
    right: var(--space-2);
    font-size: 1rem;
  }
  
  /* Hero section mobile */
  .hero-stream {
    padding: 0;
  }
  h1 {
    font-size: 2rem;
    max-width: 100vw;
  }
  .hero-subtitle {
    font-size: 0.85rem;
  }
  
  /* Drop zone mobile */
  .drop-zone {
    min-height: 140px;
    padding: 2rem 1rem;
  }
  .drop-zone p {
    font-size: 0.85rem;
  }
  .drop-zone-meta {
    font-size: 0.75rem;
  }
  
  /* Footer mobile */
  footer {
    flex-direction: column;
    padding: 1.25rem 1rem;
    align-items: center;
    text-align: center;
  }
  .footer-left {
    text-align: center;
    margin-bottom: 1rem;
  }
  .seo-text {
    text-align: center;
  }
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  .footer-btn {
    font-size: 0.85rem;
  }
  
  /* Modal mobile */
  .modal-content {
    width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.5rem 1rem;
  }
  
  /* Prevent horizontal overflow */
  body {
    overflow-x: hidden;
  }
}

.donate-button {
  background: var(--button-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  color: var(--text-bright);
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), letter-spacing 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-block;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  letter-spacing: 0;
  outline: none;
  animation: glitch-in 0.4s ease-out forwards;
  opacity: 0;
  animation-delay: 0.15s;
}

.donate-button:hover {
  background: var(--button-hover);
  border-color: var(--hover-border);
  box-shadow:
    inset 0 0 15px rgba(255, 255, 255, 0.1),
    0 0 10px var(--card-hover);
  letter-spacing: 0.05em;
  transform: scale(1.03);
}

.donate-button:focus {
  outline: none;
  border-color: var(--hover-border);
}

.footer a {
  color: var(--link-bright);
  text-decoration: none;
  transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.footer a:hover {
  color: var(--text-bright);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--background);
  border: 1px solid var(--border);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.95) translateY(10px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal.show .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    filter: blur(10px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: var(--text-bright);
}

/* Utilities Grid Layout - Optimized for horizontal space */
.utilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.utility-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: background-color 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: slideIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0;
  overflow-x: hidden;
  word-wrap: break-word;
  display: flex;
  flex-direction: column;
}

.utility-card pre,
.utility-card code {
  white-space: pre-wrap;
  word-break: break-all;
}

.utility-card:hover {
  border-color: var(--hover-border);
  background: var(--card-hover);
  transform: scale(1.02);
  box-shadow:
    0 0 20px rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.utility-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.utility-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.input-group {
  margin-bottom: 1rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
}

.input-field {
  width: 100%;
  padding: 0.75rem;
  background: var(--button-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-color: var(--hover-border);
  background: var(--button-hover);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05);
}

.input-field:focus:not(:focus-visible) {
  outline: none;
}

input[type="file"].input-field {
  cursor: pointer;
  padding: 0.5rem;
}

input[type="file"].input-field::-webkit-file-upload-button {
  background: var(--button-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  color: var(--text-bright);
  font-family: "Space Grotesk", sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  margin-right: 0.75rem;
}

input[type="file"].input-field::-webkit-file-upload-button:hover {
  background: var(--button-hover);
  border-color: var(--hover-border);
}

input[type="file"].input-field::file-selector-button {
  background: var(--button-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  color: var(--text-bright);
  font-family: "Space Grotesk", sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  margin-right: 0.75rem;
}

input[type="file"].input-field::file-selector-button:hover {
  background: var(--button-hover);
  border-color: var(--hover-border);
}

.button {
  background: var(--button-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  color: var(--text-bright);
  font-family: "Space Grotesk", sans-serif;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  font-size: 0.9rem;
  letter-spacing: 0;
}

.button:hover {
  background: var(--button-hover);
  border-color: var(--hover-border);
  box-shadow:
    inset 0 0 15px rgba(255, 255, 255, 0.1),
    0 0 10px var(--card-hover);
}

.button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-color: var(--hover-border);
}

.button:focus:not(:focus-visible) {
  outline: none;
}

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

.button-primary {
  background: var(--primary-color);
  color: var(--background);
  letter-spacing: 0;
}

.button-primary:hover {
  background: var(--link-hover);
  border-color: var(--link-hover);
  box-shadow:
    inset 0 0 15px rgba(255, 255, 255, 0.2),
    0 0 15px var(--primary-color);
}

.progress-container {
  margin-top: 1rem;
  display: none;
}

.progress-container.active {
  display: block;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--card-bg);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--primary-color);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

.status-message.show {
  display: block;
}

.status-message.success {
  background: var(--notification-success-bg);
  color: white;
}

.status-message.error {
  background: var(--notification-error-bg);
  color: white;
}

.file-output {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.file-output a {
  color: var(--link-color);
  text-decoration: none;
  word-break: break-all;
}

.file-output a:hover {
  color: var(--link-hover);
}

/* Paste Preview Modal */
.paste-modal-content {
  max-width: 500px;
  padding: 2rem;
  text-align: center;
}

.paste-preview-container {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  max-height: 250px;
  overflow-y: auto;
  text-align: left;
}

.paste-preview-code {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text);
}

.paste-preview-placeholder {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--button-bg);
  border-radius: 4px;
}

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

  h1 {
    font-size: 2rem;
  }

  .utilities-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .utility-card {
    padding: 1rem;
  }
  
  /* Report form mobile */
  .report-card {
    padding: 1.5rem 1rem;
  }
  .form-group {
    margin-bottom: 1rem;
  }
  .template-btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }
  .success-message, .error-message {
    font-size: 0.85rem;
    padding: 0.75rem;
  }
}

/* Stream layout - minimal structure, no visual weight */
.hero-stream {
  text-align: center;
  padding: 0;
}

.upload-stream {
  padding: 0;
}

/* Upload History Drawer */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Settings Drawer (slides from left) */
.settings-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(400px, max(300px, 35vw));
  height: 100vh;
  background: var(--card-bg);
  box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
  transform: translateX(-100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s ease-in-out, visibility 0.3s ease;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-drawer.active {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.settings-drawer .drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.settings-drawer .drawer-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-family: var(--font-heading);
}

.settings-drawer .close-drawer {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.settings-drawer .close-drawer:hover {
  color: var(--text-bright);
}

.settings-drawer .drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.settings-drawer .drawer-body::-webkit-scrollbar {
  width: 6px;
}

.settings-drawer .drawer-body::-webkit-scrollbar-track {
  background: transparent;
}

.settings-drawer .drawer-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.settings-drawer .drawer-body::-webkit-scrollbar-thumb:hover {
  background: var(--hover-border);
}

.settings-drawer .settings-group {
  margin-bottom: 2rem;
}

.settings-drawer .settings-group h3 {
  font-size: 1rem;
  font-family: var(--font-heading);
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.settings-drawer .utility-description {
  font-size: 0.85rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.settings-drawer .input-group {
  margin-bottom: 1rem;
}

.settings-drawer .input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.settings-drawer .input-group .input-field {
  width: 100%;
  margin-top: 0.25rem;
}

.settings-drawer .drawer-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.settings-drawer .drawer-footer .button {
  width: 100%;
}

/* Color picker row in settings */
.settings-drawer .input-group.color-picker-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.settings-drawer .input-group.color-picker-group label {
  flex: 1;
}

.settings-drawer .color-picker-input {
  width: 60px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
  cursor: pointer;
}

.settings-drawer .color-picker-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.settings-drawer .color-picker-input::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.drawer {
position: fixed;
top: 0;
right: 0;
width: min(600px, max(320px, 40vw));
height: 100vh;
background: var(--card-bg);
box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
transform: translateX(100%);
visibility: hidden;
pointer-events: none;
transition: transform 0.3s ease-in-out, visibility 0.3s ease;
z-index: 1000;
display: flex;
flex-direction: column;
}

.drawer.active {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

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

.drawer-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-family: var(--font-heading);
}

.close-drawer {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.close-drawer:hover {
  color: var(--text-bright);
}

.drawer-controls {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-controls .input-field {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.drawer-controls .input-field:focus {
  outline: none;
  border-color: var(--primary-color);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.history-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
  font-style: italic;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--button-bg);
  border: 1px solid transparent;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.history-item:hover {
  background: var(--button-hover);
}

.history-preview {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.history-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.history-info {
  flex: 1;
  min-width: 0;
}

.history-name {
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.history-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.history-actions button {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.history-actions button:hover {
  background: var(--button-hover);
  border-color: var(--primary-color);
}

.history-actions button.delete-btn {
  border-color: var(--error-color, #f44336);
  color: var(--error-color, #f44336);
}

.history-actions button.delete-btn:hover {
  background: var(--error-color, #f44336);
  color: white;
}

/* Toggle Input */
.toggle-input {
  appearance: none;
  -webkit-appearance: none;
  width: 50px;
  height: 26px;
  background: var(--button-bg);
  border: 1px solid var(--border);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s;
  flex-shrink: 0;
}

.toggle-input::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.3s, background-color 0.3s;
}

.toggle-input:checked {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.toggle-input:checked::before {
  transform: translateX(24px);
  background: white;
}

.toggle-input:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Delete Confirmation Modal */
.modal-sm {
  max-width: 400px;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.button-danger {
  background: #f44336;
  color: white;
  border: none;
}

.button-danger:hover {
  background: #d32f2f;
}

/* Archive dropdown and provider buttons */
.archive-btn {
  background: var(--button-bg);
  border: 1px solid var(--border);
}

.archive-dropdown-menu {
  position: fixed;
  z-index: 10001;
  min-width: 200px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.archive-provider-btn {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--button-bg);
  color: var(--text);
  padding: 0.5rem 0.7rem;
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.archive-provider-btn:hover {
  background: var(--button-hover);
  border-color: var(--hover-border);
}

.archive-provider-btn.saved {
  opacity: 0.7;
  color: var(--text-muted);
}

.archive-provider-btn.failed {
  border-color: rgba(244, 67, 54, 0.4);
  color: #ff8a80;
}

.archive-provider-btn.saving {
  color: var(--primary-color);
}

.archive-provider-btn.progress-border {
  position: relative;
  overflow: hidden;
}

.archive-provider-btn.progress-border::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  padding: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  background-size: 200% 100%;
  animation: archive-border-progress 1.2s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

@keyframes archive-border-progress {
  0% {
    background-position: 0% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.archive-links {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.archive-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.8rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 4px;
  font-size: 0.72rem;
  text-decoration: none;
  color: var(--text-bright);
  background: var(--button-bg);
  border: 1px solid var(--border);
}

/* ponytail: CSS containment + GPU acceleration for animated UI */
.utility-card, .file-item, .drop-zone, .report-card, .translate-panel, .stat-card { contain: layout style paint; }
.file-item, .toast, .history-item, .modal, .drawer, .settings-drawer { backface-visibility: hidden; transform: translate3d(0,0,0); }
.donate-button, .button, .footer-btn, .submit-btn { backface-visibility: hidden; }

/* ponytail: reduced motion — disable all animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ponytail: mobile — detune animations */
@media (max-width: 768px) {
  .file-item { animation: none !important; opacity: 1 !important; }
  .utility-card { animation: none !important; opacity: 1 !important; }
  .doc-section { animation: none !important; opacity: 1 !important; }
}

.archive-link:hover {
  border-color: var(--primary-color);
}

.archive-status {
  font-size: 0.72rem;
}

.archive-status.saved {
  color: var(--text-muted);
}

.archive-status.failed {
  color: #ff8a80;
}

.archive-status.saving {
  color: var(--primary-color);
}

/* History bulk selection UI */
.history-item {
  position: relative;
}

.history-item.selected {
  border: 1px solid var(--primary-color);
  box-shadow: inset 0 0 0 1px rgba(144, 202, 249, 0.2);
}

.history-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.bulk-action-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--button-bg);
}

.bulk-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-right: 0.25rem;
}

.bulk-btn {
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
}

/* Blurred backdrop for modals */
.modal-blur {
  backdrop-filter: blur(10px);
}

@media (max-width: 640px) {
  .archive-dropdown-menu {
    min-width: 180px;
    max-width: calc(100vw - 20px);
  }

  .bulk-action-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Full-page drag-and-drop */
.full-page-drag-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
}

.full-page-drag-overlay::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  border: 3px dashed var(--primary-color);
  border-radius: 20px;
  pointer-events: none;
}

.full-page-drag-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==================== docs site styles ==================== */

html { scroll-behavior: smooth; }

/* Site header */
.header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--background) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; height: 56px;
}
.site-logo {
  font-size: 1.25rem; font-weight: 700; color: var(--text-bright);
  text-decoration: none; letter-spacing: -0.02em; font-family: "Space Grotesk", sans-serif;
  transition: opacity 0.2s;
}
.site-logo:hover { opacity: 0.8; }
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.header-action {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; font-size: 1rem;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s;
}
.header-action:hover { opacity: 0.8; background: var(--card-bg); border-color: var(--hover-border); }

/* Sidebar */
.sidebar-toggle { display: none; }
.sidebar {
  position: fixed; top: 0; left: 0; z-index: 200;
  width: 280px; height: 100vh;
  background: var(--background);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.sidebar-header h2 { font-size: 1rem; font-weight: 600; color: var(--text-bright); }
.sidebar-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.5rem; cursor: pointer; line-height: 1;
  padding: 0.25rem; transition: opacity 0.2s;
}
.sidebar-close:hover { opacity: 0.8; }

.sidebar-nav { flex: 1; padding: 0.75rem; display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--text); text-decoration: none;
  padding: 0.6rem 0.75rem; border-radius: 8px;
  font-size: 0.875rem; transition: opacity 0.15s, background 0.15s;
}
.sidebar-link:hover { background: var(--card-bg); opacity: 0.85; }
.sidebar-link.active { background: var(--button-bg); color: var(--primary-color); font-weight: 500; }

.sidebar-group {
  padding: 0.5rem 0.75rem 0.25rem;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: color-mix(in srgb, var(--primary-color), transparent 50%);
}
.sidebar-indent { padding-left: 1.5rem; }
.sidebar-footer {
  padding: 1rem 1.25rem; border-top: 1px solid var(--border);
  display: flex; gap: 1rem;
}
.sidebar-footer a { color: var(--text-muted); font-size: 0.8rem; text-decoration: none; transition: opacity 0.2s; }
.sidebar-footer a:hover { opacity: 0.8; }

.sidebar-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,0.6);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

/* Main content */
.main {
  flex: 1; max-width: 900px; width: 100%;
  margin: 0 auto; padding: 3rem 2rem 4rem;
}
.main.home { max-width: 1000px; }

.breadcrumb {
  margin-bottom: 2rem; font-size: 0.85rem; color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: opacity 0.2s; }
.breadcrumb a:hover { opacity: 0.8; }
.breadcrumb .sep { margin: 0 0.5rem; opacity: 0.4; }

/* Markdown content */
.markdown { max-width: 100%; overflow-wrap: break-word; }

.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 {
  color: var(--text-bright); font-weight: 600; letter-spacing: -0.02em;
  position: relative; scroll-margin-top: 5rem;
  font-family: "Space Grotesk", sans-serif;
}
.markdown h1 { font-family: "Space Grotesk", sans-serif; font-size: 2.5rem; margin: 0 0 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.markdown h2 { font-size: 1.75rem; margin: 3rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.markdown h3 { font-size: 1.35rem; margin: 2.5rem 0 0.75rem; }
.markdown h4 { font-size: 1.1rem; margin: 2rem 0 0.5rem; }
.markdown h5 { font-size: 1rem; margin: 1.5rem 0 0.5rem; }
.markdown h6 { font-size: 0.9rem; margin: 1.5rem 0 0.5rem; color: var(--text-muted); }
.markdown h1:first-child, .markdown h2:first-child { margin-top: 0; }

.markdown p { margin: 1.25rem 0; line-height: 1.85; }
.markdown a {
  color: var(--primary-color); text-decoration: underline;
  text-underline-offset: 2px; text-decoration-thickness: 1px;
  transition: opacity 0.2s;
}
.markdown a:hover { opacity: 0.8; }
.markdown a:has(> code) { text-decoration: none; }

.markdown ul, .markdown ol { margin: 1rem 0; padding-left: 1.5rem; }
.markdown li { margin: 0.4rem 0; line-height: 1.7; }
.markdown li::marker { color: color-mix(in srgb, var(--primary-color), transparent 50%); }

.markdown blockquote {
  border-left: 3px solid color-mix(in srgb, var(--primary-color), transparent 50%);
  margin: 1.5rem 0; padding: 0.75rem 1.25rem;
  background: var(--card-bg); border-radius: 0 8px 8px 0;
  color: var(--text-muted); font-style: italic;
}

.markdown hr { border: none; height: 1px; background: var(--border); margin: 3rem 0; }

.markdown table {
  width: 100%; border-collapse: collapse; margin: 1.5rem 0;
  background: var(--card-bg); border-radius: 8px; overflow: hidden; font-size: 0.9rem;
}
.markdown th, .markdown td {
  padding: 0.6rem 1rem; text-align: left; border-bottom: 1px solid var(--border);
}
.markdown th { background: var(--button-bg); color: var(--primary-color); font-weight: 600; }
.markdown tr:last-child td { border-bottom: none; }
.markdown img { max-width: 100%; border-radius: 8px; margin: 1.5rem 0; }

.markdown pre {
  position: relative; margin: 1.5rem 0;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.markdown pre code {
  display: block; padding: 1.25rem; overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.825rem; line-height: 1.6; color: var(--text-bright);
  background: none; border: none; tab-size: 2;
}
.markdown code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em; padding: 0.2em 0.4em;
  background: var(--button-bg); border-radius: 4px; color: var(--text-bright);
}
.markdown pre code { padding: 1.25rem; font-size: 0.825rem; }

.copy-btn {
  position: absolute; top: 0.5rem; right: 0.5rem;
  padding: 0.35rem 0.7rem; font-size: 0.75rem;
  background: var(--button-bg); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-muted); cursor: pointer;
  font-family: inherit; opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}
.markdown pre:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { background: var(--button-hover); color: var(--text-bright); }
.copy-btn.copied { background: rgba(80, 250, 123, 0.15); color: #50fa7b; border-color: rgba(80, 250, 123, 0.3); }

.header-anchor {
  position: absolute; left: -1.75rem; top: 50%; transform: translateY(-50%);
  color: color-mix(in srgb, var(--primary-color), transparent 50%);
  font-size: 0.85rem; opacity: 0; transition: opacity 0.2s;
  padding: 0.15rem; background: none; border: none; cursor: pointer;
  font-family: inherit;
}
.markdown h1:hover .header-anchor,
.markdown h2:hover .header-anchor,
.markdown h3:hover .header-anchor,
.markdown h4:hover .header-anchor,
.markdown h5:hover .header-anchor,
.markdown h6:hover .header-anchor,
.header-anchor:focus-visible { opacity: 1; }
.header-anchor.copied { color: #50fa7b; }

.edit-link { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.edit-link a { color: var(--text-muted); font-size: 0.85rem; text-decoration: none; transition: opacity 0.2s; }
.edit-link a:hover { opacity: 0.8; }

/* Footer */
.footer {
  border-top: 1px solid var(--border); background: var(--card-bg);
}
.footer-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 1.5rem;
}
.footer p { color: var(--text-muted); font-size: 0.85rem; }
.footer a { color: var(--text-muted); text-decoration: none; transition: opacity 0.2s; }
.footer a:hover { opacity: 0.8; }
.footer-nav { display: flex; gap: 1.25rem; }
.footer-nav a { font-size: 0.85rem; }

/* Error page */
.error-page {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 4rem 2rem; text-align: center;
}
.error-code {
  font-family: "Space Grotesk", sans-serif;
  font-size: 6rem; font-weight: 700; color: var(--text-bright);
  line-height: 1; margin-bottom: 1rem;
}
.error-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem; color: var(--primary-color); margin: 1rem 0;
  text-shadow: 0 0 8px var(--primary-color); line-height: 1.3;
}
.error-message { color: var(--text-muted); font-size: 1.1rem; margin: 1rem 0 2rem; }
.error-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: 10px;
  background: var(--button-bg); border: 1px solid var(--border);
  color: var(--text-bright); text-decoration: none; font-size: 0.95rem;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s; font-family: inherit;
}
.error-btn:hover { opacity: 0.8; background: var(--button-hover); border-color: var(--hover-border); }

/* ponytail: CSS containment for perf */
.sidebar, .main, .header { contain: layout style; }

/* Sidebar responsive */
@media (min-width: 1024px) {
  .sidebar { transform: none; width: 240px; }
  .sidebar-overlay { display: none; }
  .main { margin-left: 240px; }
  .sidebar-toggle { display: none !important; }
}
@media (max-width: 1023px) {
  .sidebar-toggle { display: flex; }
}
@media (max-width: 768px) {
  .header-inner { padding: 0 1rem; }
  .site-logo { font-size: 1.1rem; }
  .main { padding: 2rem 1.25rem 3rem; }
  .markdown h1 { font-size: 2rem; }
  .markdown h2 { font-size: 1.5rem; }
  .markdown h3 { font-size: 1.2rem; }
  .markdown pre { margin: 1rem 0; }
  .markdown pre code { padding: 1rem; font-size: 0.8rem; }
  .footer-inner { flex-direction: column; gap: 0.75rem; text-align: center; }
  .error-code { font-size: 4rem; }
}
@media (max-width: 480px) {
  .main { padding: 1.5rem 1rem 2.5rem; }
  .markdown h1 { font-size: 1.75rem; }
  .markdown table { font-size: 0.8rem; }
  .markdown th, .markdown td { padding: 0.4rem 0.6rem; }
}
