/* ══════════════════════════════════════════════
   TOXSCAN v2 — CYBERPUNK TERMINAL AESTHETIC
   ══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Bebas+Neue&family=IBM+Plex+Mono:wght@300;400;500;600&display=swap');

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

:root {
  --primary:    #a855f7;
  --primary-dim: rgba(168,85,247,0.15);
  --accent:     #ff3366;
  --accent-dim: rgba(255,51,102,0.15);
  --cyan:       #00e5ff;
  --green:      #00ff88;
  --yellow:     #ffcc00;
  --bg:         #060410;
  --surface:    rgba(255,255,255,0.028);
  --border:     rgba(255,255,255,0.07);
  --border-hi:  rgba(168,85,247,0.35);
  --text:       #e8ecf4;
  --muted:      rgba(200,210,230,0.55);
  --radius:     4px;
  --font-mono:  'IBM Plex Mono', monospace;
  --font-display: 'Bebas Neue', cursive;
  --font-code:  'Space Mono', monospace;
}

/* ── Base ─────────────────────────────────────────── */
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  overflow: hidden;
}

/* ── Canvas ───────────────────────────────────────── */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ── Scanlines ────────────────────────────────────── */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  animation: scanMove 8s linear infinite;
}
@keyframes scanMove {
  from { background-position: 0 0; }
  to   { background-position: 0 40px; }
}

/* ── Vignette ─────────────────────────────────────── */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.7) 100%);
}

/* ── Corner decorations ───────────────────────────── */
.corner {
  position: fixed;
  width: 40px;
  height: 40px;
  z-index: 10;
  pointer-events: none;
}
.corner-tl { top: 12px; left: 12px; border-top: 1px solid rgba(168,85,247,0.4); border-left: 1px solid rgba(168,85,247,0.4); }
.corner-tr { top: 12px; right: 12px; border-top: 1px solid rgba(168,85,247,0.4); border-right: 1px solid rgba(168,85,247,0.4); }
.corner-bl { bottom: 12px; left: 12px; border-bottom: 1px solid rgba(168,85,247,0.4); border-left: 1px solid rgba(168,85,247,0.4); }
.corner-br { bottom: 12px; right: 12px; border-bottom: 1px solid rgba(168,85,247,0.4); border-right: 1px solid rgba(168,85,247,0.4); }

/* ── Status Bar ───────────────────────────────────── */
.status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 28px;
  background: rgba(0,0,0,0.6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 9px;
  font-family: var(--font-code);
  letter-spacing: 0.12em;
  color: var(--muted);
  backdrop-filter: blur(10px);
}
.status-left, .status-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}
.status-dot.blink {
  animation: blinkDot 2s ease-in-out infinite;
}
@keyframes blinkDot {
  0%,100% { opacity: 1; }
  50% { opacity: 0.2; }
}
.status-sep { opacity: 0.3; }

/* ── Layout ───────────────────────────────────────── */
.layout {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  height: 100vh;
  padding: 40px 16px 16px;
  overflow: hidden;
}

