/* ==========================================================================
   The Vault Theme - Bold Archival Aesthetic
   A dramatic, authoritative design for the Research Database
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  /* Vault Colors */
  --vault-primary: #1B3B2F;
  --vault-primary-hover: #0F2920;
  --vault-primary-light: #2A5445;

  --vault-accent: #B8860B;
  --vault-accent-hover: #9A7209;
  --vault-accent-muted: #D4A84B;

  --vault-bg-deep: #0D1612;
  --vault-bg: #F7F5F0;
  --vault-bg-elevated: #FFFFFF;
  --vault-bg-recessed: #EBE8E1;

  --vault-text: #1A1A1A;
  --vault-text-secondary: #4A4A4A;
  --vault-text-muted: #7A7A7A;
  --vault-text-inverse: #F7F5F0;

  --vault-border: #D5D0C4;
  --vault-border-dark: #1B3B2F;
  --vault-divider: #C8C3B8;

  --vault-success: #2D5A3D;
  --vault-warning: #B8860B;
  --vault-danger: #8B2635;

  /* Theme compatibility aliases */
  --color-primary: var(--vault-primary);
  --color-primary-hover: var(--vault-primary-hover);
  --color-primary-light: var(--vault-primary-light);
  --color-secondary: var(--vault-accent);
  --color-secondary-hover: var(--vault-accent-hover);
  --color-background: var(--vault-bg);
  --color-surface: var(--vault-bg-elevated);
  --color-surface-elevated: var(--vault-bg-elevated);
  --color-text: var(--vault-text);
  --color-text-secondary: var(--vault-text-secondary);
  --color-text-muted: var(--vault-text-muted);
  --color-border: var(--vault-border);
  --color-border-light: var(--vault-divider);
  --color-success: var(--vault-success);
  --color-danger: var(--vault-danger);
  --color-warning: var(--vault-warning);

  /* RGB channel triplets — let themes re-tint every translucent overlay,
     texture, shadow and focus ring by overriding a single value each. */
  --vault-primary-rgb: 27, 59, 47;
  --vault-accent-rgb: 184, 134, 11;
  --vault-bg-deep-rgb: 13, 22, 18;

  /* Strong status shades (used for filled hover states + info tiles) */
  --vault-success-strong: #245840;
  --vault-danger-strong: #7C2323;
  --vault-warning-strong: #9A6619;
  --vault-info: #4A7C9B;

  /* Neutral drop shadows for raised imagery (thumbnails/tooltips) */
  --shadow-thumb: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-thumb-hover: 0 4px 12px rgba(0, 0, 0, 0.15);

  /* Typography - System fonts with distinctive fallbacks */
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: Georgia, 'Times New Roman', serif;
  --font-mono: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  /* Spacing */
  --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;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(var(--vault-primary-rgb), 0.06);
  --shadow-md: 0 2px 8px rgba(var(--vault-primary-rgb), 0.1);
  --shadow-lg: 0 4px 16px rgba(var(--vault-primary-rgb), 0.12);
  --shadow-card: 0 1px 3px rgba(var(--vault-primary-rgb), 0.08), 0 1px 2px rgba(var(--vault-primary-rgb), 0.04);
  --shadow-card-hover: 0 8px 24px rgba(var(--vault-primary-rgb), 0.14);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius: 6px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-slow: 400ms cubic-bezier(0.22, 1, 0.36, 1);

  /* Layout */
  --header-height: 64px;
  --footer-height: 56px;
  --content-max-width: 1200px;
  --content-narrow: 800px;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes vault-reveal {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes vault-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes vault-scale-in {
  from {
    opacity: 0;
    transform: scaleY(0);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

.vault-animate {
  animation: vault-reveal 0.7s var(--transition-base) forwards;
  opacity: 0;
}

.vault-animate-1 { animation-delay: 0.1s; }
.vault-animate-2 { animation-delay: 0.2s; }
.vault-animate-3 { animation-delay: 0.3s; }
.vault-animate-4 { animation-delay: 0.4s; }
.vault-animate-5 { animation-delay: 0.5s; }

/* --------------------------------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--vault-text);
  background-color: var(--vault-bg);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  color: var(--vault-text);
  margin: 0 0 var(--space-4) 0;
}

h1 { font-size: var(--text-4xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

h5, h6 {
  font-size: var(--text-sm);
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--vault-text-secondary);
}

p { margin: 0 0 var(--space-4) 0; }
strong { font-weight: 600; color: var(--vault-text); }
small { font-size: var(--text-sm); color: var(--vault-text-secondary); }

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */
a {
  color: var(--vault-primary);
  text-decoration: underline;
  text-decoration-color: var(--vault-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--transition-fast),
              text-decoration-color var(--transition-fast),
              text-decoration-thickness var(--transition-fast);
}

a:hover {
  color: var(--vault-primary-hover);
  text-decoration-color: var(--vault-primary-hover);
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--vault-accent);
  outline-offset: 2px;
  border-radius: 1px;
}

/* Heading links keep the heading's ink color; the gold rule signals the link */
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
  color: inherit;
  text-decoration-color: var(--vault-accent);
  text-underline-offset: 0.2em;
}

h1 a:hover, h2 a:hover, h3 a:hover,
h4 a:hover, h5 a:hover, h6 a:hover {
  color: var(--vault-primary-hover);
  text-decoration-color: var(--vault-primary-hover);
}

/* Vault link with animated underline */
.vault-link {
  position: relative;
  color: var(--vault-primary);
  text-decoration: none;
}

.vault-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--vault-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--transition-base);
}

