/* =======================================================================
   UNSEALED — LIQUID GLASS EDITION
   Heavy visionOS / macOS / iOS liquid glass system
   ======================================================================= */

:root {
  /* Accent (amber by default, overridden via [data-accent]) */
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.55);
  --accent-soft: rgba(245, 158, 11, 0.15);
  --accent-ink: #fbbf24;

  /* Dark theme — deep plum/ink backdrop */
  --bg-0: #0a0612;
  --bg-1: #0f0a1c;
  --bg-deep: #060309;
  --ink: #f5f0e8;
  --ink-dim: rgba(245, 240, 232, 0.62);
  --ink-faint: rgba(245, 240, 232, 0.38);
  --ink-ghost: rgba(245, 240, 232, 0.18);

  /* Glass tokens — the heart of the system */
  --glass-tint: rgba(255, 255, 255, 0.045);
  --glass-tint-strong: rgba(255, 255, 255, 0.085);
  --glass-tint-soft: rgba(255, 255, 255, 0.025);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-bright: rgba(255, 255, 255, 0.22);
  --glass-highlight: rgba(255, 255, 255, 0.5);
  --glass-shadow-ambient: 0 1px 0 0 rgba(255, 255, 255, 0.08) inset,
                          0 -1px 0 0 rgba(0, 0, 0, 0.35) inset,
                          0 20px 40px -10px rgba(0, 0, 0, 0.55),
                          0 4px 12px -2px rgba(0, 0, 0, 0.35);

  /* Blur levels */
  --blur-heavy: 36px;
  --blur-medium: 20px;
  --blur-soft: 12px;

  /* Radii follow Apple hierarchy */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 36px;
  --r-pill: 999px;

  /* Type */
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --font-serif: 'Instrument Serif', 'New York', Georgia, serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Motion */
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Accent variations */
[data-accent="amber"] { --accent: #f59e0b; --accent-glow: rgba(245,158,11,0.55); --accent-soft: rgba(245,158,11,0.15); --accent-ink: #fbbf24; }
[data-accent="red"]   { --accent: #ef4444; --accent-glow: rgba(239,68,68,0.55);  --accent-soft: rgba(239,68,68,0.15);  --accent-ink: #f87171; }
[data-accent="cyan"]  { --accent: #22d3ee; --accent-glow: rgba(34,211,238,0.55); --accent-soft: rgba(34,211,238,0.15); --accent-ink: #67e8f9; }
[data-accent="violet"]{ --accent: #a78bfa; --accent-glow: rgba(167,139,250,0.55);--accent-soft: rgba(167,139,250,0.15);--accent-ink: #c4b5fd; }
[data-accent="spectrum"] { --accent: #e879f9; --accent-glow: rgba(232,121,249,0.55); --accent-soft: rgba(232,121,249,0.15); --accent-ink: #f0abfc; }
[data-accent="white"] { --accent: #f5f0e8; --accent-glow: rgba(245,240,232,0.55); --accent-soft: rgba(245,240,232,0.15); --accent-ink: #ffffff; }

/* Light theme variant */
[data-theme="light"] {
  --bg-0: #f5f0e8;
  --bg-1: #ebe4d5;
  --bg-deep: #ddd3c1;
  --ink: #1a1128;
  --ink-dim: rgba(26, 17, 40, 0.65);
  --ink-faint: rgba(26, 17, 40, 0.4);
  --ink-ghost: rgba(26, 17, 40, 0.15);
  --glass-tint: rgba(255, 255, 255, 0.45);
  --glass-tint-strong: rgba(255, 255, 255, 0.65);
  --glass-tint-soft: rgba(255, 255, 255, 0.28);
  --glass-border: rgba(26, 17, 40, 0.08);
  --glass-border-bright: rgba(26, 17, 40, 0.16);
  --glass-highlight: rgba(255, 255, 255, 0.9);
  --glass-shadow-ambient: 0 1px 0 0 rgba(255, 255, 255, 0.7) inset,
                          0 -1px 0 0 rgba(0, 0, 0, 0.04) inset,
                          0 20px 40px -10px rgba(26, 17, 40, 0.12),
                          0 4px 12px -2px rgba(26, 17, 40, 0.08);
}

[data-blur="soft"]   { --blur-heavy: 18px; --blur-medium: 12px; --blur-soft: 8px; }
[data-blur="medium"] { --blur-heavy: 28px; --blur-medium: 18px; --blur-soft: 10px; }
[data-blur="heavy"]  { --blur-heavy: 44px; --blur-medium: 24px; --blur-soft: 14px; }

/* =========================================================
   RESET
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-weight: 400;
  background: var(--bg-0);
  color: var(--ink);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
}
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
.svg-defs { position: absolute; width: 0; height: 0; }

/* =========================================================
   AURORA — animated gradient backdrop
   ========================================================= */
.aurora {
  position: fixed; inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.18), transparent),
    radial-gradient(ellipse 60% 80% at 100% 100%, rgba(245, 158, 11, 0.12), transparent),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 50%, var(--bg-deep) 100%);
  transition: opacity 0.4s var(--ease-smooth);
}
[data-aurora="off"] .aurora-blob { display: none; }
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  mix-blend-mode: screen;
  will-change: transform;
}
[data-theme="light"] .aurora-blob { mix-blend-mode: multiply; opacity: 0.35; }
.aurora-blob.b1 { width: 700px; height: 700px; background: var(--accent); top: -250px; left: -200px; animation: aurora-drift-1 24s var(--ease-smooth) infinite; }
.aurora-blob.b2 { width: 600px; height: 600px; background: #8b5cf6; top: 10%; right: -200px; animation: aurora-drift-2 32s var(--ease-smooth) infinite; }
.aurora-blob.b3 { width: 800px; height: 800px; background: #ec4899; bottom: -300px; left: 20%; animation: aurora-drift-3 28s var(--ease-smooth) infinite; opacity: 0.35; }
.aurora-blob.b4 { width: 500px; height: 500px; background: #22d3ee; top: 40%; left: 40%; animation: aurora-drift-4 36s var(--ease-smooth) infinite; opacity: 0.3; }

[data-motion="off"] .aurora-blob { animation: none !important; }

@keyframes aurora-drift-1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(120px, 180px) scale(1.15); }
}
@keyframes aurora-drift-2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-150px, 200px) scale(0.9); }
}
@keyframes aurora-drift-3 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(200px, -120px) scale(1.1); }
}
@keyframes aurora-drift-4 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-180px, -150px) scale(1.2); }
}

