/* Generated by scripts/build-site-css.mjs. Do not edit directly. */
/* ===== base.css ===== */

/* Begin _design-tokens.css */
:root {
  /* ========================================================================
     1. Color Palette: "Ink & Parchment"
     ======================================================================== */

  /* Primary Brand: Sophisticated Dagestani Navy */
  --color-primary-50:  #f8fafc;
  --color-primary-100: #e2e8f0;
  --color-primary-200: #cbd5e1;
  --color-primary-300: #94a3b8;
  --color-primary-400: #475569;
  --color-primary-500: #550000; /* Maroon */
  --color-primary-600: #400000;
  --color-primary-700: #2b0000;
  --color-primary-800: #150000;
  --color-primary-900: #0a0000;

  /* Bootstrap Variable Overrides */
  --bs-primary: var(--color-primary-500);
  --bs-primary-rgb: 85, 0, 0;
  --bs-secondary-color: var(--color-gray-500);
  --bs-secondary-color-rgb: 100, 116, 139;
  --bs-light-rgb: 241, 245, 249;
  --bs-link-color: var(--color-primary-500);
  --bs-link-hover-color: var(--color-primary-700);
  --bs-pagination-active-bg: var(--color-primary-500);
  --bs-pagination-active-border-color: var(--color-primary-500);
  --bs-nav-pills-link-active-bg: var(--color-primary-500);
  --bs-nav-pills-link-active-color: #fff;

  /* Accent: Mountaineer Green */
  --color-accent-500: #2d6a4f; 

  /* Neutrals: Modern Slate */
  --color-gray-50:  #f8fafc; /* Surface Background */
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b; 
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b; /* Ink */
  --color-gray-900: #0f172a;

  /* Linguistic & Semantic */
  --color-root:      #010203;
  --color-suffix:    #9b2226; 
  --color-success:   #2d6a4f;
  --color-warning:   #f59e0b;
  --color-danger:    #9b2226;
  --color-info:      #457b9d;

  /* Backgrounds */
  --bg-body:    var(--color-gray-50);
  --bg-surface: #ffffff;
  --bg-input:   #ffffff;

  /* Compatibility aliases.  Component styles use these names, but their
     values remain derived from this single token source. */
  --bg-primary: var(--bg-surface);
  --bg-secondary: var(--color-gray-100);
  --bg-tertiary: var(--color-gray-200);
  --text-primary: var(--color-gray-800);
  --text-secondary: var(--color-gray-500);
  --text-tertiary: var(--color-gray-400);
  --border-color: var(--color-gray-200);
  --border-hover: var(--color-gray-300);
  --accent-primary: var(--color-primary-500);
  --accent-hover: var(--color-primary-600);
  --success: var(--color-success);
  --warning: var(--color-warning);
  --error: var(--color-danger);

  /* ========================================================================
     2. Typography
     ======================================================================== */

  /* Data Font (Serif) - For Avar words, Translations */
  --font-family-serif: 'Charis SIL', 'Georgia', 'Times New Roman', serif;
  
  /* UI Font (Sans) - For Buttons, Nav, Labels */
  --font-family-sans: 'Inter', system-ui, -apple-system, sans-serif;

  /* Scale - Slightly Increased Base for Readability */
  --text-xs:   0.8125rem; /* 13px */
  --text-sm:   0.9375rem; /* 15px */
  --text-base: 1.0625rem; /* 17px */
  --text-lg:   1.25rem;   /* 20px */
  --text-xl:   1.5rem;    /* 24px */
  --text-2xl:  1.75rem;   /* 28px */
  --text-3xl:  2.25rem;   /* 36px */

  /* ========================================================================
     3. Density & Spacing
     ======================================================================== */
  
  /* Default: Comfortable */
  --density-padding-y: 1rem;
  --density-padding-x: 1.5rem;
  --density-gap:       1rem;
  
  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 3rem;
  --space-12: 4rem;
  --space-16: 6rem;

  /* ========================================================================
     4. Effects
     ======================================================================== */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* Soft Lift */
  --shadow-float: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --radius-sm: 3px; /* Tighter */
  --radius-md: 5px;
  --radius-lg: 6px; /* Crafted Look */
  --radius-xl: 10px;

  /* Z-Index */
  --z-sticky: 100;
  --z-dropdown: 1000;
  --z-modal: 1050;
}

/* ========================================================================
   Compact Mode Override
   ======================================================================== */
[data-density="compact"] {
  --density-padding-y: 0.5rem;
  --density-padding-x: 1rem;
  --density-gap:       0.5rem;
  --text-base:         0.9rem; /* Slightly smaller base text */
}

/* ========================================================================
   Dark Mode Overrides
   ======================================================================== */
[data-theme="dark"] {
  --color-primary-500: #8ea1b3; /* Softer Blue */
  --bg-body:    #121212;
  --bg-surface: #1e1e1e;
  --bg-input:   #2d2d2d;
  
  --color-gray-800: #e0e0e0; /* Main Text Light */
  --color-gray-500: #a0a0a0; /* Muted Text */
  
  --color-root:   #ffffff;
  --color-suffix: #ff6b6b; /* Brighter Red */
  --bs-primary: var(--color-primary-500);
  --bs-primary-rgb: 142, 161, 179;
  --bs-secondary-color: var(--color-gray-500);
  --bs-secondary-color-rgb: 160, 160, 160;
  --bs-light-rgb: 43, 43, 43;
  --bs-link-color: var(--color-primary-500);
  --bs-link-hover-color: #b8c8d7;

  --shadow-card: 0 4px 6px rgba(0,0,0,0.3);
}

/* End _design-tokens.css */
/* Begin _utilities.css */
/* ========================================================================
   Utility Classes
   ======================================================================== */

