/* =====================================================
   ShortLink — Style
   Design: Modern, friendly, soft shadows, vibrant accents
   ===================================================== */

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

/* ── TOKENS ────────────────────────────────────────── */
:root {
  --bg:        #0f1115;
  --bg-card:   #1a1d24;
  --bg-elev:   #232730;
  --border:    rgba(255, 255, 255, 0.08);
  --border-hov:rgba(255, 255, 255, 0.15);

  --text:      #f3f4f6;
  --text-mute: #9ca3af;
  --text-faint:#6b7280;

  --accent:    #c8ff3f; /* Vibrant lime */
  --accent-hov:#b2e638;
  --accent-bg: rgba(200, 255, 63, 0.1);

  --primary:   #6366f1; /* Soft Indigo */
  --primary-hov:#4f46e5;
  
  --danger:    #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --success:   #10b981;

  --sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 24px;
  --r-full: 9999px;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(200, 255, 63, 0.05);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* ── BG ANIMATION ──────────────────────────────────── */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  animation: float 20s infinite ease-in-out alternate;
}
.orb-1 {
  width: 40vw; height: 40vw;
  background: var(--primary);
  top: -10%; left: -10%;
}
.orb-2 {
  width: 30vw; height: 30vw;
  background: var(--accent);
  bottom: 10%; right: -5%;
  animation-delay: -5s;
}
.orb-3 {
  width: 25vw; height: 25vw;
  background: #a855f7; /* Purple */
  top: 40%; left: 40%;
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 10%) scale(1.1); }
  100% { transform: translate(-5%, -5%) scale(0.9); }
}

