/* Search Epstein – Inbox UI
 * Styling follows 2025/2026 guidelines: fluid typography (clamp 16–18px), line-height 1.4–1.6,
 * layered soft shadows, rounded corners (8–16px), spacing scale, WCAG-aligned contrast.
 * Refs: fluid type & readability (FrontendTools), humanized aesthetics & bento/glass (trends 2026). */
:root {
  --bg: #F5F3F0;
  --bg-panel: #FFFFFF;
  --bg-sidebar: #EBE8E4;
  --border: #D4CFC7;
  --text: #1A1D21;
  --text-secondary: #4A5058;
  --text-muted: #6B7280;
  --accent: #B8860B;
  --accent-hover: #9A7209;
  --row-hover: #F0EDE9;
  --star: #B8860B;
  /* 2025/2026: layered soft shadows, single light source */
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.06);
  --shadow-md: 0 2px 4px rgba(0,0,0,.04), 0 6px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 4px 6px rgba(0,0,0,.04), 0 12px 24px rgba(0,0,0,.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --doc-panel: #FFFFFF;
  --doc-text: #1A1D21;
  --match-highlight: #FEF3C7;
  --redaction: #2A2A2A;
  --warning: #6B1F28;
  --link-accent: #2F5D62;
  --banner-bg: var(--bg-sidebar);
  --banner-code-bg: rgba(0,0,0,.06);
  /* Type scale (major third ~1.25) */
  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --lh-tight: 1.4;
  --lh-normal: 1.5;
  --lh-relaxed: 1.6;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
}

/* Dark mode: investigative noir with antique gold accents */
[data-theme="dark"] {
  --bg: #0C0E10;
  --bg-panel: #14171A;
  --bg-sidebar: #14171A;
  --border: #1E2328;
  --text: #E8EAED;
  --text-secondary: #9CA3AF;
  --text-muted: #9CA3AF;
  --accent: #D4A84B;
  --accent-hover: #C49A3D;
  --row-hover: #1C2024;
  --star: #D4A84B;
  --shadow: 0 1px 2px rgba(0,0,0,.2), 0 2px 8px rgba(0,0,0,.25);
  --shadow-md: 0 2px 4px rgba(0,0,0,.2), 0 6px 16px rgba(0,0,0,.3);
  --shadow-lg: 0 4px 6px rgba(0,0,0,.2), 0 12px 24px rgba(0,0,0,.35);
  --match-highlight: rgba(212, 168, 75, .35);
  --doc-panel: #E8E1D6;
  --doc-text: #2C2F34;
  --match-highlight: rgba(201, 162, 77, .35);
  --redaction: #5A1E24;
  --warning: #5A1E24;
  --link-accent: #C9A24D;
  --banner-bg: #0F3B3E;
  --banner-code-bg: rgba(255,255,255,.12);
}

[data-theme="dark"] .nav-item:hover {
  background: rgba(255,255,255,.06);
}

[data-theme="dark"] .nav-item.active {
  background: rgba(201, 162, 77, .15);
  color: var(--accent);
}

[data-theme="dark"] .email-row.selected {
  background: rgba(212, 168, 75, .15);
}

[data-theme="dark"] .banner code {
  color: var(--text);
}

/* Force theme text color on form controls so typed text is readable in dark mode */
[data-theme="dark"] .search-input,
[data-theme="dark"] .dataset-filter,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  color: var(--text);
}
[data-theme="dark"] .search-input::placeholder,
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--text-muted);
}

/* Email/file detail view – all content readable in dark mode */
[data-theme="dark"] .detail-subject,
[data-theme="dark"] .message-sender-name,
[data-theme="dark"] .message-recipients,
[data-theme="dark"] .message-body,
[data-theme="dark"] .message-body p,
[data-theme="dark"] .message-body li {
  color: var(--text);
}
[data-theme="dark"] .message-sender-email,
[data-theme="dark"] .message-date,
[data-theme="dark"] .message-icon,
[data-theme="dark"] .message-disclaimer {
  color: var(--text-muted);
}
[data-theme="dark"] .search-match-note,
[data-theme="dark"] .search-match-note.search-match-nowhere {
  color: var(--text);
  background: rgba(201, 162, 77, 0.25);
}
[data-theme="dark"] .search-match-btn {
  background: #2c2618;
  color: #fff;
  border-color: var(--accent);
}
[data-theme="dark"] .search-match-btn:hover {
  background: #3d3520;
  color: #fff;
  border-color: var(--accent-hover);
}
[data-theme="dark"] .detail-nav-btn.detail-nav-file {
  color: var(--accent);
}
[data-theme="dark"] .detail-doc {
  background: var(--bg-panel);
  color: var(--text);
}
[data-theme="dark"] .view-original-doc-btn {
  background: #2c2618;
  color: #fff;
  border-color: var(--accent);
}
[data-theme="dark"] .view-original-doc-btn:hover {
  background: #3d3520;
  color: #fff;
  border-color: var(--accent-hover);
}
[data-theme="dark"] .file-summary-title {
  color: var(--text-muted);
}
[data-theme="dark"] .file-summary-text {
  color: var(--text);
}
[data-theme="dark"] .message-avatar-full {
  background: var(--text-muted);
}