/* Text Utilities */
.text-gradient {
    background: var(--gradient-primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Card Utilities - Shared styling for consistent cards across templates */
.card-rounded {
    border-radius: 12px;
}

.card-elevated {
    border-radius: 12px;
    border: 0;
    box-shadow: var(--shadow-card, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06));
}

.card-section {
    border-radius: 12px;
    border: 0;
    box-shadow: var(--shadow-sm);
}

/* Shadow Utilities */
.shadow-soft {
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
}

.shadow-medium {
    box-shadow: var(--shadow-md, 0 4px 15px rgba(0, 0, 0, 0.12));
}

.shadow-strong {
    box-shadow: var(--shadow-xl, 0 8px 25px rgba(0, 0, 0, 0.15));
}

/* Border Utilities */
.border-gradient {
    border: 2px solid transparent;
    background-image: linear-gradient(white, white),
        var(--gradient-primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale {
    transition: transform 0.2s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Scrollbar Styles */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary-500, #667eea) var(--color-gray-100, #f0f0f0);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--color-gray-100, #f0f0f0);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--color-primary-500, #667eea);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-700, #764ba2);
}

/* Grid Layouts */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.grid-auto-fill {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Background Utilities */
.bg-gradient-primary {
    background: var(--gradient-primary, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
}

/* Skeleton Loading Animation */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-gray-200) 25%,
        var(--color-gray-300) 50%,
        var(--color-gray-200) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    width: 100%;
}

.skeleton-text:last-child {
    width: 80%;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-card {
    height: 200px;
}

/* Dark theme adjustment for skeleton */
[data-theme="dark"] .skeleton {
    background: linear-gradient(
        90deg,
        var(--color-gray-800) 25%,
        var(--color-gray-700) 50%,
        var(--color-gray-800) 75%
    );
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: var(--color-primary-500);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    z-index: var(--z-sticky);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-primary-600);
    transform: translateY(-4px);
    color: white;
}

[data-theme="dark"] .back-to-top {
    background: var(--color-primary-600);
}

[data-theme="dark"] .back-to-top:hover {
    background: var(--color-primary-500);
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 350px;
    max-width: 100%;
    pointer-events: auto;
    overflow: hidden;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 0.75rem 1rem;
}

.toast-body {
    padding: 1rem;
    color: var(--color-gray-800);
}

[data-theme="dark"] .toast {
    background: rgba(31, 41, 55, 0.95);
    color: white;
}

[data-theme="dark"] .toast-header {
    border-bottom-color: rgba(255,255,255,0.05);
    color: white;
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}



/* Command Palette */
.cmd-palette-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 10vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.cmd-palette-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.cmd-palette {
    background: #fff;
    width: 600px;
    max-width: 90%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.cmd-palette-backdrop.show .cmd-palette {
    transform: scale(1);
}

.cmd-input-wrapper {
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.cmd-input {
    border: none;
    font-size: 1.1rem;
    width: 100%;
    outline: none;
    color: var(--color-gray-900);
}

.cmd-results {
    max-height: 400px;
    overflow-y: auto;
    padding: var(--space-2);
}

.cmd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-3);
    margin-bottom: 2px;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--color-gray-700);
    text-decoration: none;
    transition: background-color 0.1s;
}

.cmd-item:hover, .cmd-item.active {
    background-color: var(--color-gray-100);
    color: var(--color-primary-600);
}

.cmd-item-icon {
    width: 20px;
    text-align: center;
    margin-right: var(--space-3);
    opacity: 0.6;
}

.cmd-item-shortcut {
    font-size: 0.8rem;
    color: var(--color-gray-500);
    background: var(--color-gray-100);
    padding: 2px 6px;
    border-radius: 4px;
}

.cmd-footer {
    padding: var(--space-2) var(--space-3);
    background: var(--color-gray-50);
    border-top: 1px solid var(--color-gray-200);
    font-size: 0.8rem;
    color: var(--color-gray-500);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* Dark Mode Overrides */
[data-theme="dark"] .cmd-palette {
    background: #1f2937;
    border: 1px solid var(--color-gray-700);
}

[data-theme="dark"] .cmd-input {
    background: transparent;
    color: white;
}

[data-theme="dark"] .cmd-input-wrapper {
    border-bottom-color: var(--color-gray-700);
}

[data-theme="dark"] .cmd-item {
    color: var(--color-gray-300);
}

[data-theme="dark"] .cmd-item:hover, 
[data-theme="dark"] .cmd-item.active {
    background-color: var(--color-gray-700);
    color: white;
}

[data-theme="dark"] .cmd-footer {
    background: var(--color-gray-800);
    border-top-color: var(--color-gray-700);
}

/* Lazy Loading */
img.lazy {
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

img.loaded {
    opacity: 1;
}

/* End _utilities.css */
/* Begin layout.css */
/* ========================================================================
   Layout & Structural Styles
   ======================================================================== */

/* Prevent content shrinking when scrollbar appears on scroll */
html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  background-color: var(--bg-body);
  color: var(--color-gray-800);
  font-family: var(--font-family-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- Slim Header --- */
.app-header {
  background-color: #550000;
  color: white;
  padding: 0;
  height: 60px; /* Slimmer than standard bootstrap navbar */
  /* Remove sticky positioning if it interferes with Omnibar later, 
     but for now nice to have anchor */
  position: relative; 
  box-shadow: var(--shadow-sm);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
}

.app-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.app-brand {
  font-family: var(--font-family-serif);
  font-weight: 700; /* Bold */
  font-size: 1.25rem;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: opacity 0.2s;
}

.app-brand:hover {
  color: var(--color-gray-100);
  opacity: 0.9;
}

/* Brand logo (SVG wordmark). Height-driven; width follows the 179:38 viewBox. */
.app-brand-logo {
  display: block;
  height: 32px;
  width: auto;
}

/* The header row is already over-full at 375px (.app-actions alone is ~344px),
   so keep the mark close to the width of the text brand it replaced (~79px)
   rather than adding to the horizontal overflow. */
@media (max-width: 575.98px) {
  .app-brand-logo {
    height: 22px;
  }
}

/* Navigation Links */
.app-nav {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.nav-link {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: var(--text-sm);
  text-decoration: none;
  padding: 0.5rem var(--space-2);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-link i, .nav-link span.icon {
  margin-right: 4px;
  opacity: 0.8;
}

/* A single application-managed layer for the Favorites drawer. It stays
   deliberately lighter than Bootstrap's default backdrop and is removed on
   the first close action, even after an HTMX body swap. */
.favorites-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgb(0 0 0 / 0.32);
}

body.favorites-open {
  overflow: hidden;
}

/* User Menu & Actions */
.app-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.btn-icon {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Language toggle — pill with translate icon + current language code */
.lang-toggle {
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1;
}
.lang-toggle .fa-language { font-size: 1.05rem; }
.lang-toggle .lang-code { letter-spacing: 0.5px; }
.lang-toggle .lang-caret { font-size: 0.6rem; opacity: 0.75; }

/* --- Main Content --- */
.app-main {
  min-height: calc(100vh - 60px - 100px); /* Height - Header - Footer approx */
  padding-top: var(--space-6);
  padding-bottom: var(--space-8);
}

/* Dark mode: Bootstrap cards in main (home, corpus, etc.) — avoids white cards on dark body */
[data-theme="dark"] .app-main .card {
  background-color: var(--bg-surface);
  border-color: #3f3f46;
}

/* --- Footer --- */
.app-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--color-gray-200);
  padding: var(--space-6) 0;
  margin-top: auto;
  color: var(--color-gray-500);
  font-size: var(--text-sm);
  text-align: center;
}

/* Base template footer (replaces Bootstrap bg-white) */
.site-footer {
  background-color: var(--bg-body);
  color: var(--color-gray-500);
  border-top-color: var(--color-gray-200);
}

[data-theme="dark"] .site-footer {
  border-top-color: #333;
}

.site-footer a.text-muted {
  color: var(--color-gray-500);
}

[data-theme="dark"] .site-footer a.text-muted {
  color: var(--color-gray-500);
}

/* --- Utilities specific to layout --- */
.serif-text {
  font-family: var(--font-family-serif);
}

.sans-text {
  font-family: var(--font-family-sans);
}

/* End layout.css */
/* Begin components/entry_compact.css */
/* ========================================================================
   Compact Entry Component
   ======================================================================== */

.compact-entry {
  display: grid;
  grid-template-columns: 200px 120px 1fr auto;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-4);
  align-items: center;
  border-bottom: 1px solid var(--color-gray-200);
  background-color: var(--bg-surface, #ffffff);
  transition: background-color 0.15s ease;
}

.compact-entry:hover {
  background-color: var(--color-primary-50);
}

/* 1. Headword */
.col-headword {
  display: flex;
  flex-direction: column;
}

.headword-link {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary-600);
  text-decoration: none;
}

.phonetic {
  font-family: var(--font-family-mono);
  font-size: 0.8rem;
  color: var(--color-gray-500);
}

/* 2. Metadata */
.tag-capsules {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.capsule {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  background-color: var(--color-gray-100);
  color: var(--color-gray-600);
  font-weight: 600;
  text-transform: uppercase;
}

.capsule-pos { background-color: var(--color-primary-100); color: var(--color-primary-700); }
.capsule-success { background-color: var(--color-success); color: white; }

/* 3. Definition */
.col-definition {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.def-inline-group {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.95rem;
}

.lang-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-gray-400);
  width: 20px;
}

.def-text {
  color: var(--color-gray-800);
}

/* 4. Actions */
.col-actions {
  display: flex;
  gap: 8px;
  opacity: 0; /* Hidden by default */
  transition: opacity 0.2s;
}

.compact-entry:hover .col-actions {
  opacity: 1; /* Show on hover */
}

.btn-icon-mini {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  padding: 4px;
  color: var(--color-gray-500);
}

.btn-icon-mini:hover {
  background-color: white;
  border-color: var(--color-gray-200);
  color: var(--color-primary-500);
  box-shadow: var(--shadow-sm);
}

/* End components/entry_compact.css */
/* Begin components/omnibar.css */
/* ========================================================================
   Omnibar Component
   ======================================================================== */

.omnibar-container {
  padding-top: var(--space-4);
  /* Ensure it sits below the main header if header is sticky, 
     but here we rely on standard sticky behavior */
  z-index: 90; /* Below header (100) */
  background: var(--bg-body, #f8f9fa); /* Hides content scrolling behind */
  padding-bottom: var(--space-4);
}

.omnibar-wrapper {
  background: var(--bg-surface, #ffffff);
  border-radius: var(--radius-full); /* Pill shape */
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-gray-200);
  transition: box-shadow 0.2s;
  max-width: 800px;
  margin: 0 auto;
}

.omnibar-wrapper:focus-within {
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-300);
}

.omnibar-icon {
  font-size: 1.2rem;
  opacity: 0.5;
}

.omnibar-input {
  border: none;
  background: transparent;
  flex: 1;
  font-size: 1.1rem;
  color: var(--color-gray-800);
  font-family: var(--font-family-sans);
}

.omnibar-input:focus {
  outline: none;
}

.omnibar-select {
  border: none;
  background: transparent;
  font-size: 0.9rem;
  color: var(--color-gray-600);
  font-weight: 500;
  cursor: pointer;
}

.omnibar-select:focus {
  outline: none;
  color: var(--color-primary-600);
}

.btn-icon-soft {
  background: var(--color-gray-100);
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-family: serif;
  cursor: pointer;
  color: var(--color-gray-600);
}

.btn-icon-soft:hover {
  background: var(--color-gray-200);
  color: var(--color-primary-600);
}

/* Mobile Tweaks */
@media (max-width: 768px) {
  .omnibar-container {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }
}

/* End components/omnibar.css */

/* Base Styles for Avar Dictionary */

/* Accessibility: Improved Global Focus Styles */
:focus-visible {
  outline: 3px solid var(--color-primary-500);
  outline-offset: 2px;
}


/* Filter Bar */
.filter-bar {
  position: sticky;
  top: 0;
  background: var(--color-gray-50);
  z-index: var(--z-sticky);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-gray-300);
}

/* Corpus Search Styles */
.badge {
  font-size: 0.75em;
  padding: 0.25em 0.5em;
}

.badge-primary {
  background-color: var(--color-primary-500);
  color: white;
}

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

mark {
  background-color: #fff3cd;
  color: #856404;
  padding: 0.1em 0.2em;
  border-radius: 0.2em;
  font-weight: bold;
  box-shadow: var(--shadow-sm);
}

.search-highlight {
  background-color: #fff3cd;
  color: #856404;
  padding: 0.1em 0.2em;
  border-radius: 0.2em;
  font-weight: bold;
  box-shadow: var(--shadow-sm);
}

.corpus-result {
  border-left: 3px solid var(--color-gray-300);
  padding-left: 1rem;
  margin-bottom: 1rem;
}

.corpus-result:hover {
  border-left-color: var(--color-primary-500);
  background-color: var(--color-gray-50);
}

.document-card {
  transition: transform 0.2s;
}

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

/* Inline Expandable Sections for Corpus Examples */
.word-form-row {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-gray-100);
  padding-bottom: var(--space-2);
}

.word-form-text {
  flex: 1;
  font-weight: 500;
}

.attest-badge {
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: var(--space-3);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-xl);
  font-size: var(--text-xs);
  font-weight: bold;
  min-width: 20px;
  text-align: center;
  position: relative;
}

.attest-badge:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-sm);
}

.attest-badge::after {
  content: "▼";
  margin-left: var(--space-1);
  font-size: 10px;
  transition: transform 0.2s ease;
}

.attest-badge.expanded::after {
  transform: rotate(180deg);
}

/* Static (non-clickable) badges: hide caret and disable hover transform so the
   "▼" indicator unambiguously signals "click to expand examples". */
.attest-badge.attest-static {
  cursor: default;
}

.attest-badge.attest-static::after {
  content: none;
}

.attest-badge.attest-static:hover {
  transform: none;
  box-shadow: none;
}

.attest-badge.expanded {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-500);
}

.attest-badge.attest-success {
  background-color: var(--color-success);
  color: white;
  border: 1px solid var(--color-success);
}

.attest-badge.attest-warning {
  background-color: var(--color-warning);
  color: #212529;
  border: 1px solid var(--color-warning);
}

.attest-badge.attest-secondary {
  background-color: var(--color-gray-500);
  color: white;
  border: 1px solid var(--color-gray-500);
}

.examples-section {
  display: none;
  margin-top: var(--space-2);
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  background-color: var(--color-gray-50);
  border-left: 3px solid var(--color-primary-500);
  border-radius: var(--radius-sm);
  animation: slideDown 0.3s ease-out;
  width: 100%;
}

