:root {
  /* Tone hierarchy: delta-tiles darkest, then lifetime, delta-panel, graph lightest */
  --bg-panel: rgba(42, 48, 56, 0.88);
  --bg-panel-alt: rgba(36, 42, 50, 0.90);
  --bg-panel-elevated: rgba(54, 62, 72, 0.88);
  --bg-panel-lifetime: rgba(44, 50, 60, 0.88);
  --bg-panel-graph: rgba(58, 66, 76, 0.88);
  --bg-panel-inner: rgba(18, 22, 26, 0.92);
  --text-primary: #f0ebe0;
  --text-secondary: #b8b2a8;
  --text-muted: #88847c;
  --accent: #b8992e;
  --accent-dim: #a89858;
  --delta-positive: #4ade80;
  --delta-negative: #b91c1c;
  --accent-red-bright: #ef4444;
  --border: #2a2e32;
  --border-light: #363b40;
  --font-mono: 'Share Tech Mono', 'Consolas', monospace;
  --font-display: 'Rajdhani', 'Segoe UI', sans-serif;
  --panel-radius: 3px;
  --panel-blur: 10px;
  --content-max: 1600px;
}

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

body {
  font-family: var(--font-display);
  background: #0a0c0e;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  inset: -8px;
  background-image:
    url('/images/background.avif'),
    radial-gradient(1200px circle at 25% 15%, rgba(184, 153, 46, 0.08), transparent 55%),
    radial-gradient(900px circle at 70% 40%, rgba(255, 255, 255, 0.04), transparent 60%),
    linear-gradient(180deg, #0b0d10, #07090b);
  background-position: center, center, center, center;
  background-size: cover, cover, cover, cover;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  filter: blur(7px) saturate(0.85) contrast(1.05);
  transform: scale(1.03);
  z-index: -2;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url('/images/noise.svg'),
    radial-gradient(ellipse at center, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.72) 72%, rgba(0,0,0,0.86) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.22), rgba(0,0,0,0.10)),
    linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55));
  background-repeat: repeat, no-repeat, no-repeat, no-repeat;
  background-size: 320px 320px, cover, cover, cover;
  background-blend-mode: overlay, normal, normal, normal;
  opacity: 0.95;
  z-index: -1;
}

/* Side navigation - always visible, easy to find */
.side-nav {
  width: 200px;
  min-width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem 0.75rem;
  background: linear-gradient(180deg, rgba(32,36,42,0.98) 0%, var(--bg-panel-alt) 100%);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);
}
.side-nav .logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 1px;
  text-decoration: none;
  text-transform: lowercase;
  line-height: 1.2;
  padding: 0.25rem 0.5rem;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}
.side-nav .logo span { color: var(--accent); }
.side-nav .logo:hover { color: var(--accent); border-left-color: var(--accent); }
.side-nav .logo:hover span { color: #b5a568; }

.side-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.side-nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.6rem 0.85rem;
  border-radius: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.side-nav-links a:hover {
  color: var(--text-primary);
  background: rgba(201, 162, 39, 0.08);
  border-left-color: var(--accent-dim);
}
.side-nav-links a.active {
  color: var(--accent);
  background: rgba(184, 153, 46, 0.25);
  border-left-color: var(--accent);
  box-shadow: inset 0 0 12px rgba(184, 153, 46, 0.15);
}

/* App body - header + main content */
.app-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Header - compact, brand only */
.site-header {
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  min-height: 36px;
  background: linear-gradient(180deg, rgba(40,46,54,0.98) 0%, var(--bg-panel-alt) 100%);
  border: none;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 6px rgba(0, 0, 0, 0.2);
}
.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 70%);
  opacity: 0.6;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.brand-title {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Main - max-width +15%, reduced side margins */
main {
  flex: 1;
  padding: 0.9rem 1rem;
  width: min(98%, var(--content-max));
  margin: 0 auto;
  position: relative;
  z-index: 0;
}

/* Page Title */
.page-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}
.page-title::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-dim), transparent);
}