* {
  box-sizing: border-box;
}

/* Fluid base: 16–18px, line-height 1.5–1.6 (2025 readability) */
html {
  font-size: clamp(16px, 1vw + 0.5rem, 18px);
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Header – soft elevation, more spacing */
.header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  min-height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.logo-img {
  height: 64px;
  width: auto;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.logo-text {
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
}

.search-form {
  flex: 1;
  max-width: 720px;
  display: flex;
  align-items: center;
  background: var(--bg-sidebar);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  padding: 0 var(--space-4);
  height: 48px;
  transition: box-shadow .2s ease, border-color .2s ease;
}

.search-form:focus-within {
  background: var(--bg-panel);
  box-shadow: var(--shadow);
  border-color: var(--border);
}

.logo {
  cursor: pointer;
}

.logo:hover {
  opacity: 0.85;
}

.search-input {
  flex: 1;
  border: none;
  background: none;
  font-size: var(--fs-base);
  padding: 0 var(--space-2);
  outline: none;
  color: var(--text);
  line-height: var(--lh-normal);
  text-align: left;
}
.search-input::placeholder {
  color: var(--text-muted);
}

/* Hide native clear so only our custom clear button shows */
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.search-input::-moz-search-cancel-button {
  display: none;
}
.search-input::-ms-clear {
  display: none;
}

.search-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
}

.search-clear-btn:hover {
  background: var(--bg-sidebar);
  color: var(--text);
}

.search-btn {
  background: none;
  border: none;
  font-size: 18px;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
}

.dataset-filter {
  height: 46px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-sidebar);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  min-width: 120px;
}

.dataset-filter:hover,
.dataset-filter:focus {
  background: var(--bg-panel);
  border-color: var(--border);
  outline: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}

.theme-toggle {
  margin-left: auto;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  /* Default: subtle (same as old hover) – blends into header */
  background: var(--bg-sidebar);
  color: var(--text-muted);
}
.theme-toggle:hover {
  /* Hover: “loud” – accent icon, elevated */
  background: var(--bg-panel);
  color: var(--accent);
  box-shadow: var(--shadow);
  text-decoration: none;
}
[data-theme="dark"] .theme-toggle:hover {
  background: var(--row-hover);
}
.theme-toggle .theme-icon {
  display: none;
  line-height: 0;
}
.theme-toggle .theme-icon svg {
  display: block;
  vertical-align: middle;
}
html[data-theme="dark"] .theme-toggle .theme-icon-sun {
  display: inline-block;
}
html[data-theme="dark"] .theme-toggle .theme-icon-moon {
  display: none;
}
html[data-theme="light"] .theme-toggle .theme-icon-moon,
:root:not([data-theme]) .theme-toggle .theme-icon-moon {
  display: inline-block;
}
html[data-theme="light"] .theme-toggle .theme-icon-sun,
:root:not([data-theme]) .theme-toggle .theme-icon-sun {
  display: none;
}

.header-big-picture-link {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.header-big-picture-link:hover {
  background: var(--bg-sidebar);
  text-decoration: underline;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
}

.icon-btn:hover {
  background: var(--bg-sidebar);
  color: var(--text);
}

/* Banner – lives in main content column only */
.banner {
  background: var(--banner-bg);
  color: var(--text);
  padding: var(--space-4) var(--space-5);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  text-align: center;
}

.banner code {
  background: var(--banner-code-bg);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9em;
}

/* Top bar – actions only (centered on desktop) */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  flex-shrink: 0;
  position: relative;
}