.examples-section.show {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.example-item {
  margin-bottom: 12px;
  padding: 8px;
  background: white;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.example-number {
  display: inline-block;
  background: #007bff;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  margin-right: 8px;
  line-height: 20px;
}

.example-text {
  font-style: italic;
  color: #495057;
  margin-bottom: 4px;
}

.example-translation {
  color: #6c757d;
  font-size: 0.9em;
}

.example-source {
  font-size: 0.8em;
  color: #596068;
  /* Darker gray for better contrast */
  margin-top: 4px;
  font-style: italic;
}

.examples-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #dee2e6;
}

.examples-title {
  font-weight: bold;
  color: #495057;
}

.examples-count {
  font-size: 0.9em;
  color: #6c757d;
}

.loading-indicator {
  text-align: center;
  padding: 20px;
  color: #596068;
  /* Darker for accessibility */
}

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.error-message {
  color: #dc3545;
  font-style: italic;
  text-align: center;
  padding: 10px;
}

.no-examples {
  color: #596068;
  /* Darker for accessibility */
  font-style: italic;
  text-align: center;
  padding: 10px;
}

.highlight {
  background-color: #fff3cd;
  padding: 1px 2px;
  border-radius: 2px;
  font-weight: bold;
}

/* Bootstrap components consume the brand values declared in _design-tokens.css. */
a {
  color: var(--bs-link-color);
}
a:hover {
  color: var(--bs-link-hover-color);
}
.btn-primary {
  --bs-btn-bg: var(--color-primary-500);
  --bs-btn-border-color: var(--color-primary-500);
  --bs-btn-hover-bg: var(--color-primary-600);
  --bs-btn-hover-border-color: var(--color-primary-700);
  --bs-btn-active-bg: var(--color-primary-700);
  --bs-btn-active-border-color: var(--color-primary-700);
}
.page-link {
  color: var(--color-primary-500);
}
.page-link:hover {
  color: var(--color-primary-700);
}
.btn-outline-primary {
  --bs-btn-color: var(--color-primary-500);
  --bs-btn-border-color: var(--color-primary-500);
  --bs-btn-hover-bg: var(--color-primary-500);
  --bs-btn-hover-border-color: var(--color-primary-500);
  --bs-btn-active-bg: var(--color-primary-600);
  --bs-btn-active-border-color: var(--color-primary-600);
}

/*
 * Stressed syllable in an IPA transcription (templatetags/dict_extras.py
 * style_transcription).  A class, not a style attribute: CSP has no
 * 'unsafe-inline' for styles, so the attribute was silently dropped and the
 * stress mark never actually rendered bold.
 */
.ipa-stress {
  font-weight: 600;
}


/* ===== search.css ===== */

/* Search Page Specific Styles */

/* ===========================================
   TIER 1: Search Term Highlighting
   =========================================== */
.search-highlight,
mark {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeb3b 100%);
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: inherit;
    color: inherit;
    box-shadow: 0 1px 3px rgba(255, 235, 59, 0.3);
}

/* Highlight in headword */
.headword-link mark {
    background: linear-gradient(135deg, #bbdefb 0%, #64b5f6 100%);
    border-radius: 4px;
}

/* Highlight in translations */
.def-text mark {
    background: linear-gradient(135deg, #c8e6c9 0%, #81c784 100%);
}

/* ===========================================
   TIER 1: Keyboard Navigation
   =========================================== */
.entry-row.keyboard-focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.15);
}

.entry-row.keyboard-selected {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left-color: #1976d2;
}

/* Skip link for accessibility */
.skip-to-results {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 0.5rem 1rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.skip-to-results:focus {
    left: 1rem;
    top: 1rem;
}

/* ===========================================
   TIER 1: Grouped Results Separators
   =========================================== */
.results-group {
    margin-bottom: 1.5rem;
}

.results-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.results-group-header .group-icon {
    font-size: 1.1rem;
}

.results-group-header .group-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-group-header .group-count {
    background: #e9ecef;
    color: #6c757d;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Exact matches styling */
.results-group.exact-matches .entry-row {
    border-left: 4px solid #28a745;
}

/* Inflected matches styling */
.results-group.inflected-matches .entry-row {
    border-left: 4px solid #17a2b8;
}

/* Partial matches styling */
.results-group.partial-matches .entry-row {
    border-left: 4px solid #ffc107;
}

/* ===========================================
   TIER 1: Search History Sidebar
   =========================================== */
.search-history-panel {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.search-history-panel.show {
    right: 0;
}

.search-history-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.search-history-panel .panel-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
}

.search-history-panel .panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.search-history-panel .history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-history-panel .history-item:hover {
    background: #f8f9fa;
}

.search-history-panel .history-item .query-text {
    font-weight: 500;
    color: #007bff;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-history-panel .history-item .query-time {
    font-size: 0.75rem;
    color: #6c757d;
}

.search-history-panel .history-item .remove-btn {
    opacity: 0;
    padding: 2px 6px;
    font-size: 0.8rem;
    border: none;
    background: none;
    color: #dc3545;
    cursor: pointer;
    transition: opacity 0.2s;
}

.search-history-panel .history-item:hover .remove-btn {
    opacity: 1;
}

.search-history-panel .panel-footer {
    padding: 0.75rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

/* History toggle button */
.history-toggle-btn {
    position: fixed;
    right: 1rem;
    bottom: 5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    cursor: pointer;
    z-index: 1040;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.history-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.5);
}

.history-toggle-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
}

/* Backdrop overlay */
.search-history-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1045;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.search-history-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* ===========================================
   TIER 1: Attestation Bar Visualization
   =========================================== */
.attestation-visual {
    margin-top: 6px;
    display: flex;
    align-items: center;
}

.attestation-bar {
    width: 60px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.attestation-bar .attestation-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%); /* Default green */
}

/* ===========================================
   TIER 1: Multi-select Filter Pills
   =========================================== */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: #e7f1ff;
    color: #0d6efd;
    border: 1px solid #b6d4fe;
    border-radius: 16px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-pill:hover {
    background: #cfe2ff;
}

.filter-pill.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.filter-pill .remove-pill {
    font-size: 1rem;
    line-height: 1;
    margin-left: 0.25rem;
    opacity: 0.7;
}

.filter-pill .remove-pill:hover {
    opacity: 1;
}

/* ===========================================
   Keyboard Shortcut Hint
   =========================================== */
.keyboard-hints {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.75rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.keyboard-hints.show {
    opacity: 1;
}

.keyboard-hints kbd {
    background: #495057;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 4px;
}

.corpus-sentences-container {
    scrollbar-width: thin;
    scrollbar-color: var(--color-success-500, #28a745) #f0f0f0;
}

.corpus-sentences-container::-webkit-scrollbar {
    width: 6px;
}

.corpus-sentences-container::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.corpus-sentences-container::-webkit-scrollbar-thumb {
    background: var(--color-success-500, #28a745);
    border-radius: 3px;
}

.corpus-sentences-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-success-700, #218838);
}

/* Keep active favorites visible */
.btn-favorite.active {
    opacity: 1;
    visibility: visible;
    color: #ffc107;
}
.btn-favorite.active i {
    font-weight: 900;
}

@media (max-width: 991.98px) {
    .corpus-sentences-container {
        max-height: none;
        overflow-y: visible;
    }
}

/* Split View Layout - CSS Grid */
@media (min-width: 992px) {
    .search-results-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        align-items: start;
        width: 100%;
    }

    #dictionary-entries-column,
    #corpus-sentences-column {
        min-width: 0; /* Critical for preventing grid blowout with flex children */
        width: 100%;
    }
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .search-results-container {
        display: flex;
    }
}

/* ===========================================
   TIER 5: Dark Mode Refinements
   Gemini search bar: global (home + search).
   Strong Bootstrap overrides: only under .page-search so entry/corpus pages keep token-based styling.
   =========================================== */
[data-theme="dark"] .gemini-input-group,
[data-theme="dark"] .search-history-panel,
[data-theme="dark"] .search-history-panel .panel-footer {
    background: #1e1e1e;
    border-color: #333;
    color: #e0e0e0;
}

[data-theme="dark"] .page-search .filter-panel {
    background: #1e1e1e;
    border-color: #333;
    color: #e0e0e0;
}

[data-theme="dark"] .gemini-input-group input {
    background: transparent;
    color: #fff;
}

[data-theme="dark"] .gemini-input-group i {
    color: #bbb;
}

[data-theme="dark"] .page-search .filter-panel h6,
[data-theme="dark"] .search-history-panel .panel-header {
    background: #252525;
    color: #ddd;
    border-bottom-color: #333;
}

[data-theme="dark"] .page-search .results-group-header .group-label {
    color: #adb5bd;
}

[data-theme="dark"] .page-search .results-group-header {
    border-bottom-color: #333;
}

[data-theme="dark"] .page-search .results-group-header .group-count {
    background: #333;
    color: #ccc;
}

[data-theme="dark"] .search-history-panel .history-item:hover {
    background: #2a2a2a;
}

[data-theme="dark"] .search-history-panel .history-item .query-text {
    color: #6ea8fe;
}

[data-theme="dark"] .search-history-panel .query-time {
    color: #888;
}

[data-theme="dark"] .page-search .filter-pill {
    background: #0c1a2b;
    color: #6ea8fe;
    border-color: #084298;
}

[data-theme="dark"] .page-search .filter-pill:hover {
    background: #102136;
}

[data-theme="dark"] .page-search .filter-pill.active {
    background: #0d6efd;
    color: #fff;
}

