/* ============================================================
   NOTES CLEANER — Stylesheet
   Built on the shared tokens.css + animations.css system,
   following the dashboard.css visual language (dark glass,
   Inter type, indigo signature glow, soft ambient orbs).
   ============================================================ */

@import "tokens.css";
@import "animations.css";


:root {
  --transition-fast:    var(--dur-fast);
  --transition-base:    var(--dur-base);
  --transition-slow:    var(--dur-slow);
  --transition-slower:  400ms;
  --transition-slowest: 600ms;
  --ease-in-out: var(--ease);

  --glass-bg:          var(--surface-1);
  --glass-bg-hover:    var(--surface-2);
  --glass-border:      var(--border-1);
  --glass-border-hover: var(--border-2);
  --glass-shadow: var(--shadow-md);
  --glass-blur: blur(28px) saturate(180%);

  --radius-full: var(--radius-pill);
  --color-white: #ffffff;
  --color-text-primary: var(--text);
  --color-text-secondary: var(--text-soft);

  /* Signature accent — matches the indigo used across dashboard.css */
  --signature: #6366f1;
  --signature-soft: #818cf8;
  --color-primary-500: var(--signature);
  --color-border-glow: rgba(99, 102, 241, 0.35);
  --shadow-glow: 0 0 32px rgba(99, 102, 241, 0.20);
  --gradient-brand: linear-gradient(135deg, var(--signature) 0%, #a855f7 100%);

  --color-success: var(--success);
  --color-error: var(--error);
  --color-warning: var(--warning);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--signature-soft);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection {
  background: rgba(99, 102, 241, 0.32);
  color: #fff;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* ============================================================
   AMBIENT SHELL BACKGROUND
   ============================================================ */
.shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.shell::before,
.shell::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(110px);
  will-change: transform;
}

.shell::before {
  width: 680px; height: 680px;
  top: -280px; right: -220px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.16) 0%, transparent 70%);
  animation: orbDrift 22s ease-in-out infinite;
}

.shell::after {
  width: 560px; height: 560px;
  bottom: -240px; left: -160px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.10) 0%, transparent 70%);
  animation: orbDrift 28s ease-in-out infinite reverse;
}

@keyframes orbDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 50px) scale(1.08); }
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 65% 55% at 50% 15%, black 25%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 65% 55% at 50% 15%, black 25%, transparent 100%);
}

/* ============================================================
   PAGE
   ============================================================ */
.page {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 88px) clamp(20px, 4vw, 24px) 96px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Header ── */
.tool-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  margin-bottom: 8px;
  animation: fadeInDown var(--transition-slow) var(--ease-spring) both;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, #1c1c22 0%, #0c0c0e 100%);
  border: 1px solid var(--border-1);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04), 0 12px 32px rgba(99, 102, 241, 0.18);
  position: relative;
  animation: floatSlow 5s ease-in-out infinite;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from 0deg, var(--signature), #a855f7, transparent 45%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spinSlow 6s linear infinite;
  opacity: 0.85;
}

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

.brand-mark svg {
  width: 26px; height: 26px;
  stroke: var(--signature-soft);
  fill: none;
  stroke-width: 1.6;
  position: relative;
  z-index: 1;
}

.tool-header h1 {
  font-size: clamp(30px, 4.4vw, 40px);
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
  color: var(--text);
}

.tool-header .subtitle {
  font-size: var(--text-md);
  color: var(--text-soft);
  max-width: 460px;
  line-height: 1.65;
}

/* ============================================================
   GLASS CARD BASE
   ============================================================ */
.glass-card {
  border: 1px solid var(--border-1);
  border-radius: var(--radius-2xl);
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}

/* ============================================================
   INPUT CARD
   ============================================================ */
.input-card {
  padding: clamp(20px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeInUp var(--transition-slow) var(--ease-spring) both;
  animation-delay: 90ms;
  transition: border-color var(--transition-base) var(--ease-in-out),
              box-shadow var(--transition-base) var(--ease-in-out);
}

.input-card.sweeping {
  border-color: rgba(99, 102, 241, 0.4);
}

.input-card.sweeping::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--signature), #a855f7, transparent);
  animation: sweepDown 1.1s var(--ease-in-out) infinite;
}

@keyframes sweepDown {
  0%   { top: 0; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ── Field group ── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: opacity var(--transition-base) var(--ease-in-out);
}

.field-group.is-locked {
  opacity: 0.38;
  pointer-events: none;
  filter: saturate(0.6);
}

/* ── Textarea ── */
.notes-textarea {
  width: 100%;
  min-height: 168px;
  max-height: 420px;
  resize: vertical;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-1);
  background: var(--surface-0);
  color: var(--text);
  font-size: var(--text-base);
  line-height: 1.65;
  transition: border-color var(--transition-base) var(--ease-in-out),
              background var(--transition-base) var(--ease-in-out),
              box-shadow var(--transition-base) var(--ease-in-out);
}