.top-bar-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  margin-left: auto;
  -webkit-tap-highlight-color: transparent;
}
.top-bar-menu-btn:hover {
  background: var(--bg-sidebar);
  color: var(--accent);
}

.top-bar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.top-bar-link {
  color: var(--accent);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
}

.top-bar-link:hover {
  text-decoration: underline;
}

.top-bar-admin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  color: var(--text-muted);
  text-decoration: none;
}
.top-bar-admin-icon:hover {
  color: var(--text);
}
.top-bar-admin-icon.admin-unlocked {
  color: #22c55e;
}
.top-bar-admin-icon.admin-locked {
  color: #ef4444;
}
.top-bar-admin-icon svg {
  width: 20px;
  height: 20px;
}

/* Mobile: hamburger + dropdown overlay (breakpoint 920px so real devices get it) */
@media (max-width: 920px) {
  .top-bar {
    flex-wrap: nowrap;
    justify-content: space-between;
    padding: var(--space-2) var(--space-3);
  }
  .top-bar-menu-btn {
    display: inline-flex;
  }
  .top-bar-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 100;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-2) 0;
    margin: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  .top-bar.open .top-bar-nav {
    display: flex;
    max-height: 85vh;
    overflow-y: auto;
    visibility: visible;
    opacity: 1;
  }
  .top-bar-nav .top-bar-link,
  .top-bar-nav .header-big-picture-link {
    padding: var(--space-3) var(--space-4);
    font-size: var(--fs-base);
    border-radius: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .top-bar-nav .top-bar-link:hover,
  .top-bar-nav .header-big-picture-link:hover {
    background: var(--bg-sidebar);
  }
}

/* Hero – logo left, search and results right on same row, centered */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-6) var(--space-4) var(--space-8);
  gap: var(--space-4);
  flex-shrink: 0;
}

.hero-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-6);
  flex-wrap: wrap;
  width: 100%;
}

.hero-logo {
  cursor: pointer;
  display: block;
  flex-shrink: 0;
}

.hero-logo:hover {
  opacity: 0.9;
}

.hero-logo-img {
  max-width: 420px;
  width: 100%;
  height: auto;
  display: block;
}

.hero-search-and-results {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
  max-width: 560px;
}

@keyframes search-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hero-logo.searching .hero-logo-img {
  animation: search-pulse 1.2s ease-in-out infinite;
}

.hero-search-wrap {
  position: relative;
  width: 100%;
}
.hero-search-form {
  width: 100%;
}
.search-autocomplete {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}
.search-autocomplete.hidden {
  display: none !important;
}
.search-autocomplete-item {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-4);
  border: none;
  background: none;
  color: var(--text);
  font-size: var(--fs-sm);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.search-autocomplete-item:hover,
.search-autocomplete-item:focus {
  background: var(--row-hover);
  outline: none;
}

.hero-search-form.search-form {
  flex: none;
}

.hero-btn-people {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--accent);
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font);
  transition: background .15s ease, border-color .15s ease;
}

.hero-btn-people:hover {
  background: var(--row-hover);
  border-color: var(--accent);
}

.hero-match-count-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: 2.5em;
}

.hero-match-count-wrap .search-match-count.hidden {
  display: none !important;
}
.hero-browse-results {
  font-size: var(--fs-sm);
  color: var(--accent);
  text-decoration: none;
}
.hero-browse-results:hover {
  text-decoration: underline;
}
.hero-browse-results.hidden {
  display: none !important;
}

