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

:root {
  --bg: #FAF8F5;
  --surface: #FFFDF9;
  --border: rgba(92, 82, 68, 0.12);
  --text: #2D2A26;
  --muted: rgba(45, 42, 38, 0.7);
  --accent: #5C6B55;
  --machine: #f0ede8;
  --machine-dark: rgba(45, 42, 38, 0.18);
  --plate: #F2EFE9;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 24px rgba(45, 42, 38, 0.06);
  --font: "Geist Sans", system-ui, sans-serif;
  --space-lg: 0.5rem;
}

[data-theme="dark"] {
  --bg: #1A1A1A;
  --surface: #1E1E1E;
  --border: rgba(255, 255, 255, 0.1);
  --text: #F2EFE9;
  --muted: rgba(242, 239, 233, 0.7);
  --accent: #6B8A62;
  --machine: #2A2A2A;
  --machine-dark: rgba(255, 255, 255, 0.12);
  --plate: #2E2E2E;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

/* Dark mode component overrides */
[data-theme="dark"] .upload-box {
  border-color: rgba(255, 255, 255, 0.3);
  background: var(--surface);
}

[data-theme="dark"] .upload-box:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .upload-box:active {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .upload-box.dragover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

/* Dark mode shredder styles */
[data-theme="dark"] .shredder-base {
  background: #3a3a3a; /* Tone 1: Darkest */
}

[data-theme="dark"] .shredder-body {
  background: #2a2a2a; /* Tone 2: Mid */
  border: 1px solid #404040;
}

[data-theme="dark"] .shredder-body::before {
  background: #333333; /* Tone 3: Lightest for top plate */
}

[data-theme="dark"] .shredder-hopper {
  background: #445544; /* Tone 1: Dark olive */
  border-color: #334433;
}

[data-theme="dark"] .shredder-hopper-inner {
  background: #223322; /* Tone 1: Darker inner */
}

[data-theme="dark"] .shredder-front {
  background: #3a3a3a; /* Tone 3: Mid tone */
}

[data-theme="dark"] .shredder-slot {
  background: #0a0a0a; /* High contrast slot */
  border: 2px solid #1a1a1a;
}

[data-theme="dark"] .shredder-slot-teeth {
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 3px,
    #333333 3px,
    #333333 5px
  );
}

[data-theme="dark"] .crank-arm {
  background: #505050; /* Simplified */
  border: 1px solid #404040;
}

[data-theme="dark"] .crank-handle {
  background: #484848; /* Simplified */
  border: 1px solid #383838;
}

[data-theme="dark"] .output-plate {
  background: linear-gradient(180deg, #323232 0%, #2a2a2a 100%);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .output-plate::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 60%);
}

[data-theme="dark"] .output-hint {
  background: transparent;
  box-shadow: none;
}

[data-theme="dark"] .btn-reset:not(:disabled):active {
  background: #2E2E2E;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem; /* 16px - Base font size */
  line-height: 1.6;
  font-feature-settings: 'kern' 1, 'liga' 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  margin: 0;
  padding: 0;
}

/* Background Ripple Effect */
.ripple-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 0;
  overflow: hidden;
}

.ripple-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(50, 56px);
  grid-template-rows: repeat(30, 56px);
  width: 100%;
  height: 100%;
  margin: 0;
}

.ripple-cell {
  border: 1px solid rgba(200, 200, 200, 0.4);
  background-color: rgba(245, 245, 245, 0.3);
  opacity: 0.5;
  transition: opacity 0.15s ease;
  will-change: transform, opacity;
  cursor: pointer;
  pointer-events: auto;
}

.ripple-cell:hover {
  opacity: 0.7;
}

.ripple-cell.ripple-active {
  animation: rippleEffect 0.6s ease-out forwards;
}

@keyframes rippleEffect {
  0% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.1);
  }
  100% {
    opacity: 0.2;
    transform: scale(1);
  }
}

/* Dark mode styles */
html[data-theme="dark"] .ripple-cell {
  border-color: rgba(100, 100, 100, 0.3);
  background-color: rgba(30, 30, 30, 0.2);
  opacity: 0.4;
}

html[data-theme="dark"] .ripple-cell:hover {
  opacity: 0.6;
}

html[data-theme="dark"] .ripple-cell.ripple-active {
  animation: rippleEffectDark 0.6s ease-out forwards;
}