.aurora-grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/></svg>");
  opacity: 0.04;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* =========================================================
   GLASS PRIMITIVE — the hero material
   ========================================================= */
.glass {
  position: relative;
  background: var(--glass-tint);
  backdrop-filter: blur(var(--blur-heavy)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--blur-heavy)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-shadow-ambient);
  isolation: isolate;
}
.glass::before {
  /* Specular highlight — subtle gradient rim along the top */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg,
    var(--glass-highlight) 0%,
    rgba(255,255,255,0.05) 30%,
    transparent 55%,
    rgba(255,255,255,0.02) 85%,
    var(--glass-highlight) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.45;
}
.glass::after {
  /* subtle inner refraction gloss on the top-left */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 60% 40% at 30% 0%, rgba(255,255,255,0.08), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.glass > * { position: relative; z-index: 1; }

.glass-soft {
  background: var(--glass-tint-soft);
  backdrop-filter: blur(var(--blur-soft)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur-soft)) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
}
.glass-strong {
  background: var(--glass-tint-strong);
  backdrop-filter: blur(var(--blur-heavy)) saturate(200%);
  -webkit-backdrop-filter: blur(var(--blur-heavy)) saturate(200%);
  border: 1px solid var(--glass-border-bright);
  border-radius: var(--r-lg);
}

/* =========================================================
   APP SHELL — macOS window chrome
   ========================================================= */
#app {
  position: relative;
  z-index: 1;
  height: 100vh;
  width: 100vw;
  padding: 22px;
  display: flex;
  flex-direction: column;
}

.window {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass-tint);
  backdrop-filter: blur(var(--blur-heavy)) saturate(200%);
  -webkit-backdrop-filter: blur(var(--blur-heavy)) saturate(200%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.1) inset,
    0 -1px 0 rgba(0,0,0,0.4) inset,
    0 50px 100px -20px rgba(0,0,0,0.6),
    0 20px 40px -10px rgba(0,0,0,0.3);
  position: relative;
}
.window::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 80% 50% at 30% 0%, rgba(255,255,255,0.06), transparent 70%);
  pointer-events: none;
}