.hero-btn-summary {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #fff;
  background: #2c2618;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font);
  text-shadow: 0 0 1px rgba(0,0,0,0.5);
}
.hero-btn-summary:hover {
  background: #3d3520;
  color: #fff;
  border-color: var(--accent-hover);
}
.hero .hero-summary-panel {
  align-self: stretch;
}
.hero-summary-panel {
  width: 100%;
  margin-top: var(--space-4);
  padding: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.hero-summary-panel.hidden {
  display: none !important;
}
.hero-summary-panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
}
.hero-summary-panel-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  font-size: 0.75em;
}
.hero-summary-panel-toggle:hover {
  background: var(--row-hover);
}
.hero-summary-panel-title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
}
.hero-summary-panel-body {
  padding: var(--space-4);
}
.hero-summary-panel.collapsed .hero-summary-panel-body {
  display: none;
}
.hero-summary-panel.collapsed .hero-summary-panel-header {
  border-bottom: none;
}
.hero-summary-panel-content {
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.hero-summary-rating {
  font-weight: 700;
  font-size: var(--fs-md);
  margin-bottom: var(--space-2);
}
.hero-summary-rating-label {
  font-weight: 500;
  color: var(--accent);
}
.hero-summary-verdict {
  font-style: italic;
  margin-bottom: var(--space-3);
  padding-left: 2px;
}
.hero-summary-body {
  margin-bottom: var(--space-4);
  white-space: pre-wrap;
}
.hero-summary-docs-title {
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.hero-summary-docs-list {
  margin: 0;
  padding-left: 1.2rem;
  list-style: disc;
}
.hero-summary-doc-link {
  color: var(--accent);
  text-decoration: none;
}
.hero-summary-doc-link:hover {
  text-decoration: underline;
}
.hero-summary-doc-link.really-bad {
  color: var(--error, #c0392b);
  font-weight: 600;
}
.hero-summary-doc-reason.really-bad {
  color: var(--error, #c0392b);
  font-weight: 600;
}

/* App body */
.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Sidebar – compact, less white space */
.sidebar {
  width: 280px;
  min-width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 0 6px 10px 6px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 300px;
  min-height: 260px;
  padding: 0;
  box-sizing: border-box;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-radius: 0 0 6px 6px;
  margin-bottom: 2px;
  overflow: hidden;
}

.sidebar-logo:hover {
  opacity: 0.9;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.donate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 16px;
  border-radius: 24px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  text-decoration: none;
}

.donate-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 1px 5px rgba(0,0,0,.3);
  color: #fff;
}

.nav-folders {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: none;
  border-radius: 0 24px 24px 0;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: rgba(0,0,0,.04);
}

.nav-item.active {
  background: rgba(198, 162, 74, .2);
  color: var(--accent-hover);
  font-weight: 500;
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.nav-label {
  flex: 1;
}

.nav-count {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 6px 0;
}

.nav-section-header .nav-section-label {
  padding: 0 0 0 12px;
}

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

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 12px 8px;
}

.contacts-wrap {
  flex: 1;
  min-height: 0;
  max-height: 55vh;
  overflow-y: auto;
}

.mentions-scroll-hint {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 12px 8px;
  opacity: 0.7;
  flex-shrink: 0;
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contacts-list .nav-item {
  padding: 6px 12px;
  font-size: 13px;
}

.mention-info-icon {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
  margin-left: 4px;
}

.random-btn {
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
}

.random-btn:hover {
  background: var(--bg-sidebar);
  color: var(--text);
}

.nav-link-btn {
  text-align: center;
  text-decoration: none;
  display: block;
  color: inherit;
  box-sizing: border-box;
}

/* Main */
.main,
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-panel);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border);
  min-height: 52px;
  background: var(--bg-panel);
}

.back-to-search-btn {
  margin-right: auto;
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
}

.back-to-search-btn:hover {
  background: var(--bg-sidebar);
  border-color: var(--accent);
}

.toolbar-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.toolbar-filter input {
  cursor: pointer;
}

.checkbox-wrap {
  margin: 0;
  cursor: pointer;
}

.learn-more-btn {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s ease, transform .1s ease;
}

.learn-more-btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

.learn-more-btn.hidden {
  display: none !important;
}

.mention-summary-inline {
  padding: 12px 16px;
  margin: 0 16px 12px;
  background: #f0f7ff;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.mention-summary-inline.hidden {
  display: none !important;
}

.mention-summary-inline .mention-summary-inline-title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.mention-summary-inline .more-details-btn,
.mention-summary-section .more-details-btn {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.mention-summary-inline .more-details-btn:hover,
.mention-summary-section .more-details-btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

.mention-summary-view .mention-detail-body {
  white-space: pre-wrap;
  line-height: 1.5;
}

.mention-summary-view .mention-no-detail {
  color: var(--text-muted);
  font-size: 13px;
}

.mention-summary-view {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  background: var(--bg);
}

.mention-summary-toolbar {
  margin-bottom: 16px;
}

.mention-summary-content h1 {
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 8px;
  color: var(--text);
}

.mention-summary-content .mention-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.mention-summary-content .mention-summary-section {
  margin-top: 20px;
}

.mention-summary-content .mention-summary-section h2 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 8px;
  color: var(--text);
}

.mention-summary-content .mention-summary-section p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.pagination-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 24px;
}
.pagination-group .pagination-label-left { margin-left: 0; margin-right: 0; }
.pagination-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
  margin-right: 8px;
}