.notes-textarea::placeholder { color: var(--text-muted); }

.notes-textarea:hover { border-color: var(--border-2); }

.notes-textarea:focus {
  outline: none;
  border-color: var(--signature-soft);
  background: var(--surface-1);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.textarea-footer {
  display: flex;
  justify-content: flex-end;
}

.char-counter {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  transition: color var(--transition-fast) var(--ease-in-out);
}

.char-counter.near-limit { color: var(--warning); }

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-2), transparent);
}

/* ── Dropzone ── */
.dropzone {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--border-2);
  background: var(--surface-0);
  cursor: pointer;
  transition: border-color var(--transition-base) var(--ease-in-out),
              background var(--transition-base) var(--ease-in-out),
              transform var(--transition-fast) var(--ease-spring);
}

.dropzone:hover {
  border-color: var(--signature-soft);
  background: var(--surface-1);
}

.dropzone.drag-over {
  border-color: var(--signature);
  background: rgba(99, 102, 241, 0.08);
  transform: scale(1.008);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.dropzone.has-file {
  cursor: default;
  border-style: solid;
  border-color: var(--border-1);
}

#fileInput { position: absolute; inset: 0; opacity: 0; }

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 20px;
  text-align: center;
  pointer-events: none;
}

.dropzone-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  margin-bottom: 4px;
  transition: transform var(--transition-base) var(--ease-spring);
}

.dropzone:hover .dropzone-icon,
.dropzone.drag-over .dropzone-icon {
  transform: translateY(-3px);
}

.dropzone-icon svg {
  width: 20px; height: 20px;
  stroke: var(--text-soft);
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropzone-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
}

.dropzone-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.browse-link {
  color: var(--signature-soft);
  font-weight: var(--weight-semi);
  text-decoration: underline;
  text-underline-offset: 2px;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.dropzone-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── File preview ── */
.file-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  animation: scaleIn 260ms var(--ease-spring) both;
}

.file-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.file-icon svg {
  width: 18px; height: 18px;
  stroke: var(--signature-soft);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.file-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.file-remove {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-1);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast) var(--ease-in-out);
}

.file-remove:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.file-remove svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

.hidden { display: none !important; }

/* ============================================================
   CLEAN BUTTON
   ============================================================ */
.clean-btn {
  position: relative;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: var(--weight-semi);
  letter-spacing: -0.01em;
  color: #fff;
  background: linear-gradient(135deg, var(--signature) 0%, #8b5cf6 100%);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.28), 0 0 0 1px rgba(255,255,255,0.06) inset;
  overflow: hidden;
  transition: transform var(--transition-fast) var(--ease-spring),
              box-shadow var(--transition-base) var(--ease-in-out),
              opacity var(--transition-base) var(--ease-in-out);
}

.clean-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.28), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition-base) var(--ease-in-out);
}

.clean-btn:hover:not(:disabled)::before { opacity: 1; }

.clean-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(99, 102, 241, 0.4), 0 0 0 1px rgba(255,255,255,0.08) inset;
}

.clean-btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }

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

.clean-btn-icon svg {
  width: 18px; height: 18px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.clean-btn-spinner {
  width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* Ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transform: scale(0);
  animation: rippleAnim 600ms var(--ease-out) forwards;
  pointer-events: none;
}

@keyframes rippleAnim {
  to { transform: scale(3.2); opacity: 0; }
}

/* ============================================================
   LOADING CARD
   ============================================================ */
.loading-card {
  padding: 44px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn var(--transition-slow) var(--ease-spring) both;
}

.loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
  max-width: 340px;
}

.loading-ring {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 3px solid var(--border-1);
  border-top-color: var(--signature);
  border-right-color: var(--signature-soft);
  animation: spin 0.9s linear infinite;
}

.loading-status {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-soft);
  text-align: center;
  min-height: 20px;
}

.progress-track {
  width: 100%;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--surface-1);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 8%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--signature), #a855f7);
  transition: width 700ms var(--ease-in-out);
}

/* ============================================================
   OUTPUT CARD
   ============================================================ */
.output-card {
  padding: clamp(20px, 4vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeInUp var(--transition-slow) var(--ease-spring) both;
}

.output-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-0);
}

.output-title-group { display: flex; align-items: center; gap: 10px; min-width: 0; }

.output-title-group svg {
  flex-shrink: 0;
  width: 18px; height: 18px;
  stroke: var(--success);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#outputTitle {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.output-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-1);
  background: var(--surface-1);
  color: var(--text-soft);
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  transition: all var(--transition-fast) var(--ease-spring);
}

.icon-action:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text);
  transform: translateY(-1px);
}