/* TOPBAR */
.topbar {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
  position: relative;
  z-index: 10;
}
.traffic { display: flex; gap: 8px; padding-left: 4px; }
.traffic-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 0.5px solid rgba(0,0,0,0.3);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.25);
}
.traffic-dot.red { background: linear-gradient(180deg, #ff6159, #ff4036); }
.traffic-dot.yellow { background: linear-gradient(180deg, #ffbd2e, #ffa616); }
.traffic-dot.green { background: linear-gradient(180deg, #28ca41, #15b13a); }

.brand {
  display: flex; align-items: center; gap: 10px;
  padding-left: 20px;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #ef4444 80%);
  display: grid; place-items: center;
  color: #0a0612;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 0 20px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.3);
}
.brand-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 21px;
  letter-spacing: -0.02em;
}
.brand-meta {
  font-size: 10.5px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* SEARCH */
.search-wrap {
  justify-self: center;
  width: 100%; max-width: 520px;
  position: relative;
}
.search {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  transition: all 0.3s var(--ease-spring);
}
[data-theme="light"] .search { background: rgba(255,255,255,0.5); }
.search:focus-within {
  background: rgba(0,0,0,0.4);
  border-color: var(--accent-glow);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
[data-theme="light"] .search:focus-within { background: rgba(255,255,255,0.8); }
.search input {
  flex: 1;
  background: transparent; border: 0; outline: 0;
  color: var(--ink);
  font-size: 14px;
}
.search input::placeholder { color: var(--ink-faint); }
.search-kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--glass-tint-strong);
  border: 1px solid var(--glass-border);
  color: var(--ink-dim);
}

.top-actions {
  display: flex; justify-content: flex-end;
  align-items: center; gap: 6px;
}
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--ink-dim);
  transition: all 0.2s var(--ease-smooth);
  position: relative;
}
.icon-btn:hover {
  background: var(--glass-tint-strong);
  color: var(--ink);
}
.icon-btn.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: #0a0612;
  box-shadow: 0 0 0 2px var(--bg-1), 0 4px 12px rgba(0,0,0,0.3);
  margin-left: 4px;
}

/* =========================================================
   MAIN LAYOUT
   ========================================================= */
.body {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* SIDEBAR */
.sidebar {
  padding: 16px 10px;
  overflow-y: auto;
  border-right: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent 40%);
  scrollbar-width: thin;
  scrollbar-color: var(--ink-ghost) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--ink-ghost); border-radius: 3px; }

.compose {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--accent), color-mix(in oklch, var(--accent), #ef4444 40%));
  color: #0a0612;
  font-size: 13px; font-weight: 600;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.3) inset,
    0 -1px 0 rgba(0,0,0,0.15) inset,
    0 0 24px var(--accent-glow),
    0 8px 20px -8px var(--accent-glow);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-smooth);
}
.compose:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 -1px 0 rgba(0,0,0,0.15) inset, 0 0 32px var(--accent-glow), 0 12px 28px -8px var(--accent-glow); }

.side-group { margin-bottom: 14px; }
.side-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  padding: 6px 12px 4px;
  font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}
.side-title .tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-ghost);
  text-transform: none;
  letter-spacing: 0;
}
.side-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink-dim);
  text-align: left;
  position: relative;
  transition: all 0.15s var(--ease-smooth);
}
.side-item:hover { background: var(--glass-tint); color: var(--ink); }
.side-item.active {
  background: var(--glass-tint-strong);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 0 0 1px var(--glass-border-bright);
}
.side-item.active::before {
  content: "";
  position: absolute;
  left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.side-item svg { flex-shrink: 0; opacity: 0.75; }
.side-item .count {
  margin-left: auto;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--ink-faint);
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--glass-tint);
}
.side-item.active .count { color: var(--accent-ink); background: var(--accent-soft); }

.side-foot {
  padding: 14px 12px 6px;
  margin-top: 14px;
  border-top: 1px solid var(--glass-border);
  font-size: 10.5px;
  color: var(--ink-faint);
  display: flex; flex-direction: column; gap: 6px;
}

/* =========================================================
   INBOX VIEW
   ========================================================= */