/* ── Panel base ───────────────────────────────────── */
.panel {
  background: rgba(6,4,16,0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 0 60px rgba(0,0,0,0.6),
    0 0 120px rgba(168,85,247,0.03);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: panelReveal 0.8s cubic-bezier(0.22,1,0.36,1) both;
}
.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168,85,247,0.5), transparent);
}
@keyframes panelReveal {
  from { opacity: 0; transform: translateY(20px) scale(0.98); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.panel-label {
  font-family: var(--font-code);
  font-size: 8px;
  letter-spacing: 0.2em;
  color: rgba(168,85,247,0.5);
  padding: 10px 16px 0;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════
   STATS PANEL
   ══════════════════════════════════════════════ */
.stats-panel {
  width: 260px;
  flex-shrink: 0;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 16px;
  animation-delay: 0.05s;
}
.stats-panel::-webkit-scrollbar { width: 2px; }
.stats-panel::-webkit-scrollbar-thumb { background: var(--border); }

/* Gauge */
.gauge-section {
  padding: 16px 16px 0;
}
.gauge-wrap {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.gauge-svg {
  width: 100%;
  height: auto;
}

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 16px;
}
.stat-cell {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: border-color 0.3s;
}
.stat-cell:hover { border-color: var(--border-hi); }
.stat-val {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  color: white;
  letter-spacing: 0.02em;
  transition: color 0.5s;
}
.stat-val.toxic-val { color: var(--accent); }
.stat-val.safe-val  { color: var(--green); }
.stat-key {
  font-size: 8px;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
}

/* Breakdown */
.breakdown-section {
  padding: 0 16px 12px;
}
.section-label {
  font-size: 8px;
  letter-spacing: 0.2em;
  color: rgba(168,85,247,0.45);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.category-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.breakdown-empty {
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
}
.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: fadeSlide 0.4s both;
}
.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.breakdown-name {
  font-size: 10px;
  color: rgba(200,212,235,0.65);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.breakdown-pct {
  font-size: 10px;
  font-family: var(--font-code);
}
.breakdown-bar {
  height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}
.breakdown-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width 1s cubic-bezier(0.22,1,0.36,1);
}
.breakdown-fill.toxic-fill { background: linear-gradient(90deg, #ff3366, #ff8c69); }
.breakdown-fill.safe-fill  { background: linear-gradient(90deg, var(--primary), #6366f1); }

/* Sparkline */
.spark-section {
  padding: 0 16px;
}
.sparkline {
  width: 100%;
  height: 50px;
  display: block;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ══════════════════════════════════════════════
   MAIN PANEL
   ══════════════════════════════════════════════ */
.main-panel {
  width: 420px;
  flex-shrink: 0;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  animation-delay: 0.1s;
}
.main-panel::-webkit-scrollbar { width: 2px; }
.main-panel::-webkit-scrollbar-thumb { background: var(--border); }

/* Header */
.panel-header {
  margin-bottom: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-mark {
  animation: rotateHex 20s linear infinite;
  display: flex;
}
@keyframes rotateHex {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.logo-title {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 0.08em;
  line-height: 1;
  background: linear-gradient(90deg, #fff 0%, rgba(168,85,247,0.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-sub {
  font-size: 7px;
  letter-spacing: 0.2em;
  color: rgba(168,85,247,0.5);
  margin-top: 2px;
}

/* Input Section */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.input-label {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(168,85,247,0.5);
  text-transform: uppercase;
}
.char-count {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-family: var(--font-code);
}

.textarea-wrap {
  position: relative;
}
textarea {
  width: 100%;
  height: 120px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px;
  color: #dde3f0;
  font-family: var(--font-code);
  font-size: 12px;
  line-height: 1.7;
  resize: none;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  caret-color: var(--primary);
}
textarea::placeholder {
  color: rgba(200,210,230,0.28);
  font-style: italic;
}
textarea:focus {
  border-color: rgba(168,85,247,0.4);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.06), 0 0 30px rgba(168,85,247,0.06);
}

/* Corner accents on textarea */
.textarea-corner {
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
  opacity: 0.6;
}
.ta-tl { top: -1px; left: -1px; border-top: 2px solid var(--primary); border-left: 2px solid var(--primary); border-radius: 2px 0 0 0; }
.ta-tr { top: -1px; right: -1px; border-top: 2px solid var(--primary); border-right: 2px solid var(--primary); border-radius: 0 2px 0 0; }
.ta-bl { bottom: -1px; left: -1px; border-bottom: 2px solid var(--primary); border-left: 2px solid var(--primary); border-radius: 0 0 0 2px; }
.ta-br { bottom: -1px; right: -1px; border-bottom: 2px solid var(--primary); border-right: 2px solid var(--primary); border-radius: 0 0 2px 0; }

/* Analyze Button */
.analyze-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  width: 100%;
  border: 1px solid rgba(168,85,247,0.4);
  border-radius: var(--radius);
  background: transparent;
  color: white;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.15em;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.btn-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(168,85,247,0.12), rgba(255,51,102,0.08));
  transition: opacity 0.3s;
}
.btn-scanner {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(168,85,247,0.15), transparent);
  transition: left 0.6s ease;
}
.analyze-btn:hover {
  border-color: rgba(168,85,247,0.7);
  box-shadow: 0 0 25px rgba(168,85,247,0.2), inset 0 0 25px rgba(168,85,247,0.05);
}
.analyze-btn:hover .btn-scanner { left: 140%; }
.analyze-btn:active { transform: scale(0.99); }
.analyze-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.analyze-btn:disabled:hover .btn-scanner { left: -100%; }
.btn-icon {
  font-size: 16px;
  color: var(--primary);
  animation: iconPulse 2s ease-in-out infinite;
}
@keyframes iconPulse {
  0%,100% { text-shadow: 0 0 8px rgba(168,85,247,0.6); }
  50%      { text-shadow: 0 0 20px rgba(168,85,247,1); }
}
.btn-arrow {
  font-size: 10px;
  color: var(--primary);
  transition: transform 0.2s;
}
.analyze-btn:hover .btn-arrow { transform: translateX(4px); }

/* Loader */
#loader {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
#loader.visible { display: flex; }

.loader-line {
  height: 2px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
}
.loader-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transition: width 0.3s;
  position: relative;
}
.loader-progress::after {
  content: '';
  position: absolute;
  right: 0; top: 0;
  width: 20px; height: 100%;
  background: rgba(255,255,255,0.6);
  filter: blur(3px);
}
.loader-info {
  display: flex;
  justify-content: space-between;
}
.loader-label {
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--primary);
  text-transform: uppercase;
}
.loader-pct {
  font-size: 9px;
  font-family: var(--font-code);
  color: var(--muted);
}
.loader-steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lstep {
  font-size: 9px;
  color: rgba(200,210,230,0.32);
  font-family: var(--font-code);
  transition: color 0.3s;
  letter-spacing: 0.05em;
}
.lstep.active { color: var(--green); }
.lstep.done { color: rgba(0,255,136,0.35); }

/* Heatmap */
.heatmap-section {
  margin-bottom: 16px;
}
.heatmap-legend {
  font-size: 8px;
  margin-left: 8px;
  opacity: 0.6;
  font-style: normal;
}
.hl-safe  { color: var(--green); }
.hl-toxic { color: var(--accent); }
.heatmap {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  line-height: 1.8;
  font-family: var(--font-code);
  font-size: 12px;
  min-height: 50px;
}
.heatmap .word {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 2px;
  transition: all 0.3s;
  cursor: default;
}

/* Results */
.results-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-item {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  animation: fadeSlide 0.4s cubic-bezier(0.22,1,0.36,1) both;
  transition: border-color 0.3s;
}
.result-item:hover { border-color: rgba(168,85,247,0.25); }
.result-item.is-toxic {
  border-color: rgba(255,51,102,0.2);
  background: rgba(255,51,102,0.04);
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.result-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(200,212,235,0.7);
}
.result-badge {
  font-size: 10px;
  font-family: var(--font-code);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}
.result-badge.toxic {
  background: rgba(255,51,102,0.15);
  color: var(--accent);
  border: 1px solid rgba(255,51,102,0.3);
  animation: toxicPulse 2s ease-in-out infinite;
}
@keyframes toxicPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,51,102,0); }
  50% { box-shadow: 0 0 8px 2px rgba(255,51,102,0.15); }
}
.result-badge.safe {
  background: rgba(168,85,247,0.1);
  color: var(--primary);
  border: 1px solid rgba(168,85,247,0.2);
}
.bar-track {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), #6366f1);
  transition: width 1s cubic-bezier(0.22,1,0.36,1);
  position: relative;
}
.bar-fill.toxic {
  background: linear-gradient(90deg, #ff3366, #ff8c69);
}
.bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -60%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.6s 0.9s ease-out forwards;
}
@keyframes shimmer { from { left: -60%; } to { left: 110%; } }

/* Summary badge */
.result-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: 10px;
  animation: fadeSlide 0.4s both;
}
.result-summary.toxic-summary {
  background: rgba(255,51,102,0.07);
  border-color: rgba(255,51,102,0.3);
}
.result-summary.safe-summary {
  background: rgba(0,255,136,0.05);
  border-color: rgba(0,255,136,0.2);
}
.summary-icon { font-size: 20px; }
.summary-text-wrap { display: flex; flex-direction: column; gap: 2px; }
.summary-headline {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.1em;
}
.summary-sub { font-size: 9px; color: var(--muted); letter-spacing: 0.1em; }