.pagination-btns {
  display: flex;
  gap: 4px;
}

.toolbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.toolbar-loading {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 12px;
}

.toolbar-loading.hidden {
  display: none;
}

.search-match-count {
  text-align: center;
  font-size: 13px;
  color: var(--text);
  background: var(--match-highlight);
  padding: 6px 12px;
  border-radius: 6px;
}

.search-match-count.hidden {
  display: none;
}

.search-highlight {
  background: var(--match-highlight);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}
[data-theme="dark"] .search-highlight {
  background: #c9a227;
  color: #0c0e10;
  font-weight: 600;
}

/* Email list */
.home-category-lists {
  display: grid;
  grid-template-columns: repeat(4, minmax(280px, 1fr));
  gap: var(--space-6);
  padding: var(--space-6) var(--space-4);
  max-width: 1600px;
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.home-category-lists.hidden {
  display: none !important;
}
.home-links-block {
  grid-column: 1 / -1;
  margin-bottom: var(--space-3);
}
.home-links-block:last-of-type {
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-2);
}
.home-links-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 var(--space-2);
}
.home-category-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: center;
}
.home-category-link {
  color: var(--accent);
  text-decoration: none;
  font-size: var(--fs-sm);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
a.home-category-link:hover,
button.home-category-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}
@media (max-width: 1200px) {
  .home-category-lists {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}
@media (max-width: 600px) {
  .home-category-lists {
    grid-template-columns: 1fr;
  }
}
.home-category-separator {
  grid-column: 1 / -1;
  height: 1px;
  background: var(--border);
  margin: var(--space-2) 0;
}
.home-category-section {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-height: 120px;
  min-width: 0;
}
.home-category-section h3 {
  font-size: var(--fs-sm);
  font-weight: 600;
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  flex-shrink: 0;
}
.home-category-section h3 .count {
  color: var(--text-muted);
  font-weight: 400;
}
.home-category-section ul {
  list-style: none;
  margin: 0;
  padding: var(--space-2);
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.home-category-section li { margin: 0; padding: 0; }
.home-category-person {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--accent);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.home-category-person:hover {
  background: var(--row-hover);
  text-decoration: underline;
}
.home-category-person .count {
  color: var(--text-muted);
  font-weight: 400;
}
.home-category-person .home-person-rating {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9em;
}

.email-list {
  flex: 1;
  overflow-y: auto;
}

.email-row {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  min-height: 60px;
  transition: background .15s ease;
}

.email-row:hover {
  background: var(--row-hover);
}

.email-row.read {
  background: var(--bg-panel);
}

.email-row.selected {
  background: rgba(184, 134, 11, .12);
}

.email-row .star-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
}

.email-row .star-btn.starred {
  color: var(--star);
}

.email-row .star-placeholder {
  flex-shrink: 0;
  width: 32px;
}

.email-row .sender {
  min-width: 180px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  font-size: 14px;
}

.email-row .subject-snippet {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--text);
}

.email-row .subject-snippet .snippet {
  color: var(--text-muted);
  font-weight: 400;
}

.email-row .date {
  flex-shrink: 0;
  width: 120px;
  min-width: 120px;
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
}

.file-row .date {
  width: 120px;
  min-width: 120px;
  margin-left: auto;
  text-align: right;
}

.file-list-dataset {
  flex-shrink: 0;
  width: 36px;
  min-width: 36px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.file-list-summary {
  flex: 1;
  min-width: 200px;
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 0;
}

.file-list-summary-empty {
  color: var(--text-muted);
  opacity: 0.7;
}

.email-row .attachment-icon {
  flex-shrink: 0;
  width: 28px;
  display: inline-block;
  font-size: 16px;
  color: var(--text-muted);
  text-align: center;
}

.mostly-images-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-weight: 500;
}

.mostly-images-note {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 8px 0;
}

.search-match-wrap { margin-bottom: 12px; }
.search-match-note {
  font-size: 13px;
  color: var(--text);
  margin: 0;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--match-highlight);
}
.search-match-note.search-match-nowhere {
  color: var(--accent-hover);
  background: var(--match-highlight);
  padding: 8px 12px;
  border-radius: 6px;
}