.view {
  display: grid;
  grid-template-columns: minmax(360px, 420px) 1fr;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
[data-density="dense"] .view { grid-template-columns: minmax(320px, 380px) 1fr; }
.inbox-pane {
  display: flex; flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--glass-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent 30%);
  position: relative;
}

.pane-header {
  padding: 18px 22px 12px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.pane-title {
  font-family: var(--font-serif);
  font-size: 32px;
  letter-spacing: -0.02em;
  font-weight: 400;
  line-height: 1;
}
.pane-title em { font-style: italic; color: var(--accent-ink); }
.pane-sub {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 4px;
  letter-spacing: 0.01em;
}
.pane-tools {
  display: flex; gap: 4px;
  flex-shrink: 0;
}
.chip {
  padding: 5px 10px;
  font-size: 11.5px;
  border-radius: 7px;
  color: var(--ink-dim);
  background: var(--glass-tint);
  border: 1px solid transparent;
  transition: all 0.15s var(--ease-smooth);
  display: inline-flex; align-items: center; gap: 4px;
}
.chip:hover { background: var(--glass-tint-strong); color: var(--ink); }
.chip.active { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-glow); }

/* Filter tabs (Primary / Social etc. style) */
.filter-tabs {
  display: flex; gap: 4px;
  padding: 6px 16px 0;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.filter-tab {
  padding: 10px 14px 11px;
  font-size: 12px; font-weight: 500;
  color: var(--ink-faint);
  position: relative;
  display: flex; align-items: center; gap: 6px;
  transition: color 0.15s var(--ease-smooth);
}
.filter-tab:hover { color: var(--ink-dim); }
.filter-tab.active { color: var(--ink); }
.filter-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-glow);
}
.filter-tab .badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--glass-tint);
  font-family: var(--font-mono);
}
.filter-tab.active .badge { background: var(--accent-soft); color: var(--accent-ink); }

/* EMAIL LIST */
.email-list {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-ghost) transparent;
  flex: 1;
  padding: 8px 10px 24px;
  display: flex; flex-direction: column; gap: 3px;
}
.email-list::-webkit-scrollbar { width: 6px; }
.email-list::-webkit-scrollbar-thumb { background: var(--ink-ghost); border-radius: 3px; }