/* Panels - rough tactical feel, inset, noise, bevel */
.panels { display: grid; grid-template-columns: 2fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; }
.panel {
  background: linear-gradient(180deg, rgba(48,54,62,0.98) 0%, var(--bg-panel) 8%, var(--bg-panel) 92%, rgba(24,28,34,0.98) 100%);
  border: 1px solid rgba(0,0,0,0.5);
  border-radius: var(--panel-radius);
  padding: 0.8rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.04),
    inset 0 -1px 2px rgba(0, 0, 0, 0.15),
    inset 1px 0 1px rgba(255, 255, 255, 0.02),
    inset -1px 0 1px rgba(0, 0, 0, 0.08),
    0 3px 12px rgba(0, 0, 0, 0.35);
}
.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dim) 40%, transparent 70%);
  opacity: 0.85;
  z-index: 1;
}
.panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/images/noise.svg');
  background-repeat: repeat;
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
  border-radius: inherit;
}
.panel-delta {
  background: linear-gradient(180deg, rgba(60,68,78,0.98) 0%, var(--bg-panel-elevated) 10%, var(--bg-panel-elevated) 100%);
  padding: 1rem;
}
.panel-delta .panel-title { color: var(--accent); font-size: 0.85rem; font-weight: 800; }
.panel-lifetime {
  background: linear-gradient(180deg, rgba(46,52,62,0.98) 0%, var(--bg-panel-lifetime) 8%, var(--bg-panel-lifetime) 100%);
}
.panel-lifetime .panel-title,
.panel-lifetime .stat-label { font-size: 0.65rem; }
.panel-title {
  font-size: 0.78rem;
  color: var(--accent-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

/* Delta Grid - darker tiles, stronger colors, heavier numbers */
.delta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 0.35rem 0;
}
.delta-item {
  text-align: center;
  padding: 1rem 0.5rem;
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 10%, transparent 90%, rgba(0,0,0,0.05) 100%),
    repeating-linear-gradient(118deg, transparent 0, transparent 2px, rgba(255,255,255,0.008) 2px, rgba(255,255,255,0.008) 3px),
    radial-gradient(ellipse 90% 90% at 50% 50%, transparent 40%, rgba(0,0,0,0.08) 100%),
    var(--bg-panel-inner);
  border: 1px solid rgba(0,0,0,0.35);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.06),
    inset 0 -1px 2px rgba(0, 0, 0, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}
.delta-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/images/noise.svg');
  background-repeat: repeat;
  opacity: 0.045;
  mix-blend-mode: overlay;
  pointer-events: none;
}
.delta-value {
  display: block;
  font-size: 3.9rem;
  font-weight: 900;
  font-family: var(--font-mono);
  line-height: 1.05;
}
.delta-label {
  display: block;
  font-size: 0.5rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.15rem;
}
.positive .delta-value { color: var(--delta-positive); text-shadow: 0 0 20px rgba(74, 222, 128, 0.5); }
.negative .delta-value { color: var(--delta-negative); text-shadow: 0 0 20px rgba(185, 28, 28, 0.5); }

/* Survival Rate - big standalone box, spans full width */
.survival-rate-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0.75rem 0;
  padding: 1.5rem 1.5rem;
  background: linear-gradient(180deg, rgba(184, 153, 46, 0.2) 0%, rgba(184, 153, 46, 0.08) 100%);
  border: 1px solid rgba(184, 153, 46, 0.45);
  border-radius: var(--panel-radius);
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.1),
    inset 0 -2px 4px rgba(0,0,0,0.15),
    0 0 40px rgba(184, 153, 46, 0.2),
    0 2px 8px rgba(0,0,0,0.25);
}
.survival-rate-box__value {
  display: block;
  font-size: 4.5rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 32px rgba(184, 153, 46, 0.6), 0 0 16px rgba(184, 153, 46, 0.4);
}
.survival-rate-box__label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 0.35rem;
}
.survival-rate-box--compact {
  margin: 0.5rem 0;
  padding: 0.9rem 1rem;
}
.survival-rate-box--compact .survival-rate-box__value { font-size: 2.5rem; }