.vault-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.vault-link:hover {
  color: var(--vault-primary);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Main Layout
   -------------------------------------------------------------------------- */
main {
  padding-top: var(--header-height);
  padding-bottom: var(--footer-height);
  min-height: 100vh;
  background-color: var(--vault-bg);
}

.splash-background {
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  width: 100%;
  background-color: var(--vault-bg);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--vault-bg-deep);
  border-bottom: 1px solid var(--vault-accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  z-index: 100;
}

.site-title {
  flex-shrink: 0;
}

.site-title a {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--vault-text-inverse);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color var(--transition-fast);
}

.site-title a:hover {
  color: var(--vault-accent);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-1);
}

.nav-item {
  margin: 0;
  padding: 0;
  border: none;
}

.nav-link {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--vault-text-inverse);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  opacity: 0.85;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--vault-accent);
  background-color: rgba(var(--vault-accent-rgb), 0.1);
  text-decoration: none;
  opacity: 1;
}

.nav-link.active {
  color: var(--vault-accent);
  opacity: 1;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-toggle::after {
  content: " \25BE";
  font-size: 0.75em;
  opacity: 0.7;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background-color: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2) 0;
  z-index: 200;
  margin-top: var(--space-2);
}

/* Container nav dropdowns sit on the left of the header, so their flyouts
   align left. Settings stays right-aligned (it's at the right of the nav). */
.dropdown-menu[aria-labelledby="collectionsDropdown"],
.dropdown-menu[aria-labelledby="casefilesDropdown"] {
  right: auto;
  left: 0;
}

.dropdown-menu::before {
  content: '';
  position: absolute;
  top: calc(-1 * var(--space-2));
  left: 0;
  right: 0;
  height: var(--space-2);
  background: transparent;
}

/* The add-to-container dropdown is click-controlled by add_to_container.js
   (it lazy-loads its list on click); excluding it here keeps hover from
   revealing the un-populated "Loading…" placeholder. */
.dropdown:not(#add-to-container):hover .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--vault-text);
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
  background-color: var(--vault-bg-recessed);
  color: var(--vault-primary);
  text-decoration: none;
}

.dropdown-header {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vault-text-muted);
  margin: 0;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--vault-divider);
  margin: var(--space-2) 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.main-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  background-color: var(--vault-bg-deep);
  border-top: 1px solid var(--vault-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-6);
}

.footer-content {
  text-align: center;
}

.footer-content p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--vault-text-inverse);
  opacity: 0.7;
}

.footer-content a {
  color: var(--vault-text-inverse);
  margin-left: var(--space-4);
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.footer-content a:hover {
  color: var(--vault-accent);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Vault Hero - Split Screen Layout (Home Page)
   -------------------------------------------------------------------------- */
.vault-hero {
  display: grid;
  grid-template-columns: 3fr 2fr;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

.vault-hero-left {
  background: var(--vault-bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  position: relative;
  overflow: hidden;
}

/* Subtle texture overlay */
.vault-hero-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* Decorative corner accent */
.vault-hero-left::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, transparent 50%, var(--vault-accent) 50%);
  opacity: 0.08;
}

.vault-hero-right {
  background: var(--vault-bg);
  padding: var(--space-8) var(--space-10);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

/* Vertical accent line */
.vault-hero-right::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--space-12);
  bottom: var(--space-12);
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--vault-accent), transparent);
}

.vault-brand {
  text-align: center;
  position: relative;
  z-index: 1;
}

.vault-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  color: var(--vault-text-inverse);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.vault-divider {
  color: var(--vault-accent);
  font-size: var(--text-xl);
  margin: var(--space-6) 0;
  opacity: 0.8;
  letter-spacing: 0.5em;
}

.vault-tagline {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--vault-text-inverse);
  opacity: 0.75;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Vault Collections (Latest Entries/Documents)
   -------------------------------------------------------------------------- */
.vault-collections {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.vault-collection {
  background: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base);
}

.vault-collection:hover {
  box-shadow: var(--shadow-card-hover);
}

.vault-collection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  background: var(--vault-bg-recessed);
  border-bottom: 1px solid var(--vault-divider);
}

.vault-collection-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--vault-primary);
  margin: 0;
  font-weight: 400;
}

.vault-collection-count {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--vault-accent);
  background: rgba(var(--vault-accent-rgb), 0.1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
}

.vault-index-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.vault-index-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--vault-divider);
  position: relative;
  transition: background-color var(--transition-fast), transform var(--transition-base);
}

.vault-index-item:last-child {
  border-bottom: none;
}

.vault-index-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--vault-accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--transition-base);
}

.vault-index-item:hover {
  background-color: rgba(var(--vault-primary-rgb), 0.03);
  transform: translateX(4px);
}

.vault-index-item:hover::before {
  transform: scaleY(1);
}

.vault-index-tab {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--vault-accent);
  background: rgba(var(--vault-accent-rgb), 0.12);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.vault-index-item:hover .vault-index-tab {
  background: var(--vault-accent);
  color: var(--vault-bg-elevated);
}

.vault-index-item a {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--vault-text);
  flex: 1;
  transition: color var(--transition-fast);
}

.vault-index-item:hover a {
  color: var(--vault-primary);
}

/* --------------------------------------------------------------------------
   Vault Welcome Section
   -------------------------------------------------------------------------- */
.vault-welcome {
  background: var(--vault-bg-recessed);
  border-top: 1px solid var(--vault-divider);
  padding: var(--space-10) var(--space-8);
  text-align: center;
}

.vault-welcome-content {
  max-width: 700px;
  margin: 0 auto;
}

.vault-welcome-content p {
  font-size: var(--text-base);
  color: var(--vault-text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Home Page Layout
   -------------------------------------------------------------------------- */
.home-container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

.home-header {
  text-align: center;
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-6);
  position: relative;
}

.home-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--vault-accent), transparent);
}