/* Search result highlights (dictionary search only) */
[data-theme="dark"] .page-search .search-highlight,
[data-theme="dark"] .page-search mark {
    background: linear-gradient(135deg, #664d03 0%, #856404 100%);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .page-search .headword-link mark {
    background: linear-gradient(135deg, #052c65 0%, #084298 100%);
}

[data-theme="dark"] .page-search .def-text mark {
    background: linear-gradient(135deg, #0f5132 0%, #198754 100%);
}

[data-theme="dark"] .page-search .sort-controls {
    background: #252525;
    border-color: #333;
}

[data-theme="dark"] .page-search .sort-controls select {
    color: #e0e0e0;
}

[data-theme="dark"] .page-search .btn-outline-secondary {
    color: #adb5bd;
    border-color: #495057;
}

[data-theme="dark"] .page-search .btn-outline-secondary:hover {
    background-color: #495057;
    color: #fff;
}

[data-theme="dark"] .page-search .card {
    background-color: #1e1e1e;
    border-color: #333;
}

[data-theme="dark"] .page-search .table {
    color: #e0e0e0;
    border-color: #333;
}

[data-theme="dark"] .page-search .table-striped > tbody > tr:nth-of-type(odd) > * {
    color: #e0e0e0;
    box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .page-search .dropdown-menu {
    background-color: #252525;
    border-color: #333;
}

[data-theme="dark"] .page-search .dropdown-item {
    color: #e0e0e0;
}

[data-theme="dark"] .page-search .dropdown-item:hover,
[data-theme="dark"] .page-search .dropdown-item:focus {
    background-color: #333;
    color: #fff;
}

/* ===========================================
   Search Page – Hero / Filters / Toolbar
   (extracted from inline <style> in search.html, 2026-05-11)
   =========================================== */

.page-search .gemini-hero {
    padding: 2rem 0;
    background: transparent;
}

.page-search .gemini-title {
    display: none;
}

.page-search .filter-panel {
    margin-top: 1rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    animation: searchFilterSlideDown 0.3s ease-out;
}

@keyframes searchFilterSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.page-search .search-toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-search .sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-search .search-input-wrapper {
    position: relative;
    flex-grow: 1;
    max-width: 800px;
    margin: 0 auto;
}

.page-search .form-select-sm,
.page-search .btn-sm {
    font-size: 0.85rem;
}

/* Zero-results guidance box */
.page-search .no-results-guidance {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-top: 1rem;
}

.page-search .no-results-guidance h6 {
    margin-bottom: 0.75rem;
}

.page-search .no-results-guidance ul {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.page-search .no-results-guidance li + li {
    margin-top: 0.25rem;
}

[data-theme="dark"] .page-search .filter-panel,
[data-theme="dark"] .page-search .no-results-guidance {
    background-color: #1e1e1e;
    border-color: #333;
    color: #e0e0e0;
}

/* Active filter summary + mode hint (UX 2026-05) */
.page-search .search-mode-hint {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.45;
}

.page-search .search-active-filters .search-filter-chip {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35em 0.65em;
    white-space: normal;
    text-align: left;
}

[data-theme="dark"] .page-search .search-active-filters.card {
    background-color: #1e1e1e;
    border: 1px solid #333;
}


/* ===== entry-detail.css ===== */

/* Entry Detail Page Styles */

/* Modern Card Styling */
.entry-card {
    background: var(--bg-surface);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-gray-200);
    overflow: hidden;
    margin-bottom: 2rem;
}

.entry-header {
    background: var(--bg-surface);
    color: var(--color-gray-800);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--color-gray-200);
    position: relative;
}

.word-display {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.word-text {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-gray-800);
    font-family: 'Charis SIL', 'Georgia', serif;
    letter-spacing: -0.02em;
}

.transcription-badge,
.romanization-badge {
    background: transparent;
    color: var(--color-gray-500);
    padding: 0;
    border-radius: 0;
    font-size: 1.1rem;
    font-style: normal;
    backdrop-filter: none;
    /* Noto Sans + Charis SIL for IPA / Cyrillic + Latin diacritics */
    font-family: "Noto Sans", "Charis SIL", "Doulos SIL", "Gentium Plus", "DejaVu Sans", serif;
    margin-top: 0.1rem;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.audio-btn {
    background: var(--color-gray-100);
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-600);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.audio-btn:hover {
    background: var(--color-gray-200);
    color: var(--color-gray-800);
    text-decoration: none;
    border-color: var(--color-gray-400);
}

.entry-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.meta-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.meta-badge {
    background: var(--color-gray-100);
    color: var(--color-gray-600);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: none;
    border: 1px solid var(--color-gray-200);
}

/* Content Sections */
.content-section {
    padding: 2rem;
}

/* Grid Layout System */
.entry-grid-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.entry-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0; /* Prevent grid blowout */
}

.entry-sidebar {
    position: relative;
    min-width: 0;
    min-height: 300px; /* Ensure space is reserved */
    background: var(--color-gray-100);
    border-radius: 12px;
    border: 2px dashed var(--color-gray-200);
    display: flex; /* Fix for sticky child */
    flex-direction: column; 
}

/* Remove background/border if we want it invisible but taking space, 
   but user requested "show that this space ... is for that" */
.entry-sidebar:has(.card) {
    background: transparent;
    border: none;
    min-height: 0;
}

.sidebar-sticky {
    position: sticky;
    top: 2rem; /* Stick 2rem from top of viewport */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 10;
}

/* Section Title Refinement */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-family-sans, 'Inter', sans-serif);
    border-bottom: 1px solid var(--color-gray-200);
    padding-bottom: 0.5rem;
}

.translations-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.translation-card {
    background: var(--bg-surface);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--color-gray-200);
    box-shadow: var(--shadow-sm);
}

.translation-title {
    font-weight: 600;
    color: var(--color-info);
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-gray-200);
    padding-bottom: 0.5rem;
}

.translation-text {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    line-height: 1.6;
}

.translation-value {
    display: inline-block;
    color: var(--color-gray-800);
    font-size: 1.05rem;
}

.translation-value:not(:last-child)::after {
    content: ",";
    color: var(--color-gray-300);
    margin-right: 4px;
}



/* Grammar Information */
.grammar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.grammar-item {
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    border-left: 3px solid #667eea;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
    border: 1px solid var(--color-gray-200);
    border-left-width: 3px;
}