.email-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  position: relative;
  transition: background 0.18s var(--ease-smooth), transform 0.2s var(--ease-spring);
  align-items: flex-start;
}
.email-row:hover {
  background: var(--glass-tint);
}
.email-row.unread::before {
  content: "";
  position: absolute;
  left: 6px; top: 22px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.email-row.active {
  background: var(--glass-tint-strong);
  box-shadow: 0 0 0 1px var(--glass-border-bright) inset, 0 8px 24px -8px rgba(0,0,0,0.5);
}
.email-row.active::before { left: 6px; }

.email-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 2px 6px rgba(0,0,0,0.2);
}
.email-body { min-width: 0; }
.email-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.email-sender {
  font-size: 13.5px; font-weight: 600;
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1;
  letter-spacing: -0.005em;
}
.email-row.unread .email-sender { font-weight: 600; }
.email-row:not(.unread) .email-sender { color: var(--ink-dim); font-weight: 500; }
.email-date {
  font-size: 10.5px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.email-subject {
  font-size: 12.5px;
  color: var(--ink-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 2px;
  font-weight: 500;
}
.email-row.unread .email-subject { color: var(--ink); }
.email-preview {
  font-size: 11.5px;
  color: var(--ink-faint);
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}
.email-tags {
  display: flex; gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.etag {
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--glass-tint);
  color: var(--ink-dim);
  border: 1px solid var(--glass-border);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.etag.redacted { background: #1a0606; color: #ff6159; border-color: rgba(255,97,89,0.3); }
.etag.classified { background: rgba(245,158,11,0.15); color: var(--accent-ink); border-color: var(--accent-glow); }
.etag.foia { background: rgba(34,211,238,0.1); color: #67e8f9; border-color: rgba(34,211,238,0.3); }
.etag.attach { background: rgba(167,139,250,0.1); color: #c4b5fd; border-color: rgba(167,139,250,0.3); }

.email-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.email-attach {
  width: 14px; height: 14px;
  color: var(--ink-faint);
}

/* =========================================================
   DETAIL PANE
   ========================================================= */
.detail-pane {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-ghost) transparent;
  position: relative;
}
.detail-pane::-webkit-scrollbar { width: 8px; }
.detail-pane::-webkit-scrollbar-thumb { background: var(--ink-ghost); border-radius: 4px; }

.detail-head {
  padding: 20px 32px 14px;
  border-bottom: 1px solid var(--glass-border);
  position: sticky; top: 0;
  background: var(--glass-tint-soft);
  backdrop-filter: blur(var(--blur-medium));
  -webkit-backdrop-filter: blur(var(--blur-medium));
  z-index: 5;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
}
.detail-subject {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 6px;
}
.detail-meta-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-actions {
  display: flex; gap: 4px;
  flex-shrink: 0;
}

.detail-content {
  padding: 24px 32px 80px;
  max-width: 800px;
}
.detail-from {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--glass-tint-soft);
  border: 1px solid var(--glass-border);
  margin-bottom: 24px;
}
.detail-from-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 600;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}
.detail-from-info { flex: 1; min-width: 0; }
.detail-from-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.detail-from-email { font-size: 12px; color: var(--ink-dim); font-family: var(--font-mono); }
.detail-from-date { font-size: 11px; color: var(--ink-faint); text-align: right; font-family: var(--font-mono); }
.detail-from-meta { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }

.detail-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.detail-body p { margin: 0 0 14px; }
.detail-body .redacted {
  display: inline-block;
  background: #000;
  color: transparent;
  padding: 0 6px;
  border-radius: 2px;
  user-select: none;
  margin: 0 1px;
  position: relative;
}
.detail-body .redacted::after {
  content: "[REDACTED]";
  color: #ff6159;
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  font-size: 9px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 0.2s;
}
.detail-body .redacted:hover::after { opacity: 1; }
.detail-body .quote {
  border-left: 2px solid var(--glass-border-bright);
  padding-left: 14px;
  color: var(--ink-dim);
  font-size: 13.5px;
  margin: 14px 0;
}

.detail-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 24px;
}
.attach-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--glass-tint-soft);
  border: 1px solid var(--glass-border);
  transition: all 0.2s var(--ease-spring);
}
.attach-card:hover {
  transform: translateY(-2px);
  background: var(--glass-tint-strong);
  box-shadow: 0 8px 20px -8px rgba(0,0,0,0.4);
}
.attach-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  display: grid; place-items: center;
  color: var(--accent-ink);
  flex-shrink: 0;
  border: 1px solid var(--accent-glow);
}
.attach-info { min-width: 0; }
.attach-name { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-size { font-size: 10.5px; color: var(--ink-faint); font-family: var(--font-mono); }

/* AI SUMMARY CARD */
.ai-card {
  padding: 16px 18px;
  margin: 0 0 24px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(139,92,246,0.08));
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}
.ai-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(from 0deg, transparent, var(--accent-glow) 20%, transparent 40%);
  opacity: 0.15;
  animation: shimmer 8s linear infinite;
  pointer-events: none;
}
[data-motion="off"] .ai-card::before { animation: none; }
@keyframes shimmer { to { transform: rotate(360deg); } }
.ai-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
  font-weight: 600;
  margin-bottom: 6px;
}
.ai-label .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  animation: pulse 1.6s ease-in-out infinite;
}
[data-motion="off"] .ai-label .dot { animation: none; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.ai-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  position: relative; z-index: 1;
}
.ai-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.ai-fact {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--glass-border);
}
[data-theme="light"] .ai-fact { background: rgba(255,255,255,0.4); }
.ai-fact-label { font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.ai-fact-val { font-size: 13px; font-weight: 500; margin-top: 2px; }

/* Thread (follow-ups) */
.thread-card {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--glass-tint-soft);
  border: 1px solid var(--glass-border);
  margin-top: 10px;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}
.thread-card:hover { background: var(--glass-tint); }
.thread-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--ink-dim); margin-bottom: 6px;
}
.thread-snip { font-size: 13px; color: var(--ink-dim); }

/* =========================================================
   FLOATING DOCK (visionOS style)
   ========================================================= */