/* K/D Row - Daily K/D + Lifetime small */
.kd-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.35rem 0;
}
.kd-item {
  text-align: left;
  padding: 0.4rem 0.85rem;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(0,0,0,0.2);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.03), 0 1px 3px rgba(0, 0, 0, 0.18);
}
.kd-item .kd-value { font-size: 1.1rem; }
.kd-label {
  display: block;
  font-size: 0.55rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.1rem;
}
.kd-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: var(--font-mono);
}
.kd-value.accent { color: var(--accent); text-shadow: 0 0 16px rgba(184, 153, 46, 0.4); }
.kd-value.positive { color: var(--delta-positive); }
.kd-value.negative { color: var(--delta-negative); }

/* Date label */
.date-label {
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}


/* Stats Grid - fill panel, larger stat boxes */
.panel-lifetime {
  display: flex;
  flex-direction: column;
}
.panel-lifetime .stats-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 6px;
  align-content: stretch;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 2px;
  overflow: hidden;
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.04),
    inset 0 -1px 1px rgba(0,0,0,0.08),
    0 1px 4px rgba(0,0,0,0.15);
}
.stat-item {
  text-align: center;
  padding: 0.85rem 0.4rem;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.panel-lifetime .stat-item {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025) 0%, transparent 40%, rgba(0,0,0,0.03) 100%),
    var(--bg-panel-lifetime);
  padding: 1rem 0.5rem;
  min-height: 64px;
  border: 1px solid rgba(0,0,0,0.2);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.04),
    inset 0 -1px 1px rgba(0,0,0,0.06),
    0 1px 2px rgba(0,0,0,0.1);
}
.stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}
.panel-lifetime .stat-value { font-size: 1.6rem; }
.stat-label {
  display: block;
  font-size: 0.55rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.15rem;
}

/* Comment */
.comment-block {
  margin-top: 0.6rem;
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--accent-dim);
  background: rgba(154, 143, 92, 0.06);
  border-radius: 0 2px 2px 0;
}
.comment-text { font-style: italic; color: var(--text-secondary); font-size: 0.9rem; }

/* Baseline */
.baseline-notice { color: var(--text-muted); font-style: italic; padding: 2rem 0; }

/* Empty state */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-state h2 { color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); }
.empty-state a { color: var(--accent); }