.grammar-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.grammar-label {
    font-weight: 600;
    color: var(--color-gray-500);
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grammar-value {
    color: var(--color-gray-800);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Charis SIL', serif;
}

/* Compact Buttons */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

.action-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Forms Tables */
.forms-section {
    margin-top: 2rem;
}

.entry-detail .forms-table {
    background: var(--bg-surface);
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-gray-200);
    width: 100%;
    max-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.entry-detail .forms-table .table {
    margin-bottom: 0;
    table-layout: auto;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.entry-detail .forms-table th {
    background: var(--color-primary-500);
    border: 1px solid var(--color-gray-200);
    font-weight: 600;
    color: white;
    padding: 1.2rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    width: 20%;
    min-width: 0;
    max-width: 20%;
    box-sizing: border-box;
    overflow: hidden;
}

/* For non-class-based verbs with only 2 columns */
.entry-detail .forms-table.non-class-based th:first-child {
    width: 33.33%;
}

.entry-detail .forms-table.non-class-based th:not(:first-child) {
    width: 33.33%;
}

.entry-detail .forms-table.non-class-based td:first-child {
    width: 33.33%;
}

.entry-detail .forms-table.non-class-based td:not(:first-child) {
    width: 33.33%;
}

.entry-detail .forms-table th:first-child {
    width: 20%;
}

.entry-detail .forms-table th:not(:first-child) {
    width: 20%;
}

.entry-detail .forms-table td {
    padding: 0.8rem 0.6rem;
    border: 1px solid var(--color-gray-200);
    border-bottom: 1px solid var(--color-gray-200);
    vertical-align: top;
    background: var(--bg-surface);
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 120px;
    box-sizing: border-box;
    overflow: visible;
    position: relative;
}

.entry-detail .forms-table tr:last-child td {
    border-bottom: none;
}

/* Ensure consistent table behavior */
.entry-detail .forms-table table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.entry-detail .forms-table table * {
    box-sizing: border-box;
}

/* Remove rigid width-based nth-child selectors */

/* Ensure content is visible */
.entry-detail .forms-table .table tbody tr td {
    overflow: visible;
    position: relative;
    min-height: 60px;
    padding: 8px;
    vertical-align: top;
}

/* Force table borders to be visible */
.entry-detail .forms-table .table,
.entry-detail .forms-table .table th,
.entry-detail .forms-table .table td {
    border: 1px solid #e9ecef;
    border-collapse: collapse;
}

.entry-detail .forms-table .word-form-row {
    position: relative;
}

/* Examples sections should expand naturally below the content */
.entry-detail .forms-table .examples-section {
    display: block;
    position: relative;
    width: 100%;
    margin: 8px 0;
    padding: 12px;
    background-color: #f8f9fa;
    border-left: 3px solid #007bff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    clear: both;
    /* Force visibility */
    visibility: visible;
    opacity: 1;
    overflow: visible;
}

/* Ensure example content is visible */
.entry-detail .forms-table .examples-section .example-item {
    display: block;
    visibility: visible;
    opacity: 1;
    margin-bottom: 12px;
    padding: 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.entry-detail .forms-table .examples-section .example-text {
    display: block;
    visibility: visible;
    opacity: 1;
    font-style: italic;
    color: #495057;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.entry-detail .forms-table .examples-section .example-number {
    display: inline-block;
    visibility: visible;
    opacity: 1;
    background: #007bff;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    margin-right: 8px;
    line-height: 20px;
}

.entry-detail .forms-table .examples-section .examples-header {
    display: flex;
    visibility: visible;
    opacity: 1;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #dee2e6;
}

/* When examples section is inserted as a table row, style the wrapper cell */
.entry-detail .forms-table tbody tr td .examples-section {
    width: 100%;
    margin: 8px 0;
    padding: 12px;
    background-color: #f8f9fa;
    border-left: 3px solid #007bff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* Form Badge Styling */
.entry-detail .form-badge-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5em;
    width: 100%;
    max-width: 100%;
    padding: 8px 12px;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    background-color: #fafafa;
    border-radius: 8px;
    min-height: 40px;
    overflow: visible;
    position: relative;
}

.form-badge-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 2.2em;
}

.form-lock-badge {
    font-size: 0.6em;
    padding: 0.05em 0.3em;
    border-radius: 0.5em;
    background-color: #198754;
    color: white;
    display: inline-block;
    white-space: nowrap;
    line-height: 1;
}

.entry-detail .form-text {
    flex: 1 1 auto;
    text-align: left;
    white-space: normal;
    overflow: visible;
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-right: 0.5em;
    min-width: 0;
    display: inline-block;
    line-height: 1.4;
}

.attest-success {
    background-color: #198754;
}

.attest-warning {
    background-color: #fd7e14;
}

.attest-secondary {
    background-color: #6c757d;
}

/* Feedback Section */
.feedback-section {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
}

.feedback-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    border: 2px solid var(--color-gray-200);
    background: var(--bg-surface);
    color: var(--color-gray-600);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.feedback-btn:hover {
    background: var(--color-gray-100);
    color: var(--color-gray-600);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feedback-btn.like {
    border-color: #198754;
    color: #198754;
}

.feedback-btn.like:hover {
    background: #198754;
    color: white;
}

.feedback-btn.flag {
    border-color: #dc3545;
    color: #dc3545;
}

.feedback-btn.flag:hover {
    background: #dc3545;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .word-text {
        font-size: 2rem;
    }

    .translations-grid {
        grid-template-columns: 1fr;
    }

    .grammar-grid {
        grid-template-columns: 1fr;
    }

    .entry-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 991.98px) {
    .entry-grid-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar-sticky {
        position: static;
    }
}

/* POS-specific styling */
.pos-noun {
    border-left-color: #28a745;
}

.pos-verb {
    border-left-color: #dc3545;
}

.pos-adj {
    border-left-color: #ffc107;
}

.pos-pron {
    border-left-color: #17a2b8;
}

.pos-adv {
    border-left-color: #6f42c1;
}

.pos-conj {
    border-left-color: #fd7e14;
}

.pos-post {
    border-left-color: #20c997;
}

.pos-interj {
    border-left-color: #e83e8c;
}

.pos-num {
    border-left-color: #6c757d;
}

.pos-part {
    border-left-color: #495057;
}

.pos-phrase {
    border-left-color: #6610f2;
}

/* Masdar-specific styling */
.masdar-info {
    border-left-color: #8e44ad;
    background: linear-gradient(135deg, #f8f4ff 0%, #ffffff 100%);
    border: 1px solid #e1bee7;
}

.masdar-info .grammar-label {
    color: #8e44ad;
    font-weight: 700;
}

.masdar-info .grammar-value a {
    color: #8e44ad;
    font-weight: 600;
}

.masdar-info .grammar-value a:hover {
    color: #6a1b9a;
    text-decoration: underline;
}

/* Masdar Nouns Grid */
.masdar-nouns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.masdar-noun-card {
    background: linear-gradient(135deg, #f8f4ff 0%, #ffffff 100%);
    border: 2px solid #e1bee7;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.1);
    transition: all 0.3s ease;
}

.masdar-noun-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(142, 68, 173, 0.2);
    border-color: #8e44ad;
}

.masdar-noun-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.masdar-noun-link {
    font-size: 1.3rem;
    font-weight: 700;
    color: #8e44ad;
    text-decoration: none;
    font-family: 'Georgia', serif;
}

.masdar-noun-link:hover {
    color: #6a1b9a;
    text-decoration: underline;
}

.masdar-noun-id {
    font-size: 0.8rem;
    color: #8e44ad;
    background: rgba(142, 68, 173, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-weight: 500;
}

.masdar-noun-type {
    color: #8e44ad;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.masdar-noun-translations {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.translation-badge {
    background: rgba(142, 68, 173, 0.1);
    color: #8e44ad;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(142, 68, 173, 0.2);
}

/* Audio Visualizer */
/* .audio-btn { display: none; } */ /* Hide old btn if present elsewhere */

#audio-visualizer .bar { transition: height 0.1s; }
#audio-visualizer.playing .bar {
    animation: bounce 0.5s infinite ease-in-out alternate;
}
#audio-visualizer.playing .bar:nth-child(1) { animation-delay: 0s; }
#audio-visualizer.playing .bar:nth-child(2) { animation-delay: 0.1s; }
#audio-visualizer.playing .bar:nth-child(3) { animation-delay: 0.2s; }
#audio-visualizer.playing .bar:nth-child(4) { animation-delay: 0.3s; }
#audio-visualizer.playing .bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes bounce {
    to { transform: scaleY(1.5); }
}

/* ========================================================================
   MORPHOLOGY COLOR-CODING
   ======================================================================== */

/* Morpheme color scheme for linguistic analysis */
.morpheme-stem {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin: 0 1px;
    border: 1px solid #90caf9;
}

.morpheme-suffix {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #e65100;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin: 0 1px;
    border: 1px solid #ffcc80;
}

.morpheme-prefix {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    color: #6a1b9a;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin: 0 1px;
    border: 1px solid #ce93d8;
}

.morpheme-infix {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin: 0 1px;
    border: 1px solid #a5d6a7;
}

.morpheme-epenthetic {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
    color: #c2185b;
    font-weight: 500;
    font-style: italic;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin: 0 1px;
    border: 1px solid #f48fb1;
}

/* ========================================================================
   EMPTY FIELD STYLING
   ======================================================================== */

/* Style for grammar items with missing data */
.grammar-item.empty-field {
    opacity: 0.7;
    background: var(--color-gray-100);
}

.grammar-item.empty-field .grammar-value {
    color: var(--color-gray-500);
    font-style: italic;
    background: var(--color-gray-100);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px dashed var(--color-gray-300);
}

.grammar-item.empty-field .grammar-value::before {
    content: "—";
    margin-right: 4px;
    color: var(--color-gray-300);
}

/* Hover effect for empty fields to indicate they're editable */
.grammar-item.empty-field:hover {
    opacity: 1;
    background: var(--bg-surface);
    cursor: help;
}

.grammar-item.empty-field:hover .grammar-value {
    border-color: var(--color-gray-400);
    background: var(--bg-surface);
}

/* ========================================================================
   Dark mode: nested Bootstrap cards + form tables (after global search.css scope fix)
   ======================================================================== */
[data-theme="dark"] .entry-card .card {
    background-color: var(--bg-surface);
    border-color: #3f3f46;
}

[data-theme="dark"] .entry-detail .forms-table td,
[data-theme="dark"] .entry-detail .forms-table .table td {
    background: var(--bg-surface);
    color: var(--color-gray-800);
    border-color: #3f3f46;
}

[data-theme="dark"] .entry-detail .forms-table .table,
[data-theme="dark"] .entry-detail .forms-table .table th,
[data-theme="dark"] .entry-detail .forms-table .table td {
    border-color: #3f3f46;
}

[data-theme="dark"] .entry-detail .forms-table .examples-section {
    background-color: var(--color-gray-100);
}

[data-theme="dark"] .entry-detail .forms-table .examples-section .example-item {
    background: var(--bg-surface);
    border-color: #3f3f46;
}

[data-theme="dark"] .entry-detail .forms-table .examples-section .example-text {
    color: var(--color-gray-800);
}

.generated-form-mark {
    font-size: 0.65rem;
    margin-left: 0.25rem;
    white-space: nowrap;
    vertical-align: middle;
}

/* In-page navigation (long entry pages) */
.entry-page-nav__list {
    background: var(--color-gray-50, #f8f9fa);
    border: 1px solid var(--color-gray-200, #e9ecef);
    border-radius: 0.75rem;
    padding: 0.35rem 0.5rem;
}

.entry-page-nav .nav-link {
    color: var(--color-gray-700, #495057);
}

.entry-page-nav .nav-link:hover,
.entry-page-nav .nav-link:focus-visible {
    background: var(--color-primary-100, #e7f1ff);
    color: var(--color-primary-700, #0d47a1);
}

.entry-anchor-target {
    scroll-margin-top: 5.5rem;
}

[data-theme="dark"] .entry-page-nav__list {
    background: var(--color-gray-100, #18181b);
    border-color: #3f3f46;
}

[data-theme="dark"] .entry-page-nav .nav-link {
    color: var(--color-gray-300, #d4d4d8);
}

/* Mobile Bottom Bar for Actions (UX-10) */
@media (max-width: 767.98px) {
    .entry-actions-mobile-bottom {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        padding: 0.75rem 1rem;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
        z-index: 1040;
        justify-content: space-evenly;
        border-top: 1px solid var(--color-gray-200);
        margin: 0;
        flex-wrap: nowrap;
    }
    
    .entry-actions-mobile-bottom .btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border: none;
        background: transparent;
        border-radius: 8px;
        gap: 0.25rem;
        padding: 0.5rem;
        color: var(--color-gray-700);
        height: auto;
        width: auto;
    }
    
    .entry-actions-mobile-bottom .btn i {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }
    
    .entry-actions-mobile-bottom .btn:hover,
    .entry-actions-mobile-bottom .btn:active {
        background: var(--color-gray-100);
        color: var(--color-primary-700);
    }
    
    [data-theme="dark"] .entry-actions-mobile-bottom {
        box-shadow: 0 -4px 12px rgba(0,0,0,0.5);
    }
    
    /* Ensure body has padding so content isn't hidden behind the bar */
    body {
        padding-bottom: 80px;
    }
}


/* ===== pages/home.css ===== */

/* ====================================================================
   HOME PAGE — Gemini-Style Search + Unified Stats + Card Animations
   ==================================================================== */

/* --- Hero Section --- */
.gemini-hero {
    padding-top: var(--space-4);
    padding-bottom: var(--space-6);
    margin-bottom: var(--space-4);
    text-align: center;
    background: transparent;
}

.gemini-title {
    font-family: var(--font-family-sans);
    font-weight: 700;
    color: #550000;
    margin-bottom: var(--space-1);
}

/* --- Search Container --- */
.gemini-search-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    background: var(--bg-surface);
    border: 1px solid var(--color-gray-200);
    border-radius: 28px;
    padding: 8px 16px 12px 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.gemini-search-container:focus-within {
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent-400);
}

.gemini-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gemini-search-icon {
    color: var(--color-gray-400);
    font-size: 1.2rem;
}

.gemini-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 1.1rem;
    background: transparent;
    color: var(--color-gray-800);
}

.gemini-input::placeholder {
    color: var(--color-gray-400);
}

.gemini-submit-btn {
    background: var(--color-primary-500);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.gemini-submit-btn:hover {
    background: var(--color-primary-600);
    transform: scale(1.05);
}

/* --- Toolbar --- */
.gemini-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    gap: 8px;
    flex-wrap: wrap;
}

.gemini-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gemini-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* --- Palochka Button (Styled & Persistent) --- */
.gemini-palochka-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid var(--color-primary-300);
    background: var(--color-primary-50);
    color: var(--color-primary-600);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.gemini-palochka-btn:hover {
    background: var(--color-primary-500);
    color: white;
    border-color: var(--color-primary-500);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(27, 38, 59, 0.15);
}

.palochka-char {
    font-weight: 700;
    font-size: 1rem;
    font-family: var(--font-family-serif);
}

.palochka-kbd {
    background: rgba(27, 38, 59, 0.08);
    border: 1px solid var(--color-primary-200);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.7rem;
    font-family: var(--font-family-sans);
    color: var(--color-primary-400);
    margin-left: 4px;
}

.gemini-palochka-btn:hover .palochka-kbd {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.8);
}

/* --- Language Pill Toggle --- */
.lang-pill-toggle {
    display: inline-flex;
    background: var(--color-gray-100);
    border-radius: 20px;
    padding: 2px;
    gap: 2px;
}

.lang-pill {
    display: flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 18px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-gray-600);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    margin: 0;
}

.lang-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.lang-pill.active,
.lang-pill:has(input:checked) {
    background: var(--color-primary-500);
    color: white;
    box-shadow: 0 1px 3px rgba(27, 38, 59, 0.2);
}

.lang-pill:not(.active):hover {
    background: var(--color-gray-200);
    color: var(--color-gray-800);
}

.gemini-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--color-gray-600);
    cursor: pointer;
    user-select: none;
}


/* ====================================================================
   STATS STRIP — Unified horizontal bar
   ==================================================================== */

.stats-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--color-gray-200);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
    gap: 0;
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem 1rem;
    position: relative;
}

.stat-item--cta {
    color: inherit;
    transition: all 0.2s;
    border-radius: 12px;
}

.stat-item--cta:hover {
    background: rgba(245, 158, 11, 0.06);
    transform: scale(1.02);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-family-sans);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-gray-500);
    margin-top: 2px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--color-gray-200);
    flex-shrink: 0;
}

.stat-progress {
    height: 4px;
    background: var(--color-gray-200);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
    max-width: 120px;
    margin-left: auto;
    margin-right: auto;
}