.dock {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 8px;
  border-radius: 22px;
  display: flex; gap: 6px;
  background: var(--glass-tint-strong);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--glass-border-bright);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.25) inset,
    0 -1px 0 rgba(0,0,0,0.3) inset,
    0 20px 60px -15px rgba(0,0,0,0.6);
}
.dock-item {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid; place-items: center;
  color: var(--ink-dim);
  transition: all 0.2s var(--ease-spring);
  position: relative;
}
.dock-item:hover {
  background: var(--glass-tint-strong);
  color: var(--ink);
  transform: translateY(-3px) scale(1.05);
}
.dock-item.active {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.dock-item.active::after {
  content: "";
  position: absolute;
  bottom: -7px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}
.dock-sep { width: 1px; background: var(--glass-border); margin: 6px 2px; }
.dock-label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%; transform: translateX(-50%) translateY(4px);
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
  background: rgba(0,0,0,0.85);
  color: #fff;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.15s var(--ease-smooth);
}
.dock-item:hover .dock-label { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   INTRO / LANDING
   ========================================================= */
.intro-overlay {
  position: fixed; inset: 0;
  z-index: 100;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at center, var(--bg-1), var(--bg-deep));
  padding: 40px;
  overflow: hidden;
  animation: intro-fade-out 1.2s var(--ease-smooth) 6s forwards;
}
.intro-overlay.dismissed { animation: intro-fade-out 0.8s var(--ease-smooth) forwards; }
@keyframes intro-fade-out {
  to { opacity: 0; pointer-events: none; transform: scale(1.05); }
}
.intro-seal {
  position: absolute;
  width: 70vmin; height: 70vmin;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, var(--accent), #ef4444, #a78bfa, #22d3ee, var(--accent));
  filter: blur(100px);
  opacity: 0.4;
  animation: intro-seal-rot 8s linear infinite;
}
@keyframes intro-seal-rot { to { transform: translate(-50%,-50%) rotate(360deg); } }
.intro-content {
  position: relative; z-index: 1;
  text-align: center;
  max-width: 720px;
}
.intro-stamp {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.25em;
  color: var(--accent-ink);
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid var(--accent-glow);
  border-radius: 999px;
  display: inline-block;
  background: var(--accent-soft);
  margin-bottom: 30px;
  animation: intro-in 0.8s var(--ease-spring) backwards;
}
.intro-title {
  font-family: var(--font-serif);
  font-size: clamp(60px, 10vw, 144px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
  animation: intro-in 1s var(--ease-spring) 0.2s backwards;
}
.intro-title em { font-style: italic; }
.intro-title .gradient {
  background: linear-gradient(135deg, var(--accent), #ec4899 60%, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.intro-sub {
  font-size: 17px;
  color: var(--ink-dim);
  margin: 0 auto 36px;
  max-width: 520px;
  line-height: 1.5;
  animation: intro-in 1s var(--ease-spring) 0.4s backwards;
}
.intro-stats {
  display: flex; gap: 32px; justify-content: center;
  margin-bottom: 42px;
  animation: intro-in 1s var(--ease-spring) 0.6s backwards;
}
.intro-stat { text-align: left; }
.intro-stat-num {
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1;
  font-weight: 500;
  color: var(--ink);
}
.intro-stat-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  margin-top: 4px;
}
.intro-enter {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  background: var(--glass-tint-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border-bright);
  color: var(--ink);
  transition: all 0.2s var(--ease-spring);
  animation: intro-in 1s var(--ease-spring) 0.8s backwards;
}
.intro-enter:hover {
  background: var(--accent);
  color: #0a0612;
  transform: scale(1.05);
  box-shadow: 0 0 30px var(--accent-glow);
}
@keyframes intro-in {
  from { opacity: 0; transform: translateY(24px); filter: blur(10px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* =========================================================
   OTHER VIEWS
   ========================================================= */

/* Generic view header */
.generic-view { overflow: auto; padding: 0; display: block; height: 100%; }
.generic-view::-webkit-scrollbar { width: 8px; }
.generic-view::-webkit-scrollbar-thumb { background: var(--ink-ghost); border-radius: 4px; }
.gv-hero {
  padding: 36px 40px 24px;
  border-bottom: 1px solid var(--glass-border);
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 20px;
}
.gv-hero h2 {
  font-family: var(--font-serif);
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  line-height: 1;
}
.gv-hero h2 em { font-style: italic; color: var(--accent-ink); }
.gv-hero p { color: var(--ink-dim); font-size: 14px; margin: 0; }
.gv-body { padding: 26px 40px 40px; }

/* Photos */
.photo-filters {
  display: flex; gap: 6px; margin-bottom: 18px;
}
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.photo-card {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  background: var(--glass-tint-soft);
  transition: transform 0.3s var(--ease-spring);
}
.photo-card:hover { transform: scale(1.03); z-index: 2; }
.photo-card .ph {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
}
.photo-card.featured { aspect-ratio: auto; grid-row: span 2; }
.photo-card .overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  font-size: 10.5px;
  color: #f5f0e8;
  font-family: var(--font-mono);
  opacity: 0; transition: opacity 0.2s;
}
.photo-card:hover .overlay { opacity: 1; }

/* Flights */
.flights-tabs { display: flex; gap: 4px; margin-bottom: 18px; }
.flight-row {
  display: grid;
  grid-template-columns: 120px 1fr 80px 100px;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  transition: background 0.15s;
  cursor: pointer;
}
.flight-row:hover { background: var(--glass-tint); }
.flight-date { font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); }
.flight-route {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink);
}
.flight-arr { color: var(--accent-ink); }
.flight-ac { font-size: 11.5px; color: var(--ink-faint); font-family: var(--font-mono); }
.flight-px { display: flex; flex-wrap: wrap; gap: 4px; max-width: 300px; font-size: 10.5px; }
.flight-px .px {
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--glass-tint);
  border: 1px solid var(--glass-border);
  color: var(--ink-dim);
}