@keyframes rippleEffectDark {
  0% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
  100% {
    opacity: 0.1;
    transform: scale(1);
  }
}

.top-banner {
  width: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0;
  overflow: hidden;
  position: relative;
  z-index: 10;
}

main {
  position: relative;
  z-index: 1;
  background: transparent;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  background: transparent;
}

html[data-theme="dark"], body[data-theme="dark"] {
  background: var(--bg);
}

html[data-theme="dark"] body::after, body[data-theme="dark"] body::after {
  background: radial-gradient(ellipse at center, transparent 0%, var(--bg) 70%);
}

/* Top Banner */
.top-banner {
  width: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0;
  overflow: hidden;
}

.marquee {
  overflow: hidden;
  white-space: nowrap;
}

.marquee-content {
  display: inline-block;
  white-space: nowrap;
  animation: marquee 25s linear infinite;
  font-size: 0.875rem; /* 14px - Multiple of 2px */
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.marquee-inner {
  font-size: 0.875rem; /* 14px - Multiple of 2px */
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.marquee-inner .material-icons-round {
  font-size: 0.75rem; /* 12px - Minimum size, multiple of 2px */
  vertical-align: middle;
  margin: 0 0.5rem;
  opacity: 0.8;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.top-banner-text {
  font-size: 0.875rem; /* 14px - Multiple of 2px */
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2.25rem 2rem;
}

/* Bento Layout */
.bento {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
  align-items: start;
}

/* Left column with stacked cards */
.bento-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Left: Info Card (dagn.space style) */
.bento-card {
  position: relative;
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.card-label {
  display: inline-block;
  font-size: 0.75rem; /* 12px - Minimum size, multiple of 2px */
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  align-self: flex-start;
}

.card-title {
  font-size: 1.625rem; /* 26px - Multiple of 2px */
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
  margin: 0;
}

.card-desc {
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.card-footer {
  font-size: 0.75rem;
  font-weight: var(--font-weight-regular);
  color: var(--muted);
  letter-spacing: 0.01em;
  margin-top: auto;
  padding-top: var(--space-lg);
}

.card-divider {
  height: 2px;
  background: rgba(224, 224, 224, 0.5);
  margin: 0.25rem 0;
}

[data-theme="dark"] .card-divider {
  background: rgba(64, 64, 64, 0.5);
}

.privacy-text {
  font-size: 0.75rem; /* 12px - Minimum size, multiple of 2px */
  font-weight: var(--font-weight-regular);
  color: var(--muted);
  line-height: 1.5;
  text-align: left;
  hyphens: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.privacy-card {
  padding: 0.75rem 1.25rem 0.75rem !important;
  gap: 0.25rem !important;
}

@media (max-width: 768px) {
  .privacy-text {
    font-size: 0.75rem;
    line-height: 1.6;
    text-align: left;
    text-wrap: balance;
  }
  
  .upload-text-main {
    font-size: 0.875rem; /* 14px - Multiple of 2px */
    line-height: 1.5;
    text-align: center;
    padding: 0 0.5rem;
  }
  
  .privacy-card {
    padding: 0.75rem 1rem 0.75rem !important;
  }
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(92, 107, 85, 0.25);
}

.toggle-track {
  display: flex;
  align-items: center;
  position: relative;
  width: 64px;
  height: 32px;
  border-radius: 16px;
  background: var(--bg);
  transition: background 0.3s;
}

.toggle-icon {
  position: relative;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s;
}

.toggle-icon .material-icons-round {
  font-size: 1.125rem; /* 18px - Multiple of 2px */
}

.toggle-sun {
  color: #C4A24E;
}

.toggle-moon {
  color: rgba(139, 157, 195, 0.4);
}

[data-theme="dark"] .toggle-sun {
  color: rgba(196, 162, 78, 0.4);
}

[data-theme="dark"] .toggle-moon {
  color: #ffffff;
}

.toggle-thumb {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  z-index: 1;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .toggle-thumb {
  transform: translateX(32px);
}

/* Card Controls Row */
.card-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

/* Language Toggle */
.lang-toggle {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 0.75rem;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font);
  font-size: 0.875rem; /* 14px - Multiple of 2px */
  font-weight: 600;
  color: var(--muted);
  transition: border-color 0.2s;
  line-height: 1;
}

.lang-toggle:hover {
  border-color: var(--accent);
}

.lang-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(92, 107, 85, 0.25);
}

.lang-option {
  transition: color 0.2s;
  padding: 0.25rem 0.25rem;
}

.lang-option.active {
  color: var(--text);
}

.lang-divider {
  color: var(--border);
  font-weight: 400;
}

/* Right: Shredder */
.bento-shredder {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 1.75rem 1.75rem 2rem;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (max-width: 768px) {
  .bento {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .bento-left {
    gap: 1.2rem; /* Match bento gap */
  }
  
  .actions {
    gap: 0.75rem;
    margin-top: 1rem; /* Reduced from 1.5rem */
  }
  
  .btn {
    font-size: 0.875rem; /* 14px - Multiple of 2px */
    padding: 0.65rem 1rem;
    min-width: 120px;
    flex: 1; /* Maintain fill behavior */
  }
  
  .btn-shred {
    font-size: 0.9375rem; /* 15px - Multiple of 1px but above minimum */
    padding: 0.75rem 1rem;
    min-width: 140px;
    flex: 2; /* Maintain 2/3 ratio */
  }
  
  .btn-reset {
    font-size: 0.875rem; /* 14px - Multiple of 2px */
    padding: 0.6rem 1rem; /* Add horizontal padding */
    min-width: 100px;
    flex: 1; /* Take 1/3 ratio */
  }
  
  #shred-canvas {
    min-width: 200px !important;
    min-height: 150px !important;
  }
}

@media (max-width: 420px) {
  .page {
    padding: 1.6rem 1.1rem;
  }

  .bento {
    gap: 1.2rem; /* Slightly smaller but consistent */
  }
  
  .bento-left {
    gap: 1.2rem; /* Match bento gap */
  }
  
  .actions {
    gap: 0.6rem;
    margin-top: 0.8rem; /* Reduced gap */
  }
  
  .btn {
    font-size: 0.875rem; /* 14px - Multiple of 2px */
    padding: 0.6rem 0.8rem;
    min-width: 100px;
    flex: 1; /* Maintain fill behavior */
  }
  
  .btn-shred {
    font-size: 0.875rem; /* 14px - Multiple of 2px */
    padding: 0.7rem 0.9rem;
    min-width: 120px;
    flex: 2; /* Maintain 2/3 ratio */
  }
  
  .btn-reset {
    font-size: 0.75rem;
    padding: 0.5rem 1rem; /* Add horizontal padding */
    min-width: 100px;
    flex: 1; /* Take 1/3 ratio */
    white-space: nowrap; /* Prevent text wrapping */
  }

  .bento-card {
    padding: 1.25rem 1rem 1.5rem;
    gap: 0.5rem;
  }

  .card-title {
    font-size: 1.375rem; /* 22px - Multiple of 2px */
  }

  .card-desc {
    font-size: 0.9375rem; /* 15px - Multiple of 1px but above minimum */
  }
}

/* Flow: upload → machine → output (shared perspective) */
.flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  perspective: none;
  perspective-origin: initial;
}

.stage,
.machine {
  transform-style: flat;
}

/* Upload box (blank box) – tilts back from bottom edge */
.stage {
  width: 100%;
}

.stage-upload {
  margin-bottom: 0.6rem;
  transform-origin: center bottom;
  transform: none;
}

.upload-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border: 1px dashed rgba(92, 92, 92, 0.5);
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(92, 107, 85, 0.15);
}

.upload-box:hover {
  border-color: rgba(17, 17, 17, 0.26);
  background: var(--surface);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.06);
}

.upload-box.confirmed {
  border-color: var(--accent);
  border-style: solid;
}

.upload-box:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(17, 17, 17, 0.06);
}

.upload-box.dragover {
  background: rgba(17, 17, 17, 0.02);
  border-color: rgba(17, 17, 17, 0.38);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.upload-box.loading {
  background: linear-gradient(
    90deg,
    #f8f7f4 0%,
    #f0efec 50%,
    #f8f7f4 100%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-style: solid;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.upload-placeholder {
  color: var(--muted);
  font-size: 0.9375rem; /* 15px - Multiple of 1px but above minimum */
  text-align: center;
  line-height: 1.6;
  padding: 1.5rem;
  transition: all 0.3s ease;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  height: 100%;
}

.upload-icon {
  font-size: 2.25rem; /* 36px - Multiple of 2px */
  color: var(--muted);
  opacity: 0.6;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.upload-text-main {
  font-size: 0.9375rem; /* 15px - Multiple of 1px but above minimum */
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
  text-align: center;
  hyphens: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.upload-text-sub {
  font-size: 0.8125rem; /* 13px - Multiple of 1px but above minimum */
  font-weight: 400;
  color: var(--muted);
  opacity: 0.7;
}

.upload-box:hover .upload-icon {
  opacity: 1;
  color: var(--accent);
  transform: translateY(-2px);
}

.upload-box:hover .upload-text-main {
  color: var(--accent);
}

.upload-box.dragover .upload-icon {
  opacity: 1;
  color: var(--accent);
  animation: breathe 0.8s ease-in-out infinite alternate;
}

.upload-box.dragover .upload-text-main {
  color: var(--accent);
}

@keyframes breathe {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-4px) scale(1.08); }
}

.upload-box.has-image .upload-placeholder {
  display: none;
}

.upload-preview {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
  background: transparent;
}

[data-theme="dark"] .upload-preview {
  background: var(--surface);
}

.upload-preview.sucking {
  animation: suckIntoShredder 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes suckIntoShredder {
  0% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  30% {
    transform: scale(0.8) translateY(10px);
    opacity: 0.9;
  }
  60% {
    transform: scale(0.6) translateY(25px);
    opacity: 0.7;
  }
  85% {
    transform: scale(0.3) translateY(45px);
    opacity: 0.4;
  }
  100% {
    transform: scale(0.1) translateY(70px);
    opacity: 0;
  }
}

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

.upload-box .upload-preview:not([hidden]) {
  display: block;
}

#file-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

/* Shredder machine (refined minimal illustration) */
.machine {
  margin: 0.9rem 0 0.65rem;
  flex-shrink: 0;
  transform-origin: center center;
  transform: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.95;
}

.machine:hover {
  transform: translateY(-1px);
  opacity: 1;
}

.machine.shredding {
  animation: shake 0.5s ease-in-out infinite alternate;
}

.machine.sucking {
  animation: shake 0.3s ease-in-out infinite alternate, glow 1.2s ease-in-out;
}

@keyframes glow {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.1);
  }
}

@keyframes shake {
  0% { transform: translateY(-1px); }
  100% { transform: translateY(1px); }
}

.shredder {
  position: relative;
  width: 140px;
}

.shredder-base {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 118px;
  height: 8px;
  background: #9f9b93; /* Tone 1: Darkest */
  border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.09);
}

.shredder-body {
  position: relative;
  width: 120px;
  height: 52px;
  margin: 0 auto;
  background: #f5f5f5; /* Tone 2: Lightest */
  border-radius: 10px 10px 8px 8px;
  border: 1px solid #e0e0e0; /* Subtle border */
  transition: all 0.3s ease;
  transform: translateZ(0);
  will-change: transform;
}

.shredder-body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: #ededed; /* Tone 3: Mid tone for top plate */
  border-radius: 10px 10px 0 0;
  pointer-events: none;
}

.shredding .shredder-body {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: translateZ(0) scale(1); }
  50% { transform: translateZ(0) scale(1.02); }
}