.icon-action:active { transform: translateY(0) scale(0.96); }

.icon-action svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.icon-action.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.icon-action.is-success {
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.35);
}

.output-body {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 6px;
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--text-soft);
  word-break: break-word;
}

.output-body::-webkit-scrollbar { width: 5px; }
.output-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; }

/* ── Rendered markdown typography ── */
.output-body > *:first-child { margin-top: 0; }
.output-body > *:last-child { margin-bottom: 0; }

.output-body p {
  margin: 0 0 14px;
}

.output-body h1,
.output-body h2,
.output-body h3,
.output-body h4,
.output-body h5,
.output-body h6 {
  color: var(--text);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 26px 0 12px;
}

.output-body h1 { font-size: var(--text-xl); }
.output-body h2 { font-size: var(--text-lg); }
.output-body h3 { font-size: var(--text-md); }
.output-body h4,
.output-body h5,
.output-body h6 {
  font-size: var(--text-base);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

.output-body ul,
.output-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.output-body li { color: var(--text-soft); }
.output-body li::marker { color: var(--signature-soft); }

.output-body hr {
  border: none;
  height: 1px;
  margin: 24px 0;
  background: linear-gradient(90deg, transparent, var(--border-2), transparent);
}

.output-body blockquote {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 3px solid var(--signature);
  background: rgba(99, 102, 241, 0.06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-soft);
  font-style: italic;
}

.output-body strong { color: var(--text); font-weight: var(--weight-semi); }
.output-body em { font-style: italic; }

.output-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  color: var(--signature-soft);
}
/* ============================================================
   WHY SECTION — Notes Cleaner
   Drop this into your existing stylesheet.
   All classes are prefixed with .nc-why to avoid collisions.
   ============================================================ */

.nc-why {
  width: 100%;
  max-width: 900px;
  margin: 3rem auto 0;
  padding: 0 1rem;
}

.nc-why-heading {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
}

.nc-why-subheading {
  font-size: 0.975rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  margin: 0 0 2.5rem;
  max-width: 520px;
  margin-inline: auto;
  line-height: 1.6;
}

/* Grid: 3 cols on desktop, 2 on tablet, 1 on mobile */
.nc-why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 720px) {
  .nc-why-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .nc-why-grid {
    grid-template-columns: 1fr;
  }
}

/* Card — matches the glass-card aesthetic in the tool */
.nc-why-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.4rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nc-why-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

/* Icon container */
.nc-why-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
  flex-shrink: 0;
}

.nc-why-icon svg {
  width: 17px;
  height: 17px;
  color: rgba(255, 255, 255, 0.75);
}

/* Label */
.nc-why-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

/* Description */
.nc-why-desc {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.48);
  line-height: 1.6;
  margin: 0;
}
/* ============================================================
   TOASTS
   ============================================================ */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 280px;
  max-width: 380px;
  padding: 13px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-1);
  background: rgba(15, 15, 17, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-xl);
  font-size: var(--text-sm);
  color: var(--text);
  pointer-events: all;
  animation: toastIn 260ms var(--ease-spring) both;
}

.toast.leaving { animation: toastOut 200ms var(--ease-in) forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(8px) scale(0.95); }
}

.toast svg { flex-shrink: 0; width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; margin-top: 1px; }
.toast p { flex: 1; line-height: 1.5; }
.toast-close {
  flex-shrink: 0;
  color: var(--text-muted);
  padding: 2px;
  border-radius: 6px;
  transition: color var(--transition-fast) var(--ease-in-out), background var(--transition-fast) var(--ease-in-out);
}
.toast-close:hover { color: var(--text); background: var(--surface-1); }
.toast-close svg { width: 13px; height: 13px; margin: 0; }

.toast-success { border-color: rgba(34, 197, 94, 0.3); }
.toast-success svg:first-child { color: var(--success); }
.toast-error { border-color: rgba(239, 68, 68, 0.3); }
.toast-error svg:first-child { color: #f87171; }
.toast-info { border-color: rgba(99, 102, 241, 0.3); }
.toast-info svg:first-child { color: var(--signature-soft); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .page { padding: 40px 16px 72px; gap: 16px; }
  .tool-header h1 { font-size: 28px; }
  .output-actions { width: 100%; }
  .icon-action { flex: 1; justify-content: center; }
  .toast-stack { left: 16px; right: 16px; bottom: 16px; }
  .toast { min-width: unset; max-width: 100%; }
  .dropzone-content { padding: 28px 14px; }
}

@media (max-width: 400px) {
  .output-header { flex-direction: column; align-items: stretch; }
}

/* ── BOOKMARK BUTTON ── */
#bookmarkBtn.bookmarked {
    color: var(--text);
    border-color: var(--border-2);
    background: var(--surface-2);
}

#bookmarkBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}