:root,
[data-theme="muted"] {
  color-scheme: light;
  --logo-display-width: 177px;
  --logo-display-width-mobile: 144px;
  --primary: #4B5E4A;
  --primary-hover: #364836;
  --primary-soft: #E6ECE2;
  --secondary: #A66F4E;
  --secondary-soft: #F2E4DA;
  --accent: #7A8F73;
  --accent-warm: #A66F4E;
  --bg-color: #F7F1E7;
  --bg: #F2E8D7;
  --card-bg: #FFFDF8;
  --surface-soft: #F2E8D7;
  --text-main: #263026;
  --text-muted: #687168;
  --border-color: #DED5C7;
  --border: #DED5C7;
  --link-color: #5F785B;
  --success: #4E7A5D;
  --danger: #B9554F;
  --navbar-bg: rgba(250, 247, 240, 0.92);
  --ambient-one: rgba(122, 143, 115, 0.16);
  --ambient-two: rgba(166, 111, 78, 0.10);
  --shadow-soft: 0 18px 50px rgba(75, 94, 74, 0.09);
  --shadow-card: 0 10px 28px rgba(75, 94, 74, 0.08);
}

[data-theme="colorful"] {
  --logo-display-width: 170px;
  --logo-display-width-mobile: 138px;
  --primary: #4B0082;
  --primary-hover: #35005D;
  --primary-soft: #F0E6F6;
  --secondary: #FF2D95;
  --secondary-soft: #FFE5F1;
  --accent: #00BFAE;
  --accent-warm: #FFB703;
  --bg-color: #FFF7ED;
  --bg: #FFF0DD;
  --card-bg: #FFFEFB;
  --surface-soft: #FFF0DD;
  --text-main: #251A2D;
  --text-muted: #6E6275;
  --border-color: #E8DCCF;
  --border: #E8DCCF;
  --link-color: #008F84;
  --success: #008F84;
  --danger: #D82673;
  --navbar-bg: rgba(255, 247, 237, 0.92);
  --ambient-one: rgba(0, 191, 174, 0.15);
  --ambient-two: rgba(255, 45, 149, 0.10);
  --shadow-soft: 0 18px 50px rgba(75, 0, 130, 0.09);
  --shadow-card: 0 10px 28px rgba(75, 0, 130, 0.08);
}

/* Theme Switcher & Logo */
.theme-switcher {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin-left: 1rem;
  padding: 0.25rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
}
.theme-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.7);
}
.theme-btn.active {
  color: var(--text-main);
  background: var(--card-bg);
  border-color: var(--border-color);
  box-shadow: 0 2px 8px rgba(38, 48, 38, 0.08);
}