.file-summary-block {
  background: rgba(198, 162, 74, .08);
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 0 8px 8px 0;
}
.file-summary-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.file-summary-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.file-content-block .message-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.25;
  padding: 12px 0;
}

/* Detail view */
.email-detail {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  background: var(--bg);
}

.email-detail.hidden {
  display: none;
}

.detail-toolbar {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.view-original-doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--accent);
  color: #1a1a1a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--accent-hover);
}

.view-original-doc-btn:hover {
  background: var(--accent-hover);
  color: #1a1a1a;
}

.view-doc-label {
  color: var(--text-muted);
  font-size: 13px;
}

.back-btn {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  font-size: 14px;
  color: var(--accent);
}

.back-btn:hover {
  background: var(--bg-sidebar);
}

.detail-nav-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: var(--bg);
  border: 1px solid var(--border);
}

.detail-nav-bar.hidden {
  display: none;
}

.detail-nav-match-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.detail-nav-match-wrap.hidden {
  display: none;
}

.detail-nav-btn.detail-nav-file {
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--bg-sidebar);
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.detail-nav-btn.detail-nav-file:hover:not(:disabled) {
  background: var(--row-hover);
}

.detail-nav-btn.detail-nav-file:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.search-match-btn {
  padding: 8px 12px;
  border: 1px solid var(--accent-hover);
  border-radius: 8px;
  background: var(--accent);
  color: #1a1a1a;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.search-match-btn:hover {
  background: var(--accent-hover);
  color: #1a1a1a;
}

.back-to-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top-btn:hover {
  background: var(--bg-sidebar);
}

.back-to-top-btn.hidden {
  display: none;
}

.detail-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.detail-subject {
  font-size: 18px;
  font-weight: 400;
  margin: 0;
  color: #000;
  word-break: break-word;
}
.detail-date {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
}

.detail-thread {
  margin-bottom: 24px;
}

/* Each email as a clean block: avatar, sender, to, body — no boxes */
.message-block {
  margin-bottom: 64px;
}

.message-block:last-child {
  margin-bottom: 0;
}

.message-header-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}

.message-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e87500;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.message-header-main {
  flex: 1;
  min-width: 0;
}

.message-sender-name {
  font-weight: bold;
  color: #000;
  font-size: 14px;
}

.message-sender-email {
  font-weight: normal;
  color: #606060;
  font-size: 13px;
  margin-left: 4px;
}

.message-header-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-date {
  font-size: 13px;
  color: #606060;
}

.message-icon {
  font-size: 14px;
  color: #808080;
}

.message-recipients {
  font-size: 13px;
  color: #000;
  margin-left: 48px;
  margin-bottom: 12px;
}

.message-body {
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  color: #000;
  margin-left: 48px;
  margin-top: 12px;
  display: block;
  min-height: 1em;
}

.message-body p {
  margin: 0 0 0.75em;
}

.message-body p:last-child {
  margin-bottom: 0;
}

.message-body ul,
.message-body ol {
  margin: 0.5em 0 1em 1.5em;
  padding-left: 1em;
}

.message-body li {
  margin-bottom: 0.25em;
}

.message-disclaimer {
  display: block;
  font-size: 12px;
  color: #606060;
  margin-top: 1em;
  line-height: 1.5;
}

.message-icon-star {
  opacity: 0.6;
}

.message-block-full .message-body-full {
  margin-left: 0;
}

.message-avatar-full {
  background: #606060;
}

.message-body a {
  color: var(--link-accent);
  text-decoration: underline;
}

.message-body a:hover {
  text-decoration: underline;
}

.detail-doc {
  margin-top: 24px;
  padding: 16px;
  border-top: 1px solid var(--border);
  border-radius: 8px;
  background: var(--doc-panel);
  font-size: 12px;
  color: var(--doc-text);
}

/* Redaction blocks */
.redaction-bar {
  display: inline-block;
  position: relative;
  background: var(--redaction);
  min-width: 100px;
  height: 1.15em;
  vertical-align: middle;
  border: none;
  border-radius: 1px;
  cursor: default;
}

.email-row .redaction-bar {
  min-width: 80px;
  height: 1em;
}

/* Allow custom tooltip to show in list (avoid clip); keep ellipsis when no redaction */
.email-row .sender:has(.redaction-bar) {
  overflow: visible;
}