.home-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  color: var(--vault-primary);
  margin: 0 0 var(--space-3);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.home-tagline {
  font-size: var(--text-sm);
  color: var(--vault-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0;
  font-weight: 400;
}

/* Feed Sections */
.home-feeds {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.feed-section {
  background: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.feed-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  background: var(--vault-bg-recessed);
  border-bottom: 1px solid var(--vault-divider);
}

.feed-section-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--vault-primary);
  margin: 0;
}

.feed-section-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--vault-accent);
  background: rgba(var(--vault-accent-rgb), 0.12);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

/* Compact Feed List */
.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed-item {
  border-bottom: 1px solid var(--vault-divider);
}

.feed-item:last-child {
  border-bottom: none;
}

.feed-item-link {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.feed-item-link:hover {
  background-color: rgba(var(--vault-primary-rgb), 0.03);
  text-decoration: none;
  color: inherit;
}

.feed-item-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--vault-bg-recessed);
}

.feed-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-item-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--vault-bg-deep) 0%, var(--vault-primary-light) 100%);
}

.feed-item-thumb-placeholder.entry {
  background: linear-gradient(135deg, var(--vault-accent-muted) 0%, var(--vault-accent) 100%);
}

.feed-item-thumb-placeholder.document {
  background: linear-gradient(135deg, var(--vault-primary-light) 0%, var(--vault-primary) 100%);
}

.feed-item-content {
  flex: 1;
  min-width: 0;
}

.feed-item-title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--vault-text);
  margin: 0;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-item-link:hover .feed-item-title {
  color: var(--vault-primary);
}

.feed-item-desc {
  font-size: var(--text-xs);
  color: var(--vault-text-muted);
  margin: 2px 0 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-item-date {
  flex-shrink: 0;
  font-size: var(--text-xs);
  color: var(--vault-text-muted);
  font-family: var(--font-mono);
}

.feed-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.feed-tag {
  display: inline-block;
  font-size: 0.65rem;
  color: var(--vault-accent);
  background: rgba(var(--vault-accent-rgb), 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.feed-tag-more {
  display: inline-block;
  font-size: 0.65rem;
  color: var(--vault-text-muted);
  padding: 2px 4px;
}

/* Feed Footer */
.feed-section-footer {
  padding: var(--space-3) var(--space-5);
  background: var(--vault-bg-recessed);
  border-top: 1px solid var(--vault-divider);
  text-align: right;
}

.feed-view-all {
  font-size: var(--text-sm);
  color: var(--vault-primary);
  text-decoration: none;
  font-weight: 500;
}

.feed-view-all:hover {
  color: var(--vault-primary-hover);
  text-decoration: underline;
}

/* Feed Empty State */
.feed-empty {
  text-align: center;
  padding: var(--space-8) var(--space-6);
  color: var(--vault-text-muted);
}

.feed-empty p {
  margin: 0;
  font-size: var(--text-sm);
}

/* Home Welcome */
.home-welcome {
  margin-top: var(--space-8);
  padding: var(--space-6);
  background: var(--vault-bg-recessed);
  border-radius: var(--radius-lg);
  text-align: center;
}

.home-welcome-content {
  max-width: 600px;
  margin: 0 auto;
}

.home-welcome-content p {
  font-size: var(--text-sm);
  color: var(--vault-text-secondary);
  line-height: 1.6;
  margin: 0 0 var(--space-3);
}

.home-welcome-content p:last-child {
  margin-bottom: 0;
}

/* Home Responsive */
@media (max-width: 576px) {
  .home-container {
    padding: var(--space-6) var(--space-4);
  }

  .home-title {
    font-size: var(--text-2xl);
  }

  .feed-item-link {
    padding: var(--space-3) var(--space-4);
    gap: var(--space-3);
  }

  .feed-item-thumb {
    width: 40px;
    height: 40px;
  }

  .feed-item-title {
    font-size: var(--text-sm);
  }

  .feed-item-desc {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Legacy Container Support (for non-home pages)
   -------------------------------------------------------------------------- */
.container,
.entry-container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.container-narrow {
  max-width: var(--content-narrow);
}

/* Page Header (legacy support) */
.page-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--vault-border);
}

.page-header h1 {
  font-family: var(--font-heading);
  color: var(--vault-primary);
  margin-bottom: var(--space-2);
}

.page-header .tagline {
  font-size: var(--text-lg);
  color: var(--vault-text-secondary);
  margin: 0;
}

/* Legacy widget support (for backwards compatibility) */
.widget-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.latest-entries-widget,
.latest-documents-widget {
  background-color: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
}

.latest-entries-widget h3,
.latest-documents-widget h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  color: var(--vault-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--vault-divider);
}

.latest-entries-widget ul,
.latest-documents-widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.latest-entries-widget li,
.latest-documents-widget li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--vault-divider);
}

.latest-entries-widget li:last-child,
.latest-documents-widget li:last-child {
  border-bottom: none;
}

.latest-entries-widget li a,
.latest-documents-widget li a {
  color: var(--vault-text);
  font-size: var(--text-sm);
  line-height: 1.4;
  display: block;
}

.latest-entries-widget li a:hover,
.latest-documents-widget li a:hover {
  color: var(--vault-primary);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background-color: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
}

.card-clickable {
  cursor: pointer;
}

.card-clickable:hover {
  transform: translateY(-2px);
}

.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--vault-divider);
  background-color: var(--vault-bg-recessed);
}

.card-header h5 {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vault-text-secondary);
  margin: 0;
}