.error-msg {
  color: var(--accent);
  font-size: 11px;
  padding: 12px;
  border: 1px solid rgba(255,51,102,0.2);
  border-radius: var(--radius);
  background: rgba(255,51,102,0.06);
  font-family: var(--font-code);
}

/* ══════════════════════════════════════════════
   HISTORY PANEL
   ══════════════════════════════════════════════ */
.history-panel {
  width: 260px;
  flex-shrink: 0;
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  animation-delay: 0.15s;
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.history-count {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
.clear-btn {
  font-family: var(--font-code);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 8px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  width: auto;
}
.clear-btn:hover {
  color: var(--accent);
  border-color: rgba(255,51,102,0.35);
  background: rgba(255,51,102,0.06);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-list::-webkit-scrollbar { width: 2px; }
.history-list::-webkit-scrollbar-thumb { background: var(--border); }

.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  height: 100%;
}
.history-empty span {
  font-size: 8px;
  opacity: 0.5;
  letter-spacing: 0.1em;
  text-transform: none;
}
.empty-animation {
  animation: emptyRotate 10s linear infinite;
  opacity: 0.4;
}
@keyframes emptyRotate {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}

/* History Card */
.history-card {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  animation: fadeSlide 0.4s cubic-bezier(0.22,1,0.36,1) both;
  position: relative;
  overflow: hidden;
}
.history-card::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 2px;
}
.history-card.has-toxic::before { background: var(--accent); }
.history-card.all-safe::before  { background: var(--green); }
.history-card:hover {
  border-color: rgba(168,85,247,0.3);
  background: rgba(168,85,247,0.04);
  transform: translateX(3px);
}
.card-text {
  font-size: 10px;
  font-family: var(--font-code);
  color: var(--text);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
  padding-left: 8px;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 8px;
}
.card-time {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.card-status {
  font-size: 8px;
  padding: 1px 6px;
  border-radius: 2px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-code);
}
.card-status.toxic-status {
  background: rgba(255,51,102,0.15);
  color: var(--accent);
}
.card-status.safe-status {
  background: rgba(0,255,136,0.1);
  color: var(--green);
}
.card-pills {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  padding-left: 8px;
  margin-top: 4px;
}
.pill {
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 2px;
  font-family: var(--font-code);
  letter-spacing: 0.04em;
  border: 1px solid;
}
.pill.toxic-pill { background: rgba(255,51,102,0.1); color: var(--accent); border-color: rgba(255,51,102,0.2); }
.pill.safe-pill  { background: rgba(168,85,247,0.08); color: var(--primary); border-color: rgba(168,85,247,0.15); }

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(10,8,24,0.95);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text);
  font-family: var(--font-code);
  z-index: 100;
  backdrop-filter: blur(20px);
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), opacity 0.4s;
  opacity: 0;
  pointer-events: none;
}
.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Shared ────────────────────────────────────────── */
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 900px) {
  html, body { overflow: auto; }
  .layout {
    flex-direction: column;
    align-items: center;
    height: auto;
    overflow: auto;
    padding: 40px 12px 40px;
  }
  .stats-panel, .main-panel, .history-panel {
    width: 100%;
    max-width: 480px;
    max-height: none;
  }
}