/* Styled tooltip on hover (explains why content may be redacted) */
.redaction-bar::after {
  content: attr(data-redaction-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 100;
  min-width: 280px;
  max-width: 480px;
  padding: 8px 12px;
  background: #3d3d3d;
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
}

.redaction-bar:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Empty / loading */
.empty-state,
.empty-state-hint {
  padding: var(--space-8) var(--space-6);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
}

.welcome-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-6);
  padding: var(--space-8);
  max-width: 920px;
  margin: 0 auto;
}

.welcome-block {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  cursor: default;
  transition: border-color .2s ease, box-shadow .2s ease;
  box-shadow: var(--shadow);
}

.welcome-block[data-focus="search"] {
  cursor: pointer;
}

.welcome-block[data-focus="search"]:hover,
.welcome-block[data-focus="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.welcome-block-icon {
  font-size: 2rem;
  margin-bottom: var(--space-4);
  opacity: 0.85;
}

.welcome-block-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  margin: 0 0 var(--space-2);
  color: var(--text);
  letter-spacing: -0.01em;
}

.welcome-block-text {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0;
  line-height: var(--lh-relaxed);
}

.welcome-block-muted .welcome-block-text {
  font-size: var(--fs-xs);
}

.hidden {
  display: none !important;
}

/* Settings dialog */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.settings-overlay.hidden {
  display: none !important;
}

.settings-dialog {
  background: var(--bg);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 100%;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.settings-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
}

.settings-close {
  font-size: 24px;
  line-height: 1;
}

.settings-body {
  padding: 20px;
}

.settings-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: var(--fs-base);
  color: var(--text);
}

.settings-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.settings-hint {
  margin: 12px 0 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.4;
}

/* Summary (AI summary) dialog */
.summary-dialog {
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.summary-dialog-body {
  overflow-y: auto;
  padding: var(--space-4);
  min-height: 0;
}

.summary-dialog-content {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* People mentioned dialog */
.people-dialog {
  max-width: 420px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.people-dialog-body {
  overflow-y: auto;
  padding: var(--space-3);
  min-height: 0;
}

.people-dialog-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.people-dialog-list .nav-item {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  border-radius: var(--radius-sm);
}

/* Help / dataset dialog */
.help-dialog {
  max-width: 900px;
}

.help-loading {
  margin: 0;
  color: var(--text-muted);
}

.help-dataset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 16px;
  margin-bottom: 4px;
  padding-bottom: 4px;
}

.help-dataset-list .help-section-title:first-child {
  margin-top: 0;
}

.help-dataset-row {
  display: grid;
  grid-template-columns: 32px 90px 48px 40px minmax(200px, 1fr);
  align-items: center;
  gap: 10px 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.help-dataset-row:last-child {
  border-bottom: none;
}

.help-ds-num {
  font-weight: 600;
  color: var(--text-muted);
}

.help-ds-link {
  color: inherit;
  text-decoration: none;
}

.help-ds-link:hover {
  text-decoration: underline;
  color: var(--accent);
}

.help-ds-loaded {
  font-variant-numeric: tabular-nums;
}

.help-ds-doj {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.help-dataset-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.help-dataset-row.help-dataset-totals {
  font-weight: 600;
  border-top: 2px solid var(--border);
  padding-top: 8px;
  margin-top: 2px;
}

.help-ds-summary {
  font-size: 11px;
  line-height: 1.2;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.help-ds-summary:not(.help-ds-summary-empty) {
  cursor: pointer;
}

.help-dataset-row-expanded .help-ds-summary {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.help-dataset-row-expanded {
  align-items: start;
}

.help-dataset-header .help-ds-summary {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  cursor: default;
}

.help-ds-summary-empty {
  color: var(--text-muted);
}

.help-dataset-pct {
  font-weight: 500;
  color: var(--accent);
}

.settings-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.settings-option input {
  cursor: pointer;
}

@media (max-width: 768px) {
  .sidebar {
    width: 64px;
    min-width: 64px;
  }

  .logo-text,
  .nav-label,
  .nav-count,
  .nav-section-label,
  .contacts-list .nav-item .nav-label,
  .random-btn {
    display: none;
  }

  .donate-btn span {
    display: none;
  }

  .sender {
    min-width: 100px;
    max-width: 120px;
  }
}