/* Network — clustered dots */
.net-card {
  aspect-ratio: 16/10;
  border-radius: var(--r-lg);
  background: var(--glass-tint-soft);
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}
.net-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Timeline */
.tl-track {
  position: relative;
  padding-left: 36px;
}
.tl-track::before {
  content: "";
  position: absolute;
  left: 14px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--glass-border-bright) 10%, var(--glass-border-bright) 90%, transparent);
}
.tl-event {
  position: relative;
  margin-bottom: 24px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--glass-tint-soft);
  border: 1px solid var(--glass-border);
}
.tl-event::before {
  content: "";
  position: absolute;
  left: -29px; top: 22px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg-0), 0 0 12px var(--accent-glow);
}
.tl-year { font-family: var(--font-mono); font-size: 11px; color: var(--accent-ink); letter-spacing: 0.06em; }
.tl-title { font-family: var(--font-serif); font-size: 20px; margin: 2px 0 6px; }
.tl-desc { font-size: 13px; color: var(--ink-dim); line-height: 1.55; }

/* Profiles */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.profile-card {
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--glass-tint-soft);
  border: 1px solid var(--glass-border);
  display: flex; gap: 12px; align-items: center;
  transition: all 0.2s var(--ease-spring);
  cursor: pointer;
}
.profile-card:hover {
  background: var(--glass-tint-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -12px rgba(0,0,0,0.5);
}
.profile-ava {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 15px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.profile-name { font-size: 14px; font-weight: 600; }
.profile-role { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.profile-meta { font-size: 10.5px; color: var(--ink-faint); margin-top: 4px; font-family: var(--font-mono); }

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.stat-card {
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--glass-tint-soft);
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}
.stat-card.wide { grid-column: span 2; }
.stat-card h3 { font-size: 13px; font-weight: 500; margin: 0 0 12px; color: var(--ink-dim); letter-spacing: 0.02em; }
.stat-big {
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-big em { font-style: italic; color: var(--accent-ink); }
.stat-sub { font-size: 11.5px; color: var(--ink-faint); margin-top: 4px; }

.bar-chart { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 44px;
  gap: 10px; align-items: center;
  font-size: 11.5px;
}
.bar-label { color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: var(--glass-tint); border-radius: 4px; overflow: hidden; position: relative; }
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in oklch, var(--accent), #ef4444 40%));
  border-radius: 4px;
  box-shadow: 0 0 8px var(--accent-glow);
  transition: width 0.5s var(--ease-spring);
}
.bar-val { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); text-align: right; }

/* Simple responsive */
@media (max-width: 1200px) {
  .topbar { grid-template-columns: 220px 1fr 200px; }
  .body { grid-template-columns: 220px 1fr; }
}
@media (max-width: 960px) {
  .view { grid-template-columns: 1fr; }
  .detail-pane { display: none; }
}

/* Focus ring */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