/* Hopper / feed (simplified) */
.shredder-hopper {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 18px;
  background: #4a5a4a; /* Tone 1: Dark olive */
  border-radius: 8px 8px 0 0;
  border: 1px solid #3d4a3d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 4px rgba(0, 0, 0, 0.15);
}

.shredder-hopper-inner {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 8px;
  background: #2a3a2a; /* Tone 1: Darker inner */
  border-radius: 4px;
}

/* Front face with emphasized slot */
.shredder-front {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 20px;
  background: #d7d3cb; /* Tone 3: Mid tone */
  border-radius: 4px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.shredder-slot {
  position: relative;
  width: 78px;
  height: 12px; /* Increased for emphasis */
  background: #e0e0e0; /* Light background for light mode */
  border-radius: 0 0 3px 3px;
  overflow: hidden;
  border: 2px solid #d0d0d0; /* Light border for light mode */
}

.shredder-slot-teeth {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 3px,
    #888888 3px,
    #888888 5px
  );
}

/* Output Plate */
.stage-output {
  margin-top: 0.4rem; /* Reduced from 0.75rem */
  transform-origin: center top;
  transform: none;
  transition: all 0.3s ease;
}

.output-plate {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  max-height: 240px;
  background: linear-gradient(180deg, #f3f3f3 0%, #ededed 100%);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transform: translateZ(0);
}

.output-plate.has-noodles {
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.05),
    0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px) translateZ(0);
}