.card-body {
  padding: var(--space-5);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.5;
  color: var(--vault-text);
  background-color: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn:hover {
  background-color: var(--vault-bg-recessed);
  border-color: var(--vault-text-secondary);
  text-decoration: none;
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
}

.btn-primary {
  background-color: var(--vault-primary);
  border-color: var(--vault-primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--vault-primary-hover);
  border-color: var(--vault-primary-hover);
  color: white;
}

.btn-secondary {
  background-color: var(--vault-accent);
  border-color: var(--vault-accent);
  color: white;
}

.btn-secondary:hover {
  background-color: var(--vault-accent-hover);
  border-color: var(--vault-accent-hover);
  color: white;
}

.btn-success {
  background-color: var(--vault-success);
  border-color: var(--vault-success);
  color: white;
}

.btn-success:hover {
  background-color: var(--vault-success-strong);
  border-color: var(--vault-success-strong);
  color: white;
}

.btn-danger {
  background-color: var(--vault-danger);
  border-color: var(--vault-danger);
  color: white;
}

.btn-danger:hover {
  background-color: var(--vault-danger-strong);
  border-color: var(--vault-danger-strong);
  color: white;
}

.btn-warning {
  background-color: var(--vault-warning);
  border-color: var(--vault-warning);
  color: white;
}

.btn-warning:hover {
  background-color: var(--vault-warning-strong);
  border-color: var(--vault-warning-strong);
  color: white;
}

.btn-outline-primary {
  background-color: transparent;
  border: 1px solid var(--vault-primary);
  color: var(--vault-primary);
}

.btn-outline-primary:hover {
  background-color: var(--vault-primary);
  color: white;
}

.btn-outline-secondary {
  background-color: transparent;
  border: 1px solid var(--vault-border);
  color: var(--vault-text-secondary);
}

.btn-outline-secondary:hover {
  background-color: var(--vault-bg-recessed);
  border-color: var(--vault-text-secondary);
  color: var(--vault-text);
}

.btn-outline-danger {
  background-color: transparent;
  border: 1px solid var(--vault-danger);
  color: var(--vault-danger);
}

.btn-outline-danger:hover {
  background-color: var(--vault-danger);
  color: white;
}

.btn-outline-warning {
  background-color: transparent;
  border: 1px solid var(--vault-warning);
  color: var(--vault-warning);
}

.btn-outline-warning:hover {
  background-color: var(--vault-warning);
  color: white;
}

.btn-small {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
}

.btn-edit {
  background-color: var(--vault-primary);
  color: white;
}

.btn-edit:hover {
  background-color: var(--vault-primary-hover);
}

.btn-delete {
  background-color: var(--vault-danger);
  color: white;
}

.btn-delete:hover {
  background-color: var(--vault-danger-strong);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-input,
.form-textarea,
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--vault-text);
  background-color: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-control:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--vault-primary);
  box-shadow: 0 0 0 3px rgba(var(--vault-primary-rgb), 0.12);
}

/* Keep the per-page selector compact and inline next to its label,
   overriding the global `select { width: 100%; }` rule above. */
.per-page-form select {
  width: auto;
  flex: 0 0 auto;
  padding: 0.2rem 0.4rem;
  font-size: 0.875rem;
}

.form-textarea,
textarea {
  resize: vertical;
  min-height: 120px;
}

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--vault-text);
  margin-bottom: var(--space-2);
}

.form-group {
  margin-bottom: var(--space-5);
}

.form-text {
  display: block;
  font-size: var(--text-xs);
  color: var(--vault-text-muted);
  margin-top: var(--space-2);
}

.text-danger {
  color: var(--vault-danger);
}

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(var(--vault-bg-deep-rgb), 0.6);
  z-index: 1000;
  padding: var(--space-8);
  overflow-y: auto;
}

.modal-content {
  background-color: var(--vault-bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  margin: 10vh auto;
  padding: 0;
  text-align: left;
}

.modal-content h2 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--vault-text);
  padding: var(--space-6);
  margin: 0;
  border-bottom: 1px solid var(--vault-divider);
}

.modal-content form {
  padding: var(--space-6);
}

.modal-content p {
  font-size: var(--text-lg);
  margin-bottom: var(--space-6);
}

.modal-content .btn {
  margin: 0 var(--space-2);
}

.modal-content.modal-confirm {
  max-width: 400px;
  text-align: center;
  padding: var(--space-8);
}

/* --------------------------------------------------------------------------
   Entry Cards
   -------------------------------------------------------------------------- */
.entry-card {
  display: flex;
  gap: var(--space-5);
  background-color: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.entry-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 88px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--vault-bg-recessed);
  display: block;
}

.entry-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.entry-thumb-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--vault-accent-muted) 0%, var(--vault-accent) 100%);
}

.entry-card-body {
  flex: 1;
  min-width: 0;
}

.entry-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.entry-card h4 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

.entry-card h4 a {
  color: var(--vault-primary);
}

.entry-card h4 a:hover {
  color: var(--vault-primary-hover);
  text-decoration: underline;
}

.entry-card p {
  font-size: var(--text-sm);
  color: var(--vault-text-secondary);
  margin-bottom: var(--space-2);
  line-height: 1.5;
}

.entry-card .entry-meta {
  font-size: var(--text-xs);
  color: var(--vault-text-muted);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--vault-divider);
}

.entry-card .entry-meta .meta-row {
  display: block;
}

.entry-card .entry-meta .meta-row + .meta-row {
  margin-top: var(--space-1);
}

.entry-card .entry-meta .meta-row a {
  color: var(--vault-primary);
}

/* --------------------------------------------------------------------------
   Document Cards
   -------------------------------------------------------------------------- */
.document-entry {
  display: flex;
  gap: var(--space-5);
  background-color: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  cursor: pointer;
}