/* Update Section - rough tactical card */
.update-section {
  background: linear-gradient(180deg, rgba(58,66,76,0.98) 0%, var(--bg-panel-elevated) 10%, var(--bg-panel-elevated) 100%);
  border: 1px solid rgba(0,0,0,0.5);
  border-radius: var(--panel-radius);
  padding: 0.8rem 1rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.04),
    inset 0 -1px 2px rgba(0, 0, 0, 0.15),
    0 3px 12px rgba(0, 0, 0, 0.35);
}
.update-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dim) 40%, transparent 70%);
  opacity: 0.85;
  z-index: 1;
}
.update-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/images/noise.svg');
  background-repeat: repeat;
  opacity: 0.035;
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.update-section-inner { display: flex; gap: 0.6rem; align-items: stretch; margin-top: 0.4rem; }
.update-section-inner .paste-area { flex: 1; }
#stats-input {
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  font-family: var(--font-mono);
  background: rgba(12, 14, 18, 0.95);
  border: 1px solid #404850;
  border-radius: 2px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 52px;
}
#stats-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(184, 153, 46, 0.25);
}
#stats-input::placeholder { color: var(--text-muted); opacity: 0.6; }
.hint { font-size: 0.75rem; color: var(--text-secondary); letter-spacing: 0.5px; }
.error-msg { color: var(--accent-red-bright); font-size: 0.85rem; display: none; }
.error-msg.visible { display: block; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(6px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: linear-gradient(180deg, rgba(48,54,62,0.98) 0%, var(--bg-panel) 8%, var(--bg-panel) 100%);
  border: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 24px 48px rgba(0, 0, 0, 0.5);
  border-radius: var(--panel-radius);
  padding: 2rem;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  backdrop-filter: blur(calc(var(--panel-blur) + 2px));
  -webkit-backdrop-filter: blur(calc(var(--panel-blur) + 2px));
}
.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dim) 40%, transparent 70%);
  opacity: 0.85;
}
.modal::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/images/noise.svg');
  background-repeat: repeat;
  opacity: 0.03;
  mix-blend-mode: soft-light;
  pointer-events: none;
  border-radius: inherit;
}
.modal h2 { margin-bottom: 1.25rem; color: var(--text-primary); font-size: 1.1rem; }
.modal h3 {
  font-size: 0.7rem;
  color: var(--accent-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.modal-section { margin-bottom: 1.25rem; }
.modal-section label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.35rem;
}
.modal-section input[type="date"],
.modal-section input[type="number"],
.modal-section textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}
.modal-section input:focus,
.modal-section textarea:focus { border-color: var(--accent-dim); }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* Edit modal field grid */
.edit-fields { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.modal-section.half { flex: 1 1 calc(50% - 0.375rem); min-width: 140px; }

/* Parsed preview */
.parsed-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.parsed-item {
  text-align: center;
  padding: 0.45rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  border-radius: 2px;
}
.parsed-item .val { display: block; font-weight: 600; color: var(--text-primary); }
.parsed-item .lbl { display: block; font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Delta preview inside modal */
.delta-preview-container {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  border-radius: 2px;
  min-height: 60px;
}
.delta-preview-container .delta-grid { margin: 0; }
.delta-preview-container .delta-value { font-size: 1.3rem; }
.delta-preview-container .kd-row { margin: 0.75rem 0 0 0; padding: 0; gap: 0.4rem; }
.delta-preview-container .survival-rate-box--compact .survival-rate-box__value { font-size: 2rem; }
.delta-preview-container .kd-item .kd-value { font-size: 1.1rem; }

/* Buttons */
.btn-primary {
  padding: 0.65rem 1.5rem;
  background: var(--accent);
  color: #0a0a08;
  border: none;
  border-radius: 2px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary:hover { background: #c9a82e; transform: translateY(-1px); }
.btn-cta {
  padding: 1.25rem 1.85rem;
  font-size: 0.92rem;
  white-space: nowrap;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-cta:hover {
  background: #d4b030;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(184, 153, 46, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-secondary {
  padding: 0.65rem 1.5rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { color: var(--text-primary); border-color: var(--text-muted); }

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(48,54,62,0.98) 0%, var(--bg-panel) 8%, var(--bg-panel) 100%);
  border: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 32px rgba(0, 0, 0, 0.5);
  border-radius: 2px;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 300;
  animation: slideUp 0.3s ease;
}
.toast.hiding { animation: slideDown 0.3s ease forwards; }
.btn-undo {
  padding: 0.4rem 1rem;
  background: var(--accent-red-bright);
  color: #fff;
  border: none;
  border-radius: 2px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
}
.btn-undo:hover { opacity: 0.9; }

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes slideDown {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* History Layout */
.history-layout { display: grid; grid-template-columns: 200px 1fr; gap: 1rem; }
.date-list {
  background: linear-gradient(180deg, rgba(46,52,62,0.98) 0%, var(--bg-panel) 8%, var(--bg-panel) 100%);
  border: none;
  border-radius: var(--panel-radius);
  padding: 1rem;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  position: relative;
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 8px rgba(0, 0, 0, 0.25);
}
.date-list::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dim) 40%, transparent 70%);
  opacity: 0.85;
}
.date-list::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/images/noise.svg');
  background-repeat: repeat;
  opacity: 0.03;
  mix-blend-mode: soft-light;
  pointer-events: none;
  border-radius: inherit;
}
.date-link {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--panel-radius);
  font-size: 0.85rem;
  transition: all 0.15s;
  margin-bottom: 1px;
}
.date-link:hover { background: rgba(154, 143, 92, 0.08); color: var(--text-primary); }
.date-link.active { background: rgba(154, 143, 92, 0.12); color: var(--accent); font-weight: 600; }
.history-detail {
  background: linear-gradient(180deg, rgba(48,54,62,0.98) 0%, var(--bg-panel) 8%, var(--bg-panel) 100%);
  border: none;
  border-radius: var(--panel-radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 8px rgba(0, 0, 0, 0.25);
}
.history-detail::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dim) 40%, transparent 70%);
  opacity: 0.85;
}
.history-detail::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/images/noise.svg');
  background-repeat: repeat;
  opacity: 0.03;
  mix-blend-mode: soft-light;
  pointer-events: none;
  border-radius: inherit;
}
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.detail-date {
  font-size: 1rem;
  text-align: center;
  flex: 1;
  color: var(--accent);
}
.nav-btn {
  color: var(--accent-dim);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.45rem 0.9rem;
  border-radius: 2px;
  border: 1px solid var(--border);
  transition: all 0.15s;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-btn:hover { background: rgba(154, 143, 92, 0.08); border-color: var(--accent-dim); color: var(--accent); }
.nav-btn.disabled { color: var(--text-muted); opacity: 0.3; pointer-events: none; border-color: var(--border); }
.totals-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.edit-actions { margin-top: 1.5rem; text-align: right; }
.center-text { text-align: center; padding: 3rem; }
.muted { color: var(--text-muted); }

/* Dashboard Chart - graph card, slightly lighter than delta row */
.dashboard-chart-section {
  margin-bottom: 0.5rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(180deg, rgba(62,70,80,0.98) 0%, var(--bg-panel-graph) 10%, var(--bg-panel-graph) 100%);
  border: 1px solid rgba(0,0,0,0.5);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.04),
    inset 0 -1px 2px rgba(0, 0, 0, 0.15),
    0 3px 12px rgba(0, 0, 0, 0.35);
}
.dashboard-chart-section .panel-title { color: var(--accent); font-weight: 800; }
.chart-hint { margin-bottom: 0.25rem; font-size: 0.65rem; color: var(--text-secondary); }
.chart-container--dashboard { height: 192px; padding: 0.25rem 0.5rem 0.5rem; }