.stat-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-success), #34d399);
    border-radius: 2px;
    transition: width 0.8s ease-out;
}

.stat-cta-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
    padding: 2px 10px;
    border-radius: 10px;
    margin-top: 6px;
}


/* ====================================================================
   ENTRY CARDS — Verified accent + animations
   ==================================================================== */

.entry-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
}

.entry-card--verified {
    border-left-color: var(--color-success);
}

.entry-card--unverified {
    border-left-color: var(--color-gray-300);
}

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

.entry-card--verified:hover {
    border-left-color: #10b981;
}

/* Headword styling */
.entry-headword {
    font-family: var(--font-family-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary-500);
}

.entry-headword a {
    color: inherit;
}

.entry-headword a:hover {
    color: var(--color-accent-500);
}

/* IPA transcription pill */
.ipa-pill {
    display: inline-block;
    font-family: 'Charis SIL', monospace;
    font-size: 0.8rem;
    color: var(--color-gray-500);
    background: var(--color-gray-100);
    padding: 1px 10px;
    border-radius: 12px;
    border: 1px solid var(--color-gray-200);
}

/* Language tags */
.lang-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.lang-tag--ru {
    background: #dbeafe;
    color: #1d4ed8;
}

.lang-tag--en {
    background: #dcfce7;
    color: #16a34a;
}

/* Copy button */
.btn-copy-word {
    background: none;
    border: 1px solid var(--color-gray-200);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.75rem;
    color: var(--color-gray-400);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.btn-copy-word:hover {
    background: var(--color-gray-100);
    color: var(--color-primary-500);
    border-color: var(--color-primary-300);
}

/* Entry card stagger animation */
.entry-card-wrapper {
    opacity: 0;
    animation: cardFadeIn 0.4s ease-out forwards;
    animation-delay: calc(var(--stagger, 1) * 60ms);
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ====================================================================
   SIDEBAR
   ==================================================================== */

.sidebar-dev-notice {
    padding: 10px 12px;
    background: #fef9ee;
    border-radius: 8px;
    border: 1px solid #f5deb3;
    font-size: 0.82rem;
    line-height: 1.45;
}

.sidebar-dev-notice i {
    color: #b45309;
    margin-top: 3px;
}

.sidebar-dev-notice strong {
    color: #92400e;
    font-size: 0.82rem;
    display: block;
    margin-bottom: 2px;
}

.sidebar-dev-notice .notice-body {
    color: #78716c;
    margin-bottom: 4px;
}

.sidebar-dev-notice .notice-link {
    color: #b45309;
    font-weight: 500;
    text-decoration: none;
    font-size: 0.78rem;
}

.sidebar-dev-notice .notice-link:hover {
    color: #92400e;
    text-decoration: underline;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-link--primary {
    background: var(--color-primary-50);
    color: var(--color-primary-600);
    font-weight: 600;
    border: 1px solid var(--color-primary-200);
}

.sidebar-link--primary:hover {
    background: var(--color-primary-500);
    color: white;
    border-color: var(--color-primary-500);
}

.sidebar-link--secondary {
    background: var(--bg-surface);
    color: var(--color-gray-600);
    border: 1px solid var(--color-gray-200);
}

.sidebar-link--secondary:hover {
    background: var(--color-gray-100);
    color: var(--color-gray-800);
    border-color: var(--color-gray-300);
}


/* ====================================================================
   QUICK ACTION CARDS (inherited from old home.css)
   ==================================================================== */

.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--color-gray-200);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-float);
    border-color: var(--color-primary-200);
    background: white;
}

.card-hover .fas {
    transition: transform 0.3s ease;
}

.card-hover:hover .fas {
    transform: scale(1.1);
}


/* ====================================================================
   DARK MODE
   ==================================================================== */

[data-theme="dark"] .gemini-search-container {
    background: #2d2d2d;
    border-color: #404040;
}

[data-theme="dark"] .gemini-input {
    color: #e2e8f0;
}

[data-theme="dark"] .lang-pill-toggle {
    background: #333;
}

[data-theme="dark"] .lang-pill {
    color: #aaa;
}

[data-theme="dark"] .lang-pill.active,
[data-theme="dark"] .lang-pill:has(input:checked) {
    background: var(--color-primary-500);
    color: white;
}

[data-theme="dark"] .gemini-palochka-btn {
    background: #333;
    border-color: #555;
    color: #ccc;
}

[data-theme="dark"] .gemini-palochka-btn:hover {
    background: var(--color-primary-500);
    color: white;
}

[data-theme="dark"] .stats-strip {
    background: #1e1e1e;
    border-color: #333;
}

[data-theme="dark"] .stat-divider {
    background: #333;
}

[data-theme="dark"] .entry-card {
    background: #222;
}

[data-theme="dark"] .entry-card:hover {
    background: #2a2a2a;
}

[data-theme="dark"] .ipa-pill {
    background: #333;
    border-color: #444;
    color: #aaa;
}

[data-theme="dark"] .lang-tag--ru {
    background: #1e3a5f;
    color: #93c5fd;
}

[data-theme="dark"] .lang-tag--en {
    background: #14532d;
    color: #86efac;
}

[data-theme="dark"] .sidebar-info-notice {
    background: #2a2a2a;
    border-color: #333;
}

[data-theme="dark"] .sidebar-dev-notice {
    background: #2a2215;
    border-color: #4a3820;
}

[data-theme="dark"] .sidebar-dev-notice i {
    color: #f59e0b;
}

[data-theme="dark"] .sidebar-dev-notice strong {
    color: #fbbf24;
}

[data-theme="dark"] .sidebar-dev-notice .notice-body {
    color: #a8a29e;
}

[data-theme="dark"] .sidebar-dev-notice .notice-link {
    color: #f59e0b;
}

[data-theme="dark"] .sidebar-link--primary {
    background: #1a2a3a;
    border-color: #2a3a4a;
    color: #8ea1b3;
}

[data-theme="dark"] .sidebar-link--secondary {
    background: #222;
    border-color: #333;
    color: #aaa;
}

[data-theme="dark"] .card-hover {
    background: #222;
    border-color: #333;
}

[data-theme="dark"] .card-hover:hover {
    background: #2a2a2a;
    border-color: var(--color-primary-500);
}

[data-theme="dark"] .stat-cta-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

[data-theme="dark"] .btn-copy-word {
    border-color: #444;
    color: #888;
}

[data-theme="dark"] .btn-copy-word:hover {
    background: #333;
    color: var(--color-primary-500);
}


/* ====================================================================
   RESPONSIVE — Mobile breakpoints
   ==================================================================== */