.document-entry:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.document-entry img {
  width: 100px;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--vault-divider);
  flex-shrink: 0;
}

.document-entry .document-info {
  flex: 1;
  min-width: 0;
}

.document-entry p {
  margin: 0 0 var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--vault-text-secondary);
}

.document-entry p:first-child {
  font-size: var(--text-base);
}

.document-entry p:first-child a {
  font-family: var(--font-heading);
  font-weight: 400;
  color: var(--vault-primary);
}

.document-entry p:first-child a:hover {
  text-decoration: underline;
}

.document-entry p:last-child {
  font-size: var(--text-xs);
  color: var(--vault-text-muted);
}

.document-entry p.card-added,
.document-entry p.card-containers {
  font-size: var(--text-xs);
  color: var(--vault-text-muted);
}

.document-entry p.card-containers a {
  color: var(--vault-primary);
}

/* --------------------------------------------------------------------------
   Detail Pages
   -------------------------------------------------------------------------- */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--vault-border);
}

.detail-header-main {
  min-width: 0;
}

.detail-header .dropdown {
  flex-shrink: 0;
}

.detail-header h1 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
}

.detail-meta {
  margin-bottom: var(--space-6);
}

.detail-meta p {
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.detail-meta strong {
  color: var(--vault-text);
  font-weight: 600;
  margin-right: var(--space-2);
}

/* Geocoding Display */
.geo-locations {
  margin: var(--space-2) 0;
}

.geo-location-list {
  margin: var(--space-2) 0;
  padding-left: var(--space-6);
  list-style-type: none;
}

.geo-location-list li {
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}

.geo-location-list .coordinates {
  font-family: var(--font-mono);
  color: var(--vault-text-secondary);
}

.geo-location-list .confidence {
  font-size: var(--text-xs);
  color: var(--vault-text-muted);
  margin-left: var(--space-2);
}

/* Source Passage Blockquote */
.source-passage,
blockquote {
  background-color: var(--vault-bg-recessed);
  border-left: 3px solid var(--vault-accent);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-4) 0;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--vault-text-secondary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.passage-highlight {
  font-weight: bold;
  background-color: rgba(var(--vault-accent-rgb), 0.25);
  color: var(--vault-text);
  padding: 1px 3px;
  border-radius: 2px;
}

/* Source Spans */
.source-spans {
  margin-top: var(--space-4);
}

.source-span-item {
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  border-left: 3px solid var(--vault-primary);
  background: var(--vault-bg-recessed);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.source-span-item.unvalidated {
  border-left-color: var(--vault-warning);
  background: rgba(var(--vault-accent-rgb), 0.08);
}

.source-span-text {
  margin: 0 0 var(--space-2) 0;
  padding: 0;
  font-style: italic;
  line-height: 1.6;
  color: var(--vault-text);
}

.source-span-translation {
  margin: 0 0 var(--space-2) 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--vault-text-muted);
}

.source-span-claim {
  display: block;
  font-size: var(--text-sm);
  color: var(--vault-text-muted);
  font-style: normal;
}

.source-span-item .match-score {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 2px 6px;
  font-size: var(--text-xs);
  background: var(--vault-warning);
  color: white;
  border-radius: var(--radius-sm);
}

/* Source page links */
.source-pages {
  margin-bottom: var(--space-4);
  padding: var(--space-2) 0;
}

.source-page-link {
  display: inline-block;
  padding: 4px 10px;
  margin-right: var(--space-2);
  background: var(--vault-primary);
  color: white;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: background 0.2s;
}

.source-page-link:hover {
  background: var(--vault-primary-hover);
  color: white;
}

.doc-page-link {
  color: var(--vault-primary);
  text-decoration: none;
  margin-right: 0.75em;
}

.doc-page-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: var(--space-3) 0;
  margin-bottom: var(--space-4);
  list-style: none;
  background: none;
  border: none;
}

.breadcrumb-item {
  font-size: var(--text-sm);
  color: var(--vault-text-secondary);
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  padding: 0 var(--space-2);
  color: var(--vault-text-muted);
}

.breadcrumb-item a {
  color: var(--vault-text-secondary);
}

.breadcrumb-item a:hover {
  color: var(--vault-primary);
}

.breadcrumb-item.active {
  color: var(--vault-text);
}

/* --------------------------------------------------------------------------
   Tags
   -------------------------------------------------------------------------- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 0;
  align-items: center;
}

.tag-cloud-item {
  padding: 0.25rem 0.5rem;
  text-decoration: none;
  color: var(--vault-primary);
  transition: opacity 0.2s;
  white-space: nowrap;
}

.tag-cloud-item:hover {
  opacity: 0.7;
}

.tag-count {
  font-size: 0.7em;
  color: var(--vault-text-muted);
  margin-left: 0.25rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--vault-bg-recessed);
  border: 1px solid var(--vault-accent);
  border-radius: 1rem;
  font-size: 0.85em;
  text-decoration: none;
  color: var(--vault-text);
  transition: background 0.2s, color 0.2s;
}

.tag-badge:hover {
  background: var(--vault-accent);
  color: white;
}

.tag-badge-sm {
  padding: 0.15rem 0.5rem;
  font-size: 0.75em;
}

.tag-count-small {
  font-size: 0.8em;
  opacity: 0.7;
  margin-left: 0.25rem;
}

.tags-section {
  margin: 1.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--vault-divider);
}

.tags-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2, 0.5rem);
}

.tags-section h3 {
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: var(--space-6) 0;
  gap: var(--space-1);
}

.page-item {
  margin: 0;
}

.page-link {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--vault-primary);
  background-color: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.page-link:hover {
  background-color: var(--vault-primary);
  border-color: var(--vault-primary);
  color: white;
  text-decoration: none;
}

.page-item.active .page-link {
  background-color: var(--vault-primary);
  border-color: var(--vault-primary);
  color: white;
}

.page-item.disabled .page-link {
  color: var(--vault-text-muted);
  pointer-events: none;
  background-color: var(--vault-bg-recessed);
}

.pagination-info {
  color: var(--vault-text-secondary);
}

/* --------------------------------------------------------------------------
   Admin Dashboard Stats
   -------------------------------------------------------------------------- */