/* ── UTILS ─────────────────────────────────────────── */
.container { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* ── NAV ───────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(15, 17, 21, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-logo-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-a {
  color: var(--text-mute);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--r-full);
  transition: all 0.2s;
}
.nav-a:hover {
  color: var(--text);
  background: var(--border);
}

/* ── HERO ───────────────────────────────────────────── */
.hero {
  padding: 120px 0 80px;
  position: relative;
}

.hero-head {
  text-align: center;
  margin-bottom: 48px;
}
.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  padding: 6px 16px;
  border-radius: var(--r-full);
  margin-bottom: 20px;
  box-shadow: 0 4px 12px var(--accent-bg);
}
.hero-title {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.text-gradient {
  background: linear-gradient(135deg, var(--accent), #e4ff8f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--text-mute);
  max-width: 500px;
  margin: 0 auto;
}

/* ── FORM CARD (Soft UI) ───────────────────────────── */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* JS Hover Effect styling (Magnetic/Glow) */
.form-card::before {
  content: '';
  position: absolute;
  top: var(--y, 50%);
  left: var(--x, 50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle closest-side, rgba(200, 255, 63, 0.05), transparent);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.field {
  position: relative;
  z-index: 1;
  margin-bottom: 24px;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.field-label-dim {
  font-weight: 400;
  color: var(--text-faint);
}

.field-row {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all 0.2s;
}
.field-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.input-icon {
  padding-left: 16px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
}

.field-input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.95rem;
  outline: none;
}
.field-input::placeholder { color: var(--text-faint); }
.field-row .field-input { padding-left: 12px; }

.field-clear {
  position: absolute;
  right: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-mute);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.field-clear:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }

/* Slug split (side-by-side) */
.slug-split {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.slug-pre-box {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  padding: 0 16px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  max-width: 100%;
  overflow-x: auto;
}
.slug-pre {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text-mute);
  white-space: nowrap;
  user-select: none;
}
.slug-input-box {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: stretch;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all 0.2s;
  overflow: hidden;
}
.slug-input-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.slug-input {
  flex: 1;
  font-family: var(--sans);
  font-weight: 500;
  width: 100%;
}

.dice-btn {
  width: 48px;
  background: var(--bg-card);
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-mute);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.dice-btn:hover { background: var(--accent-bg); color: var(--accent); }
.dice-btn:active { transform: scale(0.9); }

.slug-status {
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  min-height: 18px;
}
.slug-status.ok  { color: var(--success); }
.slug-status.err { color: var(--danger); }

/* ── LIVE PREVIEW ──────────────────────────────────── */
.live-preview {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: var(--accent-bg);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

.lp-pulse {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  animation: pulse-dot 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(200, 255, 63, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(200, 255, 63, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 255, 63, 0); }
}

.lp-url-wrap {
  font-family: var(--mono);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lp-base  { color: var(--text-mute); }
.lp-slug  { color: var(--accent); }
.lp-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── SHORTEN BUTTON ────────────────────────────────── */
.shorten-btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: var(--r-md);
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.shorten-btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px var(--accent-bg);
}
.shorten-btn:active { transform: translateY(0); }
.shorten-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── RESULT ────────────────────────────────────────── */
.result-wrap {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  animation: fade-up 0.3s ease;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.result-check {
  width: 28px;
  height: 28px;
  background: rgba(16, 185, 129, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
}
.result-caption {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.result-new {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text-mute);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.result-new:hover { background: var(--bg-elev); color: var(--text); }

.result-body {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--r-md);
}
.result-link-box {
  flex: 1;
  min-width: 0;
}
.result-link {
  display: block;
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-link:hover { text-decoration: underline; }
.result-orig {
  font-size: 0.8rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--border);
  border: none;
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.copy-btn:hover { background: var(--border-hov); }
.copy-btn.copied { background: var(--success); color: #fff; }

/* ── HERO STATS ────────────────────────────────────── */
.hero-stats {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.hstat {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hstat-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
}
.hstat-info {
  display: flex;
  flex-direction: column;
}
.hstat-n {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.hstat-l {
  font-size: 0.8rem;
  color: var(--text-faint);
  font-weight: 500;
}
.hstat-sep {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ── FEATURES SECTION ──────────────────────────────── */
.features-section {
  padding: 80px 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.feat-header {
  text-align: center;
  margin-bottom: 48px;
}
.feat-header h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.feat-header p {
  color: var(--text-mute);
  font-size: 1.05rem;
}
.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 32px 24px;
  border-radius: var(--r-lg);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feat-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hov);
  box-shadow: var(--shadow-lg);
}
.feat-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.feat-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.feat-card p {
  font-size: 0.9rem;
  color: var(--text-mute);
  line-height: 1.6;
}

/* ── HISTORY ───────────────────────────────────────── */
.history-section { padding: 80px 0 100px; }

.hist-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.hist-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.hist-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.hist-sub {
  font-size: 0.9rem;
  color: var(--text-mute);
}

.hist-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 8px 16px;
  transition: border-color 0.2s;
}
.search-wrap:focus-within { border-color: var(--text-mute); }
.search-wrap svg { color: var(--text-faint); flex-shrink: 0; }
.search-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9rem;
  outline: none;
  width: 180px;
}
.search-input::placeholder { color: var(--text-faint); }

.clear-all-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text-mute);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.clear-all-btn:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }

/* History table */
#history-list { display: flex; flex-direction: column; gap: 12px; }

.hist-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color 0.2s, transform 0.2s;
  animation: slide-in 0.25s ease;
}
.hist-item:hover { border-color: var(--border-hov); transform: translateX(4px); }

.hist-initials {
  width: 40px;
  height: 40px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-mute);
  flex-shrink: 0;
  text-transform: uppercase;
}
.hist-info { flex: 1; min-width: 0; }
.hist-short-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.hist-link {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.hist-link:hover { text-decoration: underline; }
.hist-clicks {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.hist-orig {
  font-size: 0.85rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-date {
  font-size: 0.8rem;
  color: var(--text-faint);
  flex-shrink: 0;
}
.hist-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.hbtn {
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-mute);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.hbtn:hover { border-color: var(--text-mute); color: var(--text); }
.hbtn.del:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.hbtn.copied-flash { color: var(--success); border-color: var(--success); }

/* Empty state */
.hist-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 0;
  text-align: center;
}
.hist-empty-icon { color: var(--border-hov); margin-bottom: 8px; }
.hist-empty h3 { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.hist-empty p { font-size: 0.9rem; color: var(--text-mute); margin-bottom: 12px; }

.btn-primary-sm {
  padding: 8px 20px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary-sm:hover { background: var(--accent); }

/* ── FOOTER ────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  background: var(--bg-card);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.footer-logo {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
}
.footer-credit {
  font-size: 0.85rem;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  gap: 6px;
}
.builder-name {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

/* ── MODAL ─────────────────────────────────────────── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.2s ease;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-icon {
  width: 56px;
  height: 56px;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.modal-box h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 12px; }
.modal-box p { font-size: 0.95rem; color: var(--text-mute); margin-bottom: 28px; line-height: 1.5; }
.modal-btns { display: flex; gap: 12px; justify-content: center; }
.mbtn {
  padding: 10px 20px;
  border-radius: var(--r-full);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
}
.mbtn-ghost { background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); }
.mbtn-ghost:hover { background: var(--border); }
.mbtn-red { background: var(--danger); border: 1px solid transparent; color: #fff; }
.mbtn-red:hover { background: #dc2626; }

/* ── REDIRECT OVERLAY ──────────────────────────────── */
.redirect-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.redir-inner { text-align: center; max-width: 400px; padding: 24px; }
.redir-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.redir-label { font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; }
.redir-dest { color: var(--text-mute); font-family: var(--mono); font-size: 0.9rem; }
.redir-skip {
  display: inline-block;
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-faint);
  text-decoration: none;
}
.redir-skip:hover { color: var(--text); }

/* ── TOAST ─────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast.out { animation: toast-out 0.2s ease forwards; }
.toast-ok svg { color: var(--success); }
.toast-err svg { color: var(--danger); }
@keyframes toast-in  { from { opacity:0; transform:translateX(100%); } to { opacity:1; transform:translateX(0); } }
@keyframes toast-out { to   { opacity:0; transform:translateX(100%); } }

/* ── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 768px) {
  .feat-grid { grid-template-columns: 1fr; }
  .hist-header { flex-direction: column; }
  .search-wrap { width: 100%; }
  .search-input { width: 100%; }
}

@media (max-width: 480px) {
  .nav-links { display: none; }
  .hero-title { font-size: 2.2rem; }
  .form-card { padding: 24px 20px; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .hstat-sep { display: none; }
  .result-body { flex-direction: column; align-items: stretch; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* Utils */
.err { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-bg) !important; }
@keyframes shake {
  0%,100%{ transform: translateX(0); }
  20%    { transform: translateX(-6px); }
  40%    { transform: translateX(6px); }
  60%    { transform: translateX(-4px); }
  80%    { transform: translateX(4px); }
}