@media (max-width: 767.98px) {
    .stats-strip {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
    }

    .stat-divider {
        width: 80%;
        height: 1px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .lang-pill-toggle {
        flex-wrap: wrap;
        justify-content: center;
    }

    .lang-pill {
        font-size: 0.75rem;
        padding: 3px 8px;
    }

    .gemini-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .gemini-toolbar-right {
        width: 100%;
        justify-content: flex-start;
        margin-top: 6px;
    }
}

@media (max-width: 991.98px) {
    .gemini-palochka-btn {
        min-height: 40px;
    }
}

/* Hero wordmark. Height is tuned so the logo's glyphs match the 56px
   display-4 text it replaced (~236px wide, same as the old "AvarLab"). */
.hero-logo {
    height: 50px;
    width: auto;
    max-width: 100%;
}

@media (max-width: 575.98px) {
    .hero-logo {
        height: 34px;
    }
}


/* ===== pages/app-shell.css ===== */

/**
 * Shared layout and surfaces so dictionary, auth, help, and about pages
 * share the same visual rhythm (hero, cards, icon buttons).
 */

.page-lead-narrow {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.page-narrow {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.surface-card {
  border-radius: 12px;
  border: 0;
  box-shadow: var(--shadow-sm);
}

.surface-card--accent-left {
  border-left: 4px solid var(--color-primary-500);
  transition: transform 0.2s ease;
}

.surface-card--accent-left:hover {
  transform: translateY(-1px);
}

/* Replaces the former mouseover/mouseout attributes on phraseology cards. */
.interactive-lift-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

.surface-alert {
  border-radius: 8px;
}

.input-group-text-soft {
  background: var(--color-gray-100);
  border: 1px solid var(--color-gray-200);
}

/* Circular icon actions (entry header, compact toolbars) */
.btn-icon-circle {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* Generic content panels (about, static info pages) */
.content-panel {
  background: var(--bg-surface, #fff);
  border: 1px solid var(--color-gray-200);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

.team-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-gray-100);
  border-radius: 8px;
  border-left: 3px solid var(--color-primary-500);
}

.team-avatar {
  width: 48px;
  height: 48px;
  background: rgba(27, 38, 59, 0.08);
  color: var(--color-primary-500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.contact-panel {
  background: linear-gradient(
    135deg,
    rgba(27, 38, 59, 0.02),
    rgba(27, 38, 59, 0.05)
  );
  border: 1px solid var(--color-gray-200);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-panel:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.contact-panel-icon {
  font-size: 1.75rem;
  color: var(--color-primary-500);
  margin-bottom: 0.75rem;
}

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

.goals-list li {
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.goals-list li i {
  color: var(--color-success);
  margin-top: 0.25rem;
}

/* Mobile touch targets & readability (Tier C) */
@media (max-width: 767.98px) {
  .app-nav .nav-link,
  .app-actions .btn-icon,
  .app-actions .nav-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .gemini-btn,
  .gemini-toolbar .gemini-btn {
    min-height: 40px;
  }
}

/* ========================================================================
   Theme: Corpus Mode (UX-17)
   ========================================================================
   Corpus mode only tints the page background. It deliberately does NOT re-skin
   the header any more: the maroon header from layout.css is used on every page.

   The old light-header variant made the menu bar look different from page to
   page, and inconsistently so — hx-boost swaps the body *contents* but keeps
   the <body> element, so the theme class set on first load stuck around for the
   rest of the session and a corpus page could leave a white header on /tools/.
   ======================================================================== */
.theme-corpus {
  background-color: #f7faf8;
}

/* Reserve the border on every page so the header height never shifts. */
.app-header {
  border-bottom: 3px solid transparent;
}

/*
 * HTMX navigation feedback; the element is declared once in base_generic.
 *
 * The states below are classes, not inline styles written from JS.  htmx copies
 * attributes onto matching elements during settle, and re-applying a style
 * attribute goes through setAttribute(), which this site's CSP refuses without
 * 'unsafe-hashes'.  A class attribute carries no such restriction.
 */
#global-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  opacity: 0;
  z-index: 11000;
  background: linear-gradient(90deg, #7a1f1f, #c0392b);
  box-shadow: 0 0 8px rgba(192, 57, 43, .6);
  /* No transition in the base state, so restarting the bar snaps back to 0. */
  transition: none;
  pointer-events: none;
}

#global-progress.is-loading {
  width: 90%;
  opacity: 1;
  transition: width 8s cubic-bezier(.1, .7, .1, 1), opacity .3s;
}

#global-progress.is-finishing {
  width: 100%;
  opacity: 1;
  transition: width .2s ease, opacity .4s ease;
}

#global-progress.is-fading {
  width: 0;
  opacity: 0;
  transition: width .2s ease, opacity .4s ease;
}

/*
 * htmx would otherwise inject these as a nonce-less <style> element that CSP
 * blocks on every page load; htmx.config.includeIndicatorStyles is disabled in
 * static/js/htmx-csp.js and the rules are reproduced verbatim here.
 */
.htmx-indicator {
  opacity: 0;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
  transition: opacity 200ms ease-in;
}


/* ===== pages/template-utilities.css ===== */

/* Declarations mechanically migrated from template style attributes. */
/* Keep new component/page styling in its dedicated static stylesheet. */

.csp-dynamic-form-row { border-radius: 4px; padding: 4px; margin: 2px 0; }
.csp-dynamic-form-row--compact { border-radius: 4px; padding: 2px 4px; margin: 1px 0; }
.csp-dynamic-form-row--wide { border-radius: 6px; padding: 6px; justify-content: center; position: relative; display: flex; align-items: center; }
.csp-dynamic-attestation-header { border-radius: 6px; }
.csp-attestation-progress { max-width: 100%; }
.csp-verb-attestation-count { font-size: .7rem; min-width: 1.5em; }

.csp-style-011ce903ae75{display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 2.8em; line-height: 1.4em;}
.csp-style-01a3bb680d8d{min-width: 180px;}
.csp-style-0218ac926cdc{color: #0d6efd; text-decoration: none; font-size: 0.85rem;}
.csp-style-064021e25e49{background: #f3e5f5; color: #7b1fa2; font-size: 0.65rem;}
.csp-style-077ec28035e9{display: inline-block; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.8rem; margin-left: 0.5rem;}
.csp-style-07d32ca9a6d7{background: #f8f9fa; padding: 10px; border-radius: 4px; font-family: monospace; font-size: 12px; max-height: 200px; overflow-y: auto;}
.csp-style-08724256bd38{font-size: 0.7rem;}
.csp-style-0b55a6dad859{margin-left: 10px;}
.csp-style-0b961cb0ae3c{width:2.2rem;height:2.2rem;font-size:0.9rem;}
.csp-style-0bcd9ceed044{font-size: 1.5rem;}
.csp-style-0eca47ac6670{background: white; border: 1px solid #dee2e6; border-radius: 8px; padding: 1rem; flex: 1; min-width: 200px; max-width: 300px;}
.csp-style-11e6aa01d228{max-height: calc(100vh - 300px); overflow-y: auto; padding-right: 10px;}
.csp-style-126244f1351e{flex: 1;}
.csp-style-183c74c2d93e{background-color: var(--bs-warning-bg-subtle, #fff3cd); border-color: var(--bs-warning-border-subtle, #ffe69c); color: var(--bs-warning-text-emphasis, #664d03);}
.csp-style-1a7281c0465e{background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border: none;}
.csp-style-1bad14f42706{background-color: #f8f9fa; border: 1px dashed #dee2e6;}
.csp-style-1c1ccb4d1efa{border-radius: 12px;}
.csp-style-1fc442775862{height: 30px; width: 100%;}
.csp-style-1fc8e3ac1571{min-width: 160px;}
.csp-style-226f5bb816fd{direction: ltr;}
.csp-style-23486a61d10c{order: 1;}
.csp-style-25561090436f{border-radius: 8px;}
.csp-style-2615d75a7d46{z-index: 10000; text-decoration: none;}
.csp-style-2803c64d914c{line-height: 1.7;}
.csp-style-29425ce62c63{z-index: 10;}
.csp-style-2cc0c5b499a6{border: 2px solid #e9ecef;}
.csp-style-2e72acd64782{font-size: 1rem;}
.csp-style-2fc7b1ee0849{border-left: 3px solid #dee2e6;}
.csp-style-321809111282{cursor: help; font-size: 0.9em;}
.csp-style-34661c5392b8{letter-spacing: 0.5px;}
.csp-style-353d071d2746{font-size: 0.95rem; line-height: 1.4;}
.csp-style-37ab52c9d67a{width: 100%;}
.csp-style-3a66cc89a772{font-size: 0.85em;}
.csp-style-3ae1698bfcbd{scrollbar-width: none;}
.csp-style-3b6fad0b298d{margin-top: 10px;}
.csp-style-3caae29cedba{top: 4rem; z-index: 1020; background-color: var(--bg-surface);}
.csp-style-3d43560d7f56{margin-bottom: 0.5rem;}
.csp-style-3dce1bcf3aa7{background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 15px; margin: -1.5rem -1.5rem 2rem -1.5rem;}
.csp-style-4555334f9590{text-align: left;}
.csp-style-45991f0923fd{font-size: 0.88rem; font-weight: 400;}
.csp-style-45d230585abc{border-radius: 4px; padding: 4px; margin: 2px 0;}
.csp-style-4908cb0a1366{font-size: 0.85rem;}
.csp-style-495d3e290984{line-height: 2;}
.csp-style-49814d1579b1{width: auto; box-shadow: none;}
.csp-style-4ad1729b525e{line-height: 1.9;}
.csp-style-4b88067ef8cc{background: #e3f2fd;}
.csp-style-4d524dc3cba1{vertical-align: top;}
.csp-style-4e345435f1bd{opacity: 0.5;}
.csp-style-4ed0f474eba2{background: #fff3e0;}
.csp-style-4f8dbc76c794{margin-top: 2rem;}
.csp-style-547ce2175898{min-width: 12rem;}
.csp-style-55b20c6a610c{max-height: 85vh;}
.csp-style-56cf80f78c85{font-size:0.95em;}
.csp-style-56d1e0204546{width: 28%;}
.csp-style-57d487858376{display: flex; flex-wrap: wrap; gap: 1rem;}
.csp-style-5b755faceabd{font-size: 0.8rem; padding: 0.75rem 1rem;}
.csp-style-5cdbac3f0ff1{color: #764ba2; font-size: 0.95rem;}
.csp-style-5d121e7bd644{width: auto;}
.csp-style-5e838c85d912{font-size: 0.7em;}
.csp-style-6002529ccd3d{margin: 0 auto;}
.csp-style-6113ebe44246{border-radius: var(--radius-lg);}
.csp-style-61fcbaf167aa{margin: 15px 0;}
.csp-style-622e25af578f{width: 100%; max-width: 900px;}
.csp-style-6491234e3dbe{border-radius: 12px; transition: transform 0.2s, box-shadow 0.2s;}
.csp-style-64f38d3c69c8{font-size: 1.2em; background: #eee; padding: 2px 5px;}
.csp-style-670ccee14680{font-size: 0.95rem; line-height: 1.6;}
.csp-style-68f98ab07fdb{font-weight: 600; font-size: 1.1rem; margin-bottom: 0.5rem; color: #2c5aa0;}
.csp-style-6a830c8e7848{background: #fff3e0; color: #f57c00; border-color: #ffe0b2;}
.csp-style-6cea408ee7b9{font-weight: 600; font-size: 1rem;}
.csp-style-6ceb6993cdd6{background: #fff3cd; padding: 10px; border-radius: 6px; border-left: 4px solid #ffc107;}
.csp-style-6e22c58a7a6a{display: none;}
.dynamic-filters--visible{display:block;}
.filter-group--visible{display:block;}
.csp-style-6fdd6821ed31{font-size: 1.1rem;}
.csp-style-70473726ab79{border-left: 3px solid var(--warning-color);}
.csp-style-721348195f22{height: fit-content;}
.csp-style-72559bf72e18{font-size:0.75rem;}
.csp-style-730cac87c610{border-radius: 16px;}
.csp-style-734f9023dd94{color: #198754; font-size: 0.95rem;}
.csp-style-773d228bd59d{background: #f3e5f5; border-left: 4px solid #9c27b0; border-radius: 6px;}
.csp-style-79db29cd4c7c{font-size: 3rem; opacity: 0.3;}
.csp-style-7c0f86ab5456{cursor: pointer;}
.csp-style-7d6c4c340ad4{display: block; order: 2; grid-column: 1 / -1;}
.csp-style-7f8191ff3470{margin-bottom: 0.3rem;}
.csp-style-80e0c6b06d4d{background: white; border-radius: 12px; padding: 2rem; box-shadow: 0 10px 30px rgba(0,0,0,0.1);}
.csp-style-83d8a27ef02d{font-weight: normal; text-transform: none;}
.csp-style-85c3f7c97851{background-color: var(--color-primary-500); font-size: 1rem; margin-bottom: 0.2em;}
.csp-style-871b7becf588{font-size:0.82rem;}
.csp-style-87c174ac8b65{width: 60%; height: 1.5em; margin-bottom: 1em;}
.csp-style-87f4e8322504{width:26%}
.csp-style-8846c688d950{background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%); border-left: 4px solid #4a90e2;}
.csp-style-89adea50ca8e{background: #f8f9fa; border-radius: 8px;}
.csp-style-89e201d64efb{display: inline-flex; justify-content: center; align-items: center;}
.csp-style-8a20b829b6e9{border-left: 4px solid #4a90e2;}
.csp-style-8a42f99fd3bb{background:#dc3545;}
.csp-style-8b511f076fb1{font-size: 0.75rem;}
.csp-style-8d8a98d8e950{max-width: 600px;}
.csp-style-92951960c682{height: 6px;}
.csp-style-92fdd03e2402{font-size: 0.9rem; line-height: 1.6; color: #495057;}
.csp-style-933f423fbca1{width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 14px;}
.csp-style-93f804a389b6{background: linear-gradient(135deg, #f0f4f8 0%, #ffffff 100%);}
.csp-style-942eb0ec3aae{width: 100%; margin-top: 1rem;}
.csp-style-98a8089e79a5{background-color: #e0e7ff; color: #4338ca;}
.csp-style-98b1e8b3320f{background: #f8f9fa; border-radius: 12px; padding: 1.5rem; margin-bottom: 2rem;}
.csp-style-9904ae0b1da5{background: #f8f9fa; border: 1px solid #e9ecef;}
.csp-style-9be7441361dc{font-size: 0.9rem;}
.csp-style-9ff81528d9bd{width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;}
.csp-style-a0052fd48c6b{width: 30px; height: 4px; background: #e9ecef; border-radius: 2px;}
.csp-style-a01153c96511{width: 20%}
.csp-style-a1b8f1b1055b{letter-spacing: 0.05em;}
.csp-style-a2dbdad5feb0{width: 50%;}
.csp-style-a345538b0782{background: #f8f9fa; border: 2px solid #e9ecef;}
.csp-style-a512d1e3c7d3{border-radius: 12px 12px 0 0;}
.csp-style-a6c62bdf9337{font-size: 0.65rem;}
.csp-style-a88642231398{order: 3;}
.csp-style-a8c670fb3d42{top: 20px;}
.csp-style-a8faa6dd3fa4{color: #6b7280; font-size: 14px; margin: 0;}
.csp-style-a91ad02988e6{border-radius: 8px; border-left: 3px solid #198754; transition: all 0.2s;}
.csp-style-a99e34a7a9d5{background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 6px;}
.csp-style-aa75644121bb{display: block;}
.csp-style-aae30f4ce161{font-size: 0.8rem;}
.csp-style-ac820dd1c60e{font-size:0.9rem; border-color:#dee2e6;}
.csp-style-adb684577081{order: 4;}
.csp-style-ae525792321d{margin-bottom: 1rem; color: #6c757d; font-size: 0.9rem;}
.csp-style-b07581571ae5{width: 200px;}
.csp-style-b3b25bb76895{font-size: 2.5rem;}
.csp-style-b440c49c6b9a{white-space: pre-wrap; font-size: 0.78rem;}
.csp-style-b6b60e4dee79{width: 26px; height: 26px; display: inline-flex; justify-content: center; align-items: center;}
.csp-style-b898e6fe52b0{font-size: 0.7rem; letter-spacing: 0.5px; font-weight: 600;}
.csp-style-b8dd12c7b8b6{z-index: 1090;}
.csp-style-ba0516ac32b0{border-radius: 12px; border: 1px dashed #ced4da;}
.csp-style-bf4eb110bad2{color: #6c757d; font-size: 0.85rem; font-style: italic;}
.csp-style-c0f12da0a84d{font-size: 0.65em;}
.csp-style-c1d57789fea8{opacity: 0.8; min-width: 160px;}
.csp-style-c5510aee071a{font-size: 2rem;}
.csp-style-c8083d292716{font-size:0.9rem; border-color:#e9ecef;}
.csp-style-c81fa55435c0{width: 70%; border-radius: 2px;}
.csp-style-cb43f8983898{min-width: 140px;}
.csp-style-cbbca9c62753{background: #e3f2fd; border-left: 4px solid #2196f3; border-radius: 6px;}
.csp-style-ce2a0497b4a1{grid-column: 1 / -1;}
.csp-style-cf0566729162{background: #f3e5f5;}
.csp-style-d0466aa33fa8{display:none;}
.csp-style-d1814cbdb0b3{background: #e8f5e9; color: #2e7d32; font-size: 0.65rem;}
.csp-style-d1c493a134fe{border-radius: 12px; border-left: 4px solid var(--color-success);}
.csp-style-d3e1c93ed7c8{max-width: 120px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
.csp-style-d62f691c1857{top: 8rem; scroll-margin-top: 6rem;}
.csp-style-d7d21b5f6c06{background: #fff3e0; border-left: 4px solid #ff9800; border-radius: 6px;}
.csp-style-dcdf4c9388b3{background-color: #550000;}
.csp-style-dd775cb77c32{scroll-margin-top: 6rem;}
.csp-style-dee324ed16f3{width: 32px; height: 32px;}
.csp-style-e34c76235cfa{color: var(--color-primary-500); letter-spacing: 0.5px; font-size: 1.25rem;}
.csp-style-e46894cbb4af{border-radius: 12px; border-left: 4px solid #28a745;}
.csp-style-e5d4f0f60c40{font-size: 1.2rem;}
.csp-style-e90e45da9329{text-decoration: none; color: inherit;}
.csp-style-ea01e09be4f6{font-size: 3rem;}
.csp-style-eb899c490557{width: 40%;}
.csp-style-edda91dc7f41{font-size:0.78rem;}
.csp-style-f050a0abbafb{gap: 1rem;}
.csp-style-f0a245b4cd7e{max-width: 560px;}
.csp-style-f279de9edd43{font-size: 1.2rem; opacity: 0.4;}
.csp-style-f3431026a13e{border: 2px dashed #e9ecef;}
.csp-style-f38d26a0f58f{z-index: 1050; cursor: pointer; background: rgba(255,255,255,0.8); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%;}
.csp-style-f52d32d2b568{width:4rem}
.csp-style-f5551d8b4718{max-width: 720px;}
.csp-style-f5ae832dfc43{grid-column: 1 / -1; background-color: #fffaf0;}
.csp-style-f6048611b5be{width: 28px; height: 28px; display: inline-flex; justify-content: center; align-items: center;}
.csp-style-f7f760e2a15c{width: 15%;}
.csp-style-fe0396a24987{font-size:0.78rem; line-height:1.3;}
.csp-style-feffaa774571{border-radius: 12px; position: sticky; top: 20px;}
.csp-style-ff75dee9da0c{border-radius: 8px; border-left: 3px solid #764ba2; transition: all 0.2s;}


/* ===== components/entry-mini-toolbar.css ===== */

/*
 * Entry mini-toolbar (UX-3) — quick-action bar that appears after scrolling
 * past the entry header on long entry-detail pages. Pinned to the bottom on
 * narrow viewports, and to the right edge on desktop so it doesn't fight the
 * existing on-page nav (which sticks to the top).
 *
 * Filter offcanvas bottom-sheet polish (UX-11) is at the bottom of this file.
 */

.entry-mini-toolbar {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translate(-50%, 1rem);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.6rem;
  background-color: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  z-index: 1030;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.entry-mini-toolbar.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.entry-mini-toolbar__word {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0 0.5rem 0 0.25rem;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-right: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
  color: var(--text-primary, #212529);
}

.entry-mini-toolbar__btn {
  background: transparent;
  border: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary, #6c757d);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.entry-mini-toolbar__btn:hover,
.entry-mini-toolbar__btn:focus-visible {
  background-color: var(--hover-bg, rgba(0, 0, 0, 0.05));
  color: var(--text-primary, #212529);
  outline: none;
}

.entry-mini-toolbar__btn:focus-visible {
  box-shadow: 0 0 0 2px var(--bs-primary, #0d6efd);
}

/* UX-1: native details provide keyboard and screen-reader disclosure without
 * a JavaScript lifecycle dependency. */
.entry-disclosure {
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
  border-radius: 0.5rem;
  background: var(--bg-surface, #fff);
  padding: 0.75rem;
}

.entry-disclosure__summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-primary, #212529);
  margin: -0.15rem 0 0.75rem;
}

.entry-disclosure:not([open]) .entry-disclosure__summary {
  margin-bottom: -0.15rem;
}

.entry-disclosure__summary:focus-visible {
  outline: 2px solid var(--bs-primary, #0d6efd);
  outline-offset: 3px;
}

/* On very narrow screens, drop the headword chip so the toolbar stays compact. */
@media (max-width: 420px) {
  .entry-mini-toolbar__word {
    display: none;
  }
  .entry-mini-toolbar {
    bottom: 0.75rem;
    padding: 0.3rem 0.45rem;
  }
}

/* Don't compete with the back-to-top button on screens that have one. */
@media (min-width: 992px) {
  .entry-mini-toolbar {
    left: auto;
    right: 1.5rem;
    bottom: 1.5rem;
    transform: translate(0, 1rem);
  }
  .entry-mini-toolbar.is-visible {
    transform: translate(0, 0);
  }
}

/* -------------------------------------------------------------------------
 * UX-11 — Filters as a proper bottom sheet on mobile.
 * The search page already uses Bootstrap's offcanvas-lg + offcanvas-bottom on
 * #advancedFiltersPanel; this adds the visual affordances (drag handle, top
 * radii, elevated shadow) that make it read as a bottom sheet, plus a touch
 * of polish for the existing "Apply Filters" sticky footer.
 * ------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
  #advancedFiltersPanel.offcanvas-bottom {
    border-top-left-radius: 1.25rem;
    border-top-right-radius: 1.25rem;
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.18);
  }

  /* Drag-handle pill at the top of the sheet. Pure visual affordance — the
   * offcanvas itself still closes via the existing close button / backdrop. */
  #advancedFiltersPanel.offcanvas-bottom::before {
    content: "";
    display: block;
    width: 2.5rem;
    height: 0.25rem;
    border-radius: 999px;
    background-color: rgba(0, 0, 0, 0.18);
    margin: 0.5rem auto 0;
  }
}


/* ===== components/recent-updates.css ===== */

/* Recent Updates Notification CSS */

.notification-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  cursor: pointer;
}

.notification-toggle:hover,
.notification-toggle:focus {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: translateY(-1px);
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--header-bg, #7a1f1f);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.recent-updates-offcanvas {
  width: 380px;
  max-width: 90vw;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1045;
}

/* This backdrop is owned by the app shell instead of Bootstrap's offcanvas
   instance, which prevents a stale, opaque backdrop after hx-boost swaps. */
.recent-updates-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(0, 0, 0, 0.32);
}

body.recent-updates-open {
  overflow: hidden;
}

.updates-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7a1f1f, #c0392b);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.update-card {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 12px 14px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.update-card:hover {
  border-color: #ced4da;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

.update-card.pinned {
  border-left: 4px solid #f39c12;
  background: #fffdf5;
}

.update-date-badge {
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 500;
}

.category-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.category-badge.category-words {
  background-color: #e8f4fd;
  color: #1e88e5;
}

.category-badge.category-examples {
  background-color: #e8f8f5;
  color: #16a085;
}

.category-badge.category-corpus {
  background-color: #f3e5f5;
  color: #8e24aa;
}

.category-badge.category-grammar {
  background-color: #fff3e0;
  color: #ef6c00;
}

.category-badge.category-system {
  background-color: #eceff1;
  color: #455a64;
}

.category-badge.category-other {
  background-color: #f5f5f5;
  color: #616161;
}

.update-card-title {
  color: #2c3e50;
  font-size: 0.92rem;
  line-height: 1.35;
}

.update-card-desc {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #495057;
}

.metric-pill {
  font-size: 0.73rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
}

.metric-pill.metric-words {
  background-color: #e3f2fd;
  color: #0d47a1;
}

.metric-pill.metric-examples {
  background-color: #e0f2f1;
  color: #004d40;
}