.theme-swatch {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.theme-muted .theme-swatch {
  background: linear-gradient(135deg, #7A8F73 0 50%, #A66F4E 50% 100%);
}

.theme-colorful .theme-swatch {
  background: conic-gradient(#00BFAE, #FFB703, #FF2D95, #4B0082, #00BFAE);
}

.nav-logo-frame {
  position: relative;
  display: block;
  width: 118px;
  height: 104px;
  overflow: hidden;
  flex: 0 0 auto;
}

.nav-brand-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--logo-display-width);
  height: auto;
  max-width: none;
  transform: translate(-50%, -50%);
  mix-blend-mode: multiply;
  transition: opacity 0.25s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  background:
    radial-gradient(circle at 12% -8%, var(--ambient-one) 0, transparent 30rem),
    radial-gradient(circle at 92% 8%, var(--ambient-two) 0, transparent 26rem),
    var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color 0.25s, color 0.25s;
}

/* NAVBAR */
.navbar {
  background-color: var(--navbar-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.55rem clamp(1rem, 4vw, 3rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 8px 30px rgba(38, 48, 38, 0.04);
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  z-index: 101;
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.75rem;
  cursor: pointer;
  z-index: 101;
  padding: 0.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-links a:hover {
  color: var(--text-main);
  background-color: var(--bg);
}

.nav-links a.active {
  color: #ffffff;
  background-color: var(--primary);
}

/* MOBILE MENU */
@media (max-width: 900px) {
  .hamburger-btn {
    display: block;
  }
  
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 280px;
    background-color: var(--card-bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 1rem 2rem 1rem;
    box-shadow: -4px 0 15px rgba(0,0,0,0.1);
    clip-path: inset(0 0 0 100%);
    visibility: hidden;
    pointer-events: none;
    transition: clip-path 0.3s ease-in-out, visibility 0s linear 0.3s;
    will-change: clip-path;
    z-index: 100;
    overflow-y: auto;
  }

  .nav-links.open {
    clip-path: inset(0);
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .nav-links a {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
  }
  
  .theme-switcher {
    margin-top: 1rem;
    margin-left: 1rem;
  }
}

/* CONTAINER */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ABOUT */
.about-container {
  max-width: 960px;
}

.about-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  padding: clamp(1.5rem, 5vw, 3.5rem);
  overflow-wrap: anywhere;
}

.about-card h1,
.about-card h2,
.about-card h3 {
  color: var(--primary);
  line-height: 1.25;
}

.about-card h2 {
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  margin-bottom: 0.5rem;
}

.about-card p {
  max-width: 46rem;
  margin: 0 auto 1rem;
  font-size: 1rem;
  line-height: 1.75;
}

.about-card p[style*="text-align: justify"] {
  text-align: left !important;
}

.about-card a {
  color: var(--link-color);
  font-weight: 600;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.2em;
}

.about-card a:hover {
  color: var(--primary);
}

.about-card a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 0.15rem;
}

.about-card .about-spacer {
  display: none;
}

@media (max-width: 600px) {
  .about-container {
    margin-top: 1rem;
    padding: 0 0.75rem;
  }

  .about-card {
    border-radius: 1rem;
  }
}

/* SEARCH & FILTERS */
.filters-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
}

.select-input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  background-color: white;
  outline: none;
}

.btn {
  padding: 0.75rem 1.5rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

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

.btn:active {
  transform: translateY(1px);
}

.btn-danger { background-color: var(--danger); }
.btn-danger:hover { background-color: #dc2626; }

/* GRID */
.translations-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1200px) {
  .translations-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 900px) {
  .translations-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .translations-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.badge {
  background-color: #e0e7ff;
  color: var(--primary);
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.card-body {
  margin-bottom: 1.5rem;
}

.translation-text {
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 600;
}

.audio-player {
  width: 100%;
  height: 40px;
  outline: none;
}

/* PAGINATION */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
}

.pagination span {
  font-weight: 600;
  color: var(--text-muted);
}

/* MODAL / ADMIN STUFF */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.hidden { display: none !important; }

.modal {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
th {
  background: var(--bg-color);
}

/* Custom Select Implementation */
.custom-select-container {
  position: relative;
  width: 100%;
  font-family: inherit;
}
.custom-select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--card-bg, #ffffff);
  color: var(--text-main, #000000);
  border: 1px solid var(--border-color, #ccc);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  user-select: none;
}
.custom-select-trigger svg {
  color: var(--primary);
  transition: transform 0.3s ease;
}
.custom-select-trigger.open {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(126, 34, 206, 0.2);
}
.custom-select-trigger.open svg {
  transform: rotate(180deg);
}
.custom-select-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #ccc);
  border-radius: 8px;
  margin-top: 4px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  max-height: 300px; /* Force scroll after ~8 items */
  overflow-y: auto;
  z-index: 9999;
  display: none;
}
.custom-select-list.open {
  display: block;
  animation: slideDown 0.2s ease-out;
}
.custom-select-item {
  padding: 0.75rem 1rem;
  color: var(--text-main, #000000);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.custom-select-item:hover {
  background-color: rgba(126, 34, 206, 0.05);
}
.custom-select-item.selected {
  background-color: var(--primary);
  color: #ffffff;
}

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

.custom-select-trigger:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(126, 34, 206, 0.2);
}

/* 2026 visual refresh: two palettes, one calm editorial system */
.container {
  max-width: 1320px;
  margin: clamp(1.25rem, 3vw, 2.5rem) auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

.nav-brand {
  border-radius: 1rem;
}

.nav-links {
  gap: 0.35rem;
}

.nav-links a {
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
}

.nav-links a:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.dictionary-hero {
  position: relative;
  min-height: 250px;
  margin-bottom: 1.5rem;
  padding: clamp(1.75rem, 5vw, 4rem);
  border: 1px solid var(--border-color);
  border-radius: 2rem;
  background:
    linear-gradient(115deg, rgba(255,255,255,0.76), rgba(255,255,255,0.28)),
    var(--card-bg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  isolation: isolate;
}

.dictionary-hero::before {
  content: "";
  position: absolute;
  width: 26rem;
  height: 26rem;
  right: -9rem;
  top: -13rem;
  border-radius: 50%;
  background: var(--ambient-one);
  z-index: -1;
}

.hero-copy {
  max-width: 44rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.hero-eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: currentColor;
}

.dictionary-hero h1 {
  max-width: 42rem;
  color: var(--text-main);
  font-size: clamp(2.1rem, 5vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 700;
}

.dictionary-hero h1 em {
  color: var(--primary);
  font-style: normal;
}

.dictionary-hero-simple {
  min-height: 170px;
  justify-content: center;
  text-align: center;
}

.dictionary-hero-simple .hero-copy {
  max-width: 58rem;
}

.dictionary-hero-simple h1 {
  max-width: 58rem;
  font-size: clamp(1.85rem, 4.2vw, 3.7rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.dictionary-hero p {
  max-width: 38rem;
  margin-top: 1.15rem;
  color: var(--text-muted);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
}

.hero-maize {
  position: relative;
  width: clamp(180px, 22vw, 290px);
  height: 150px;
  flex: 0 0 auto;
  margin-left: 2rem;
}

.hero-maize span {
  position: absolute;
  bottom: 10px;
  width: 62px;
  height: 124px;
  border-radius: 70% 18% 68% 22%;
  opacity: 0.92;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}

.hero-maize span:nth-child(1) {
  left: 18px;
  height: 102px;
  background: var(--secondary);
  transform: rotate(-24deg);
}

.hero-maize span:nth-child(2) {
  left: 50%;
  background: var(--accent-warm);
  transform: translateX(-50%);
}

.hero-maize span:nth-child(3) {
  right: 18px;
  height: 102px;
  background: var(--accent);
  transform: rotate(24deg) scaleX(-1);
}

.search-panel {
  position: relative;
  z-index: 20;
  overflow: visible;
  margin-bottom: 2rem;
  padding: clamp(1.1rem, 2.5vw, 1.65rem);
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  background: rgba(255, 253, 248, 0.76);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="colorful"] .search-panel {
  background: rgba(255, 254, 251, 0.82);
}

.filter-group {
  gap: 0.42rem;
}

.filter-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.search-input,
.select-input,
.form-group input,
.form-group select,
.form-group textarea,
.custom-select-trigger {
  min-height: 48px;
  background: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  box-shadow: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.search-input:hover,
.select-input:hover,
.form-group input:hover,
.form-group select:hover,
.custom-select-trigger:hover {
  border-color: var(--accent);
}

.search-input:focus,
.select-input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.custom-select-trigger:focus,
.custom-select-trigger.open {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.custom-select-list {
  background: var(--card-bg);
  border-color: var(--border-color);
  border-radius: 0.9rem;
  box-shadow: var(--shadow-soft);
  overflow: hidden auto;
}

.custom-select-item:hover {
  background: var(--primary-soft);
}

.custom-select-item.selected {
  background: var(--primary);
}

#includeRelated {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.btn {
  min-height: 46px;
  padding: 0.72rem 1.35rem;
  border-radius: 0.85rem;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--primary) 18%, transparent);
  transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 23%, transparent);
}

.btn:focus-visible,
.nav-links a:focus-visible,
.theme-btn:focus-visible,
.hamburger-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.translations-grid {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  padding: clamp(1.2rem, 2vw, 1.6rem);
  border: 1px solid var(--border-color);
  border-radius: 1.35rem;
  background: var(--card-bg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent-warm));
  opacity: 0.78;
}

.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-color));
  box-shadow: var(--shadow-soft);
}

.card-header {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.42rem;
  margin-bottom: 1.25rem;
}

.badge {
  max-width: 100%;
  padding: 0.3rem 0.62rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.badge-parent {
  background: var(--secondary-soft);
  color: var(--secondary);
}

.badge-category {
  background: color-mix(in srgb, var(--accent-warm) 16%, var(--card-bg));
  color: color-mix(in srgb, var(--accent-warm) 72%, var(--text-main));
}

.badge-related {
  background: color-mix(in srgb, var(--accent) 16%, var(--card-bg));
  color: color-mix(in srgb, var(--accent) 72%, var(--text-main));
}

.card-body {
  margin-bottom: 1.35rem;
}

.source-label,
.translation-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.source-label {
  margin-bottom: 0.35rem;
}

.translation-label {
  margin: 1.15rem 0 0.35rem;
}

.card-title {
  margin: 0;
  color: var(--text-main);
  font-size: clamp(1.18rem, 2vw, 1.42rem);
  line-height: 1.28;
  letter-spacing: -0.02em;
}

.translation-text {
  color: var(--primary);
  font-size: clamp(1.2rem, 2vw, 1.48rem);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.card-audio {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.audio-player {
  display: block;
  width: 100%;
  height: 36px;
}

.audio-filename {
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}

.audio-unavailable {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.pagination {
  margin: 2.5rem 0 1rem;
}

.pagination .btn {
  min-height: 42px;
  background: var(--card-bg);
  color: var(--primary);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.pagination .btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.about-card {
  border-radius: 1.75rem;
  box-shadow: var(--shadow-soft);
}

/* Admin inherits the same identity while retaining every control and table. */
.admin-page h1,
.admin-page h2,
.admin-page h3 {
  color: var(--text-main);
  letter-spacing: -0.025em;
}

.admin-page .container > div[style*="background: white"],
.admin-page #pagesView > div[style*="background: white"] {
  background: var(--card-bg) !important;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card) !important;
}

.admin-page .card,
.admin-page .modal {
  background: var(--card-bg);
  border-color: var(--border-color);
}

.admin-page .modal {
  border: 1px solid var(--border-color);
  border-radius: 1.35rem;
  box-shadow: 0 28px 80px rgba(38, 48, 38, 0.2);
}

.modal-overlay {
  background: rgba(24, 30, 24, 0.48);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

table {
  color: var(--text-main);
}

th {
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

td {
  background: var(--card-bg);
}

th,
td {
  border-bottom-color: var(--border-color);
}

tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 1080px) {
  .translations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-maize {
    width: 210px;
  }
}

@media (max-width: 900px) {
  .navbar {
    padding: 0.45rem 1rem;
  }

  .nav-logo-frame {
    width: 96px;
    height: 80px;
  }

  .nav-brand-logo {
    width: var(--logo-display-width-mobile);
  }

  .nav-links {
    background: var(--card-bg);
    padding-top: 5.5rem;
  }

  .theme-switcher {
    margin: 1rem 0 0;
  }

  .dictionary-hero {
    min-height: 220px;
    border-radius: 1.5rem;
  }

  .dictionary-hero-simple {
    min-height: 180px;
  }

  .hero-maize {
    opacity: 0.28;
    position: absolute;
    right: 1rem;
    z-index: -1;
  }
}

@media (max-width: 680px) {
  .container {
    padding: 0 0.85rem;
  }

  .dictionary-hero {
    padding: 1.6rem;
    min-height: 230px;
  }

  .dictionary-hero h1 {
    max-width: 18rem;
    font-size: clamp(2rem, 11vw, 3.1rem);
  }

  .dictionary-hero-simple h1 {
    max-width: 100%;
    font-size: clamp(1.75rem, 9vw, 2.65rem);
  }

  .dictionary-hero p {
    max-width: 17rem;
  }

  .search-panel {
    padding: 1rem;
    border-radius: 1.15rem;
  }

  .search-panel .filter-group,
  .search-panel .btn {
    width: 100%;
    min-width: 0 !important;
  }

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

  .card {
    border-radius: 1.15rem;
  }

  .pagination {
    gap: 0.55rem;
  }

  .pagination .btn {
    padding-inline: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