.stats-row {
  margin: var(--space-6) 0;
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-4);
}

.stat-card {
  background-color: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-card);
}

.stat-card h5 {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vault-text-muted);
  margin-bottom: var(--space-2);
}

.stat-card h2 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  color: var(--vault-primary);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.badge-admin,
.badge-danger {
  background-color: var(--vault-primary);
  color: white;
}

.badge-editor,
.badge-warning {
  background-color: var(--vault-accent);
  color: white;
}

.badge-member,
.badge-info {
  background-color: var(--vault-text-muted);
  color: white;
}

.badge-active,
.badge-success {
  background-color: var(--vault-success);
  color: white;
}

.badge-inactive,
.badge-secondary {
  background-color: var(--vault-border);
  color: var(--vault-text-secondary);
}

.badge-pending {
  background-color: var(--vault-warning);
  color: white;
}

.badge-processing {
  background-color: var(--vault-info);
  color: white;
}

/* Upload-counter badge in the top nav. The generic .badge rules above don't
   apply (the nav badge only carries .nav-badge + a state class), so it needs
   its own structural styling — otherwise it renders as a square, unsized box.
   Scoped state selectors keep the pending/processing colors order-independent. */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  vertical-align: middle;
  background-color: var(--vault-text-muted);
  color: white;
}

.nav-badge.badge-pending {
  background-color: var(--vault-warning);
  color: white;
}

.nav-badge.badge-processing {
  background-color: var(--vault-info);
  color: white;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table,
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td,
.admin-table th,
.admin-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--vault-divider);
}

.table th,
.admin-table th {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vault-text-secondary);
  background-color: var(--vault-bg-recessed);
}

.table tbody tr,
.admin-table tbody tr {
  transition: background-color var(--transition-fast);
}

.table tbody tr:hover,
.admin-table tbody tr:hover {
  background-color: rgba(var(--vault-primary-rgb), 0.03);
}

.table-striped tbody tr:nth-child(odd) {
  background-color: rgba(var(--vault-primary-rgb), 0.02);
}

.table-sm th,
.table-sm td {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

.admin-table code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background-color: var(--vault-bg-recessed);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   List Groups
   -------------------------------------------------------------------------- */
.list-group {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-group-flush {
  border-radius: 0;
}

.list-group-item {
  display: block;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--vault-divider);
  background-color: transparent;
  transition: background-color var(--transition-fast);
}

.list-group-item:last-child {
  border-bottom: none;
}

.list-group-item-action {
  color: var(--vault-text);
  text-decoration: none;
}

.list-group-item-action:hover {
  background-color: rgba(var(--vault-primary-rgb), 0.03);
  color: var(--vault-primary);
  text-decoration: none;
}

.list-group-item i {
  margin-right: var(--space-3);
  color: var(--vault-text-muted);
  width: 16px;
}

.list-group-item-action:hover i {
  color: var(--vault-primary);
}

.list-group-item h6 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin: 0;
}

.list-group-item p {
  font-size: var(--text-xs);
  color: var(--vault-text-muted);
  margin: var(--space-1) 0 0 0;
}

/* --------------------------------------------------------------------------
   Admin Components
   -------------------------------------------------------------------------- */
.admin-page {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.admin-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 2px solid var(--vault-border);
}

.admin-header h1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  color: var(--vault-primary);
  margin: 0 0 var(--space-3) 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
}

.admin-card {
  background-color: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.admin-card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--vault-divider);
  background-color: var(--vault-bg-recessed);
}

.admin-card-header h2,
.admin-card-header h3,
.admin-card-header h5 {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vault-text-secondary);
  margin: 0;
}

.admin-card-body {
  padding: var(--space-5);
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.admin-search {
  display: flex;
  gap: var(--space-2);
  flex: 1;
  max-width: 400px;
}

.admin-search input {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.admin-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.admin-action-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.admin-action-list li {
  border-bottom: 1px solid var(--vault-divider);
}

.admin-action-list li:last-child {
  border-bottom: none;
}

.admin-action-list a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  color: var(--vault-text);
  text-decoration: none;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.admin-action-list a:hover {
  background-color: rgba(var(--vault-primary-rgb), 0.03);
  color: var(--vault-primary);
  text-decoration: none;
}

.admin-dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--space-3) var(--space-4);
  margin: 0;
}

.admin-dl dt {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--vault-text-secondary);
}

.admin-dl dd {
  font-size: var(--text-sm);
  color: var(--vault-text);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Auth Pages
   -------------------------------------------------------------------------- */
.auth-container {
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(var(--vault-primary-rgb), 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(var(--vault-accent-rgb), 0.03) 0%, transparent 50%),
    var(--vault-bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.auth-header {
  background: linear-gradient(135deg, var(--vault-primary) 0%, var(--vault-primary-light) 100%);
  padding: var(--space-8) var(--space-6);
  text-align: center;
}

.auth-header h1 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: white;
  margin: 0 0 var(--space-2) 0;
}

.auth-header p {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.auth-body {
  padding: var(--space-8) var(--space-6);
}

.auth-form .form-group {
  margin-bottom: var(--space-5);
}

.auth-form .btn-primary {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-weight: 500;
}

.auth-footer {
  padding: var(--space-4) var(--space-6) var(--space-6);
  text-align: center;
  border-top: 1px solid var(--vault-divider);
  background-color: var(--vault-bg-recessed);
}

.auth-footer p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--vault-text-secondary);
}

.auth-footer a {
  color: var(--vault-primary);
  font-weight: 500;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: var(--space-6) 0;
  color: var(--vault-text-muted);
  font-size: var(--text-sm);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--vault-divider);
}