.output-plate::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.65) 0%, rgba(255,255,255,0) 60%);
  pointer-events: none;
  border-radius: var(--radius-sm);
  z-index: 1;
}

.output-plate::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: calc(var(--radius-sm) - 8px);
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.08);
  pointer-events: none;
  z-index: 1;
  opacity: 1;
}

#shred-canvas {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: translateZ(0);
  display: block !important;
  visibility: visible !important;
  background: transparent;
}

.output-hint {
  position: absolute;
  margin: 0;
  z-index: 3;
  color: var(--muted);
  font-size: 0.9375rem; /* 15px - Multiple of 1px but above minimum */
  text-align: center;
  padding: 2rem 1.5rem;
  background: transparent;
  border-radius: 0;
  backdrop-filter: none;
  box-shadow: none;
  transition: all 0.3s ease;
  opacity: 0.9;
  max-width: 80%;
  line-height: 1.6;
}

.output-hint::before {
  content: '';
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 0.75rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b6760' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
  opacity: 0.7;
  background-size: contain;
}

.output-plate.has-noodles .output-hint {
  display: none;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 0.9375rem; /* 15px - Multiple of 1px but above minimum */
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  opacity: 0;
  animation: toastIn 0.4s ease forwards;
  white-space: nowrap;
}

.toast[hidden] {
  display: none;
}