/* Graphs Grid - graph cards, lighter tone */
.graphs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.panel-chart {
  background: linear-gradient(180deg, rgba(62,70,80,0.98) 0%, var(--bg-panel-graph) 10%, var(--bg-panel-graph) 100%);
  border: 1px solid rgba(0,0,0,0.5);
  border-radius: var(--panel-radius);
  padding: 0.9rem 1rem;
  backdrop-filter: blur(var(--panel-blur));
  -webkit-backdrop-filter: blur(var(--panel-blur));
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.04),
    inset 0 -1px 2px rgba(0, 0, 0, 0.15),
    0 3px 12px rgba(0, 0, 0, 0.35);
}
.panel-chart .panel-title { color: var(--accent); font-weight: 800; }
.chart-container { position: relative; height: 280px; padding: 0.35rem 0.5rem; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.2) 100%);
}
.site-footer .footer-title {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  font-weight: 600;
}
.site-footer .footer-title span { color: var(--accent); }
.site-footer .muted { color: var(--text-muted); font-size: 0.75rem; margin-top: 0.2rem; letter-spacing: 0.5px; }
.footer-social {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}
.social-icon {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.social-icon:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: rgba(154, 143, 92, 0.08);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Selection */
::selection { background: rgba(154, 143, 92, 0.3); color: var(--text-primary); }

/* Responsive */
@media (max-width: 768px) {
  body { flex-direction: column; }
  .side-nav {
    width: 100%;
    min-width: unset;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .side-nav-links { flex-direction: row; flex-wrap: wrap; gap: 0.25rem; }
  .side-nav-links a { padding: 0.4rem 0.6rem; font-size: 0.7rem; }
  .site-header { padding: 0 1rem; min-height: 32px; }
  main { padding: 0.75rem 1rem; width: 100%; }
  .panels { grid-template-columns: 1fr; }
  .delta-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-lifetime .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .update-section-inner { flex-direction: column; }
  .btn-cta { align-self: stretch; }
  .history-layout { grid-template-columns: 1fr; }
  .date-list { max-height: 200px; }
  .detail-header { flex-wrap: wrap; }
  .detail-date { order: -1; width: 100%; margin-bottom: 0.5rem; }
  .graphs-grid { grid-template-columns: 1fr; }
  .parsed-preview { grid-template-columns: repeat(2, 1fr); }
  .survival-rate-box__value { font-size: 3.2rem; }
  .survival-rate-box { padding: 1.25rem 1rem; }
}