.auth-divider span {
  padding: 0 var(--space-4);
}

/* --------------------------------------------------------------------------
   Profile Page
   -------------------------------------------------------------------------- */
.profile-container {
  max-width: var(--content-narrow);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.profile-header {
  text-align: center;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--vault-border);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--vault-primary) 0%, var(--vault-primary-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: white;
}

.profile-header h1 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--vault-text);
  margin: 0 0 var(--space-2) 0;
}

.profile-header p {
  font-size: var(--text-sm);
  color: var(--vault-text-secondary);
  margin: 0;
}

.profile-section {
  background-color: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-card);
}

.profile-section h2 {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--vault-text-secondary);
  margin: 0 0 var(--space-5) 0;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--vault-divider);
}

/* --------------------------------------------------------------------------
   Prompts Management
   -------------------------------------------------------------------------- */
.prompts-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.prompts-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
}

.prompts-header h1 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--vault-text);
  margin: 0 0 var(--space-2) 0;
}

.prompts-header p {
  font-size: var(--text-sm);
  color: var(--vault-text-secondary);
  margin: 0;
}

.prompts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.prompt-card {
  background-color: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base);
}

.prompt-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.prompt-card.prompt-system {
  border-left: 3px solid var(--vault-primary);
  background-color: rgba(var(--vault-primary-rgb), 0.02);
}

.prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-4);
}

.prompt-name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--vault-text);
  margin: 0;
}

.prompt-actions {
  display: flex;
  gap: var(--space-2);
}

.prompt-text {
  background-color: var(--vault-bg-recessed);
  border: 1px solid var(--vault-divider);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--vault-text);
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.prompt-meta {
  font-size: var(--text-xs);
  color: var(--vault-text-muted);
  padding-top: var(--space-3);
  border-top: 1px solid var(--vault-divider);
}

/* --------------------------------------------------------------------------
   Page Detail
   -------------------------------------------------------------------------- */
.page-detail .page-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

.page-detail .page-indicator {
  font-family: var(--font-mono);
  color: var(--vault-text-secondary);
}

.page-content-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  align-items: flex-start;
  margin: var(--space-6) 0;
}

.page-image-col,
.ocr-text-col {
  flex: 1 1 0;
  min-width: 280px;
}

.page-image-full {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--vault-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-thumb);
}

.page-image-col a {
  display: block;
}

.ocr-text-col .ocr-text-content {
  background: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  max-height: 80vh;
  overflow-y: auto;
}

.ocr-text-col pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  margin: 0;
}

/* Page Thumbnail Tooltip */
.page-thumbnail-tooltip {
  position: absolute;
  z-index: 1000;
  background: var(--vault-bg-elevated);
  border: 1px solid var(--vault-border);
  border-radius: 8px;
  box-shadow: var(--shadow-thumb-hover);
  padding: 8px;
  max-width: 300px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.page-thumbnail-tooltip.visible {
  opacity: 1;
}

.page-thumbnail-tooltip img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Grid Utilities
   -------------------------------------------------------------------------- */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 calc(var(--space-3) * -1);
}

.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 var(--space-3); }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 var(--space-3); }
.col-md-6 { flex: 0 0 50%; max-width: 50%; padding: 0 var(--space-3); }
.col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; padding: 0 var(--space-3); }

.col-sm-3 { flex: 0 0 25%; max-width: 25%; }
.col-sm-9 { flex: 0 0 75%; max-width: 75%; }

/* --------------------------------------------------------------------------
   Display Utilities
   -------------------------------------------------------------------------- */
.d-flex { display: flex; }
.d-grid { display: grid; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--vault-text-muted); }
.text-small { font-size: var(--text-sm); }

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.hidden { display: none; }
.w-100 { width: 100%; }

/* --------------------------------------------------------------------------
   Input Groups & Button Groups
   -------------------------------------------------------------------------- */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control {
  flex: 1;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group-append {
  display: flex;
}

.input-group-append .btn {
  border-radius: 0;
}

.input-group-append .btn:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.btn-group {
  display: inline-flex;
  gap: 1px;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* --------------------------------------------------------------------------
   Loading States
   -------------------------------------------------------------------------- */
.loading {
  text-align: center;
  padding: var(--space-8);
  color: var(--vault-text-muted);
}

.no-prompts {
  text-align: center;
  padding: var(--space-12) var(--space-8);
  color: var(--vault-text-muted);
  background-color: var(--vault-bg-recessed);
  border: 2px dashed var(--vault-border);
  border-radius: var(--radius-lg);
}

/* --------------------------------------------------------------------------
   Comments
   -------------------------------------------------------------------------- */
.comment-form {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--vault-border);
}

.comment-form textarea {
  margin-bottom: var(--space-3);
}

.related-section {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--vault-border);
}

.related-section h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
}

/* Related entries render as three aligned columns: title | description |
   location/date. Fixed column tracks make the columns line up across cards. */
.related-section .entry-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.related-section .entry-card h4,
.related-section .entry-card p {
  margin-bottom: 0;
  min-width: 0;
}

.related-section .entry-card .entry-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

@media (max-width: 640px) {
  .related-section .entry-card {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .related-section .entry-card .entry-meta {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--vault-divider);
  }
}

/* --------------------------------------------------------------------------
   Search
   -------------------------------------------------------------------------- */