.toast-icon {
  font-size: 1.25rem; /* 20px - Multiple of 2px */
  color: var(--accent);
}

@keyframes toastIn {
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Buttons */
.actions {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: 1rem; /* Reduced from 1.5rem */
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem; /* 15px - Multiple of 1px but above minimum */
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-width: 140px;
  line-height: 1;
  flex: 1; /* Make buttons fill available space */
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-shred.is-shredding {
  pointer-events: none;
  opacity: 0.6;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(45, 42, 38, 0.08);
}

.btn:not(:disabled):active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(92, 107, 85, 0.2);
}

/* Shred Button - Primary, takes more space */
.btn-shred {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(92, 107, 85, 0.18);
  font-size: 1.0625rem; /* 17px - Multiple of 1px but above minimum */
  padding: 0.85rem 1.5rem;
  min-width: 160px;
  flex: 2; /* Take 2/3 of space */
}

.btn-shred:disabled {
  background: #8B9688;
  border-color: #8B9688;
  color: rgba(255, 255, 255, 0.8);
}

.btn-shred:not(:disabled):hover {
  background: #4A5846;
  border-color: #4A5846;
  box-shadow: 0 12px 28px rgba(92, 107, 85, 0.25);
}

.btn-shred:not(:disabled):active {
  background: #3F4D3B;
  border-color: #3F4D3B;
  box-shadow: 0 4px 10px rgba(92, 107, 85, 0.15);
}

/* Reset Button - Secondary, takes less space */
.btn-reset {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  flex: 1; /* Take 1/3 of space */
  min-width: 100px;
}

.btn-reset:not(:disabled):hover {
  background: var(--bg);
  border-color: rgba(92, 82, 68, 0.25);
  box-shadow: 0 8px 18px rgba(45, 42, 38, 0.06);
}

.btn-reset:not(:disabled):active {
  background: #F2EFE9;
  border-color: rgba(92, 82, 68, 0.3);
  box-shadow: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .actions {
    gap: 0.75rem;
  }
  
  .btn {
    font-size: 0.875rem; /* 14px - Multiple of 2px */
    padding: 0.65rem 1rem;
    min-width: 120px;
  }
  
  .btn-shred {
    font-size: 0.9375rem; /* 15px - Multiple of 1px but above minimum */
    padding: 0.75rem 1rem;
    min-width: 140px;
  }
  
  .btn-reset {
    font-size: 0.875rem; /* 14px - Multiple of 2px */
    padding: 0.6rem 0.8rem;
    min-width: 100px;
  }
}

@media (max-width: 480px) {
  .actions {
    gap: 0.5rem;
  }
  
  .btn {
    font-size: 0.875rem; /* 14px - Multiple of 2px */
    padding: 0.6rem 0.8rem;
    min-width: 100px;
    white-space: nowrap; /* Prevent text wrapping */
  }
  
  .btn-shred {
    font-size: 0.875rem; /* 14px - Multiple of 2px */
    padding: 0.7rem 0.9rem;
    min-width: 120px;
  }
  
  .btn-reset {
    font-size: 0.75rem;
    padding: 0.5rem 0.7rem;
    min-width: 80px;
    white-space: nowrap; /* Prevent text wrapping */
  }
}

@media (max-width: 480px) {
  .bento {
    gap: 1rem; /* Consistent smaller spacing */
  }
  
  .bento-left {
    gap: 1rem; /* Match bento gap */
  }
  
  .actions {
    gap: 0.5rem;
    margin-top: 0.6rem; /* Reduced gap */
  }
  
  .btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.8rem;
    min-width: 80px;
    flex: 1; /* Maintain fill behavior */
    white-space: nowrap; /* Prevent text wrapping */
  }
  
  .btn-shred {
    font-size: 0.875rem; /* 14px - Multiple of 2px */
    padding: 0.65rem 0.8rem;
    min-width: 100px;
    flex: 2; /* Maintain 2/3 ratio */
  }
  
  .btn-reset {
    font-size: 0.75rem; /* 12px - Minimum size, multiple of 2px */
    padding: 0.45rem 1rem; /* Add horizontal padding */
    min-width: 80px;
    flex: 1; /* Take 1/3 ratio */
    white-space: nowrap; /* Prevent text wrapping */
  }
  
  .top-banner {
    padding: 0.6rem 1rem;
  }

  .top-banner-text {
    font-size: 0.75rem;
  }

  .page {
    padding: 1.5rem 1rem;
    max-width: 100%;
  }

  .bento-card {
    padding: 1.25rem 1rem 1.5rem;
    gap: 0.5rem;
  }

  .card-title {
    font-size: 1.375rem; /* 22px - Multiple of 2px */
  }

  .card-desc {
    font-size: 0.9375rem; /* 15px - Multiple of 1px but above minimum */
  }

  .flow {
    gap: 0.6rem;
  }

  .stage-upload {
    margin-bottom: 0.5rem;
  }

  .upload-box {
    max-height: 200px;
    aspect-ratio: 3/2;
  }

  .upload-placeholder {
    font-size: 0.9375rem; /* 15px - Multiple of 1px but above minimum */
    padding: 1rem;
  }

  .upload-placeholder::before {
    width: 40px;
    height: 40px;
    margin-bottom: 0.75rem;
  }

  .machine {
    margin: 0.75rem 0 0.5rem;
  }

  .stage-output {
    margin-top: 0.3rem; /* Further reduced for mobile */
  }

  .output-plate {
    max-height: 200px;
    aspect-ratio: 3/2;
  }

  .output-hint {
    font-size: 0.875rem; /* 14px - Multiple of 2px */
    padding: 1.5rem 1rem;
    max-width: 85%;
  }

  .output-hint::before {
    width: 32px;
    height: 32px;
    margin-bottom: 0.6rem;
  }

  .actions {
    gap: 0.6rem;
    margin-top: 0.6rem; /* Reduced from 1.25rem */
  }
}

@media (max-width: 380px) {
  .top-banner {
    padding: 0.5rem 0.75rem;
  }

  .top-banner-text {
    font-size: 0.75rem; /* 12px - Minimum size, multiple of 2px */
  }

  .page {
    padding: 1.25rem 0.9rem;
  }

  .bento-card {
    padding: 1.25rem 1rem 1.5rem;
  }

  .privacy-card {
    padding: 0.75rem 1rem 0.75rem !important;
  }
  
  .privacy-text {
    font-size: 0.75rem; /* 12px - Minimum size, multiple of 2px */
    line-height: 1.7;
    text-align: left;
    text-wrap: balance;
  }
  
  .upload-text-main {
    font-size: 0.875rem; /* 14px - Multiple of 2px */
    line-height: 1.6;
    text-align: center;
    padding: 0 0.5rem;
  }

  .card-title {
    font-size: 1.25rem; /* 20px - Multiple of 2px */
  }

  .card-desc {
    font-size: 0.875rem; /* 14px - Multiple of 2px */
  }

  .upload-box {
    max-height: 180px;
  }

  .output-plate {
    max-height: 180px;
  }
}

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