.search-container {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.search-container input {
  flex: 1;
}

.search-container button {
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Welcome Section (legacy)
   -------------------------------------------------------------------------- */
.welcome-section {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--vault-divider);
  text-align: center;
  color: var(--vault-text-secondary);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  :root {
    --header-height: 56px;
  }

  .vault-hero {
    grid-template-columns: 1fr;
  }

  .vault-hero-left {
    min-height: 40vh;
    padding: var(--space-8);
  }

  .vault-hero-left::after {
    width: 100px;
    height: 100px;
  }

  .vault-hero-right {
    padding: var(--space-6);
  }

  .vault-hero-right::before {
    display: none;
  }

  .vault-title {
    font-size: 2.25rem;
  }

  .vault-tagline {
    font-size: var(--text-base);
  }

  .admin-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main-header {
    padding: 0 var(--space-4);
  }

  .site-title a {
    font-size: var(--text-lg);
  }

  .nav-list {
    gap: 0;
  }

  .nav-link {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }

  .container,
  .entry-container {
    padding: var(--space-4);
  }

  .widget-container {
    grid-template-columns: 1fr;
  }

  .document-entry {
    flex-direction: column;
  }

  .document-entry img {
    width: 80px;
  }

  h1 {
    font-size: var(--text-2xl);
  }

  .col-md-4,
  .col-md-6,
  .col-md-8 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 576px) {
  .vault-hero-left {
    min-height: 35vh;
    padding: var(--space-6);
  }

  .vault-title {
    font-size: 1.75rem;
  }

  .vault-divider {
    margin: var(--space-4) 0;
    font-size: var(--text-base);
  }

  .vault-tagline {
    font-size: var(--text-sm);
    letter-spacing: 0.1em;
  }

  .vault-collection-header {
    padding: var(--space-3) var(--space-4);
  }

  .vault-index-item {
    padding: var(--space-3) var(--space-4);
    gap: var(--space-3);
  }

  .vault-index-tab {
    width: 24px;
    height: 24px;
    font-size: 0.65rem;
  }

  .col-sm-3,
  .col-sm-9 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
  .main-header,
  .main-footer,
  .btn,
  .search-container,
  .comment-form {
    display: none;
  }

  main {
    padding: 0;
  }

  body {
    background: white;
    color: black;
  }

  .vault-hero {
    display: block;
  }

  .vault-hero-left {
    background: white;
    color: black;
    padding: var(--space-4);
    min-height: auto;
  }

  .vault-title,
  .vault-tagline {
    color: black;
  }
}

/* --------------------------------------------------------------------------
   Toast notifications — academic "filing slip"
   -------------------------------------------------------------------------- */
.dae-toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 360px;
  pointer-events: none;
}
.dae-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: var(--space-2);
  row-gap: 2px;
  min-width: 240px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--vault-border);
  border-left-width: 5px;
  border-radius: var(--radius-sm);
  background: var(--vault-bg-elevated);
  font-family: var(--font-body);
  animation: dae-toast-in 220ms ease-out;
}
.dae-toast__stamp {
  grid-column: 1;
  align-self: center;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.dae-toast__close {
  grid-column: 2;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  line-height: 1;
  font-size: var(--text-sm);
  color: var(--vault-text-muted);
}
.dae-toast__msg {
  grid-column: 1 / -1;
  font-size: var(--text-sm);
  color: var(--vault-text);
}
.dae-toast--success {
  border-left-color: var(--vault-success);
  background: color-mix(in srgb, var(--vault-success) 9%, var(--vault-bg-elevated));
}
.dae-toast--success .dae-toast__stamp { color: var(--vault-success); }
.dae-toast--error {
  border-left-color: var(--vault-danger);
  background: color-mix(in srgb, var(--vault-danger) 9%, var(--vault-bg-elevated));
}
.dae-toast--error .dae-toast__stamp { color: var(--vault-danger); }
.dae-toast--neutral {
  border-left-color: var(--vault-text-secondary);
  background: color-mix(in srgb, var(--vault-text-secondary) 9%, var(--vault-bg-elevated));
}
.dae-toast--neutral .dae-toast__stamp { color: var(--vault-text-secondary); }
.dae-toast--leaving { animation: dae-toast-out 200ms ease-in forwards; }
@keyframes dae-toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes dae-toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(16px); }
}
@media (prefers-reduced-motion: reduce) {
  .dae-toast { animation: none; }
  .dae-toast--leaving { animation: none; opacity: 0; }
}

/* Add-to-container dropdown */
#add-to-container-menu { min-width: 260px; padding: var(--space-2); }
.atc-search { display: block; width: 100%; box-sizing: border-box; margin: 0 0 var(--space-2) 0; padding: var(--space-2); font-size: var(--text-sm); }
.atc-list { display: block; max-height: 16rem; overflow-y: auto; }
.atc-sentinel { display: block; height: 1px; }
/* NOTE: the live site serves an untracked theme clone (see themes memory) —
   copy these three .atc-* rules into the active live theme's style.css too,
   or the Add to Collection/Casefile menu will not scroll/search-style there. */
.atc-row { display: flex; align-items: center; gap: var(--space-2); width: 100%; text-align: left; }
.atc-check { width: 1em; flex: 0 0 1em; color: var(--vault-success); }
.atc-name { flex: 1 1 auto; }
.atc-empty { padding: var(--space-2); font-size: var(--text-sm); }
.atc-new-form { display: flex; gap: var(--space-2); padding: var(--space-2); }
.atc-new-form .atc-new-name { flex: 1 1 auto; }
.atc-divider { height: 1px; margin: var(--space-2) 0; background: var(--vault-divider); border: 0; }
