/* Batwan Hiligaynon on Bootstrap 5.3 (static/vendor/bootstrap-5.3.8).
   Bootstrap supplies the components; this file sets the brand (var(--brand)) and
   styles what is specific to the app. Colours come from Bootstrap's CSS variables,
   so everything follows its light and dark colour modes (data-bs-theme, see theme.js). */

/* ===== Brand identity (static/brand) =====
   The mark is a lime with two leaves and a star in a forest-green ring. The palette is lime #94B744,
   forest green #3F6E2B, deep green #244A2A and white, on a warm cream page; type is Figtree,
   bold for display and lighter for supporting text; shapes are rounded.
   Lime is too light for white text (2.3:1) or for text on white, so to pass WCAG AA:
   on the light theme filled brand surfaces are forest green with white text (6.0:1), and forest green
   is the brand-coloured text (5.1:1 even on the lime-tinted subtle background); lime is an accent only.
   On the dark theme lime is the brand, with deep-green text on it (5.5:1), and links use a lighter
   lime (9.8:1 on cards). */
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("/static/brand/fonts/figtree-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("/static/brand/fonts/figtree-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root {
  --lime: #94B744;
  --lime-rgb: 148, 183, 68;
  --forest: #3F6E2B;
  --deep: #244A2A;
  --bs-font-sans-serif: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-border-radius: 0.625rem;
  --bs-border-radius-sm: 0.5rem;
  --bs-border-radius-lg: 1rem;
  --bs-border-radius-xl: 1.25rem;
}
:root, [data-bs-theme="light"] {
  --page-bg: #F7F5EE;
  --brand: #3F6E2B;
  --brand-rgb: 63, 110, 43;
  --brand-hover: #345C24;
  --brand-active: #244A2A;
  --brand-strong: #3F6E2B;
  --on-brand: #fff;
  --wordmark: #244A2A;
  --bs-body-color: #1F2A21;
  --bs-body-color-rgb: 31, 42, 33;
  --bs-emphasis-color: #142017;
  --bs-emphasis-color-rgb: 20, 32, 23;
  --bs-heading-color: #244A2A;
  --bs-secondary-color: rgba(31, 42, 33, 0.72);
  --bs-secondary-color-rgb: 31, 42, 33;
  --bs-secondary-bg: #E9EDDF;
  --bs-secondary-bg-rgb: 233, 237, 223;
  --bs-tertiary-bg: #F1F3EA;
  --bs-tertiary-bg-rgb: 241, 243, 234;
  --bs-border-color: #DDE2D2;
  --bs-border-color-translucent: rgba(36, 74, 42, 0.12);
  --bs-primary: #3F6E2B;
  --bs-primary-rgb: 63, 110, 43;
  --bs-primary-text-emphasis: #244A2A;
  --bs-primary-bg-subtle: #E8F0D6;
  --bs-primary-border-subtle: #C6D99A;
  --bs-link-color: #3F6E2B;
  --bs-link-color-rgb: 63, 110, 43;
  --bs-link-hover-color: #244A2A;
  --bs-link-hover-color-rgb: 36, 74, 42;
  --bs-focus-ring-color: rgba(148, 183, 68, 0.45);
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.8);
  --glass-shadow: 0 8px 32px rgba(36, 74, 42, 0.12);
  --blob-1: rgba(148, 183, 68, 0.34);
  --blob-2: rgba(63, 110, 43, 0.2);
  --blob-3: rgba(63, 110, 43, 0.14);
  --topbar-rule: rgba(148, 183, 68, 0.55);
  --ok: var(--bs-success);
  --warn: #eab308;
}
[data-bs-theme="dark"] {
  --page-bg: #101A13;
  --brand: #94B744;
  --brand-rgb: 148, 183, 68;
  --brand-hover: #A6C55C;
  --brand-active: #B5D36E;
  --brand-strong: #B5D36E;
  --on-brand: #1B3A20;
  --wordmark: #E9F1D6;
  --bs-body-bg: #16221A;
  --bs-body-bg-rgb: 22, 34, 26;
  --bs-body-color: #E6EBDD;
  --bs-body-color-rgb: 230, 235, 221;
  --bs-emphasis-color: #fff;
  --bs-emphasis-color-rgb: 255, 255, 255;
  --bs-heading-color: #E9F1D6;
  --bs-secondary-color: rgba(230, 235, 221, 0.7);
  --bs-secondary-color-rgb: 230, 235, 221;
  --bs-secondary-bg: #213026;
  --bs-secondary-bg-rgb: 33, 48, 38;
  --bs-tertiary-bg: #1B281F;
  --bs-tertiary-bg-rgb: 27, 40, 31;
  --bs-border-color: #2F4234;
  --bs-border-color-translucent: rgba(233, 241, 214, 0.12);
  --bs-primary: #94B744;
  --bs-primary-rgb: 148, 183, 68;
  --bs-primary-text-emphasis: #C5E08A;
  --bs-primary-bg-subtle: #1F3318;
  --bs-primary-border-subtle: #45632A;
  --bs-link-color: #B5D36E;
  --bs-link-color-rgb: 181, 211, 110;
  --bs-link-hover-color: #CFE59A;
  --bs-link-hover-color-rgb: 207, 229, 154;
  --bs-focus-ring-color: rgba(148, 183, 68, 0.4);
  --glass-bg: rgba(22, 34, 26, 0.6);
  --glass-border: rgba(233, 241, 214, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --blob-1: rgba(148, 183, 68, 0.16);
  --blob-2: rgba(148, 183, 68, 0.16);
  --blob-3: rgba(63, 110, 43, 0.34);
  --topbar-rule: rgba(148, 183, 68, 0.3);
}

/* Bootstrap compiles a few colours in; point them at the brand, with readable text */
.btn { --bs-btn-border-radius: 999px; --bs-btn-font-weight: 500; }
.btn-primary {
  --bs-btn-color: var(--on-brand); --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: var(--on-brand); --bs-btn-hover-bg: var(--brand-hover); --bs-btn-hover-border-color: var(--brand-hover);
  --bs-btn-active-color: var(--on-brand); --bs-btn-active-bg: var(--brand-active); --bs-btn-active-border-color: var(--brand-active);
  --bs-btn-disabled-color: var(--on-brand); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-focus-shadow-rgb: var(--lime-rgb);
  font-weight: 600;
}
.btn-outline-primary {
  --bs-btn-color: var(--brand-strong); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: var(--on-brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-color: var(--on-brand); --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand);
  --bs-btn-disabled-color: var(--brand-strong); --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-focus-shadow-rgb: var(--lime-rgb);
}
/* A quiet, borderless button */
.btn-ghost {
  --bs-btn-color: var(--bs-secondary-color); --bs-btn-border-color: transparent;
  --bs-btn-hover-color: var(--bs-body-color); --bs-btn-hover-bg: var(--bs-tertiary-bg); --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: var(--bs-body-color); --bs-btn-active-bg: var(--bs-secondary-bg); --bs-btn-active-border-color: transparent;
}
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--lime); box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color); }
/* White tick on forest green (6.0:1); deep-green tick on lime in the dark */
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
[data-bs-theme="dark"] .form-check-input:checked[type="checkbox"] { --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%231B3A20' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e"); }
[data-bs-theme="dark"] .form-check-input:checked[type="radio"] { --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%231B3A20'/%3e%3c/svg%3e"); }
[data-bs-theme="dark"] .form-switch .form-check-input:checked { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%231B3A20'/%3e%3c/svg%3e"); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--brand); --bs-nav-pills-link-active-color: var(--on-brand); --bs-nav-pills-border-radius: 999px; }
.list-group { --bs-list-group-active-bg: var(--brand); --bs-list-group-active-border-color: var(--brand); --bs-list-group-active-color: var(--on-brand); }
.nav-underline { --bs-nav-underline-link-active-color: var(--brand-strong); }
.nav-underline .nav-link.active { border-bottom-color: var(--lime); }
.card { --bs-card-border-color: var(--bs-border-color-translucent); --bs-card-cap-bg: transparent; }
.badge { font-weight: 600; }

/* Type: Figtree, bold and tight for display, deep green headings */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; background-color: var(--page-bg); }
h1, h2, h3, .h1, .h2, .h3, .page-title, .entry-title h2 { font-weight: 700; letter-spacing: -0.015em; }
::selection { background: rgba(var(--lime-rgb), 0.4); }

body { min-height: 100vh; display: flex; flex-direction: column; }
.app-main { flex: 1; width: 100%; }

/* ===== Top bar ===== */
/* Cream glass in the page's colour (the browser's title bar matches it: theme-color), ruled in lime */
.app-navbar { --bs-navbar-padding-y: 0.5rem; -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px); background: color-mix(in srgb, var(--page-bg) 84%, transparent); }
.app-navbar.border-bottom { border-bottom: 1px solid var(--topbar-rule) !important; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 800; font-size: 1.3rem; letter-spacing: -0.025em; color: var(--wordmark); text-decoration: none; }
.brand:hover { color: var(--wordmark); }
.brand-mark { flex: none; display: block; }
/* The apps menu: every page but the dictionary, as a grid of icons */
.apps-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: none; color: var(--bs-secondary-color);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.apps-btn:hover, .apps-btn[aria-expanded="true"] { background: rgba(var(--brand-rgb), 0.12); color: var(--bs-emphasis-color); }
.apps-btn svg { width: 20px; height: 20px; }
.apps-menu { --bs-dropdown-padding-x: 0.5rem; --bs-dropdown-padding-y: 0.5rem; width: 19.5rem; max-width: calc(100vw - 2rem);
  border-radius: 1.25rem; border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.apps-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.25rem; }
.apps-tile { display: flex; flex-direction: column; align-items: center; gap: 0.375rem; padding: 0.75rem 0.25rem;
  border-radius: 0.875rem; text-align: center; white-space: normal; font-size: 0.8125rem; line-height: 1.25; color: var(--bs-body-color); }
.apps-tile:hover, .apps-tile:focus-visible { background: rgba(var(--brand-rgb), 0.1); color: var(--bs-emphasis-color); }
.apps-tile.active, .apps-tile:active { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-weight: 600; }
.apps-ico { width: 2.75rem; height: 2.75rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(var(--brand-rgb), 0.12); color: var(--brand-strong); }
.apps-tile.active .apps-ico { background: var(--brand); color: var(--on-brand); }
.apps-account { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  border-top: 1px solid var(--bs-border-color-translucent); margin-top: 0.5rem; padding: 0.5rem 0.25rem 0; }
.avatar-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--on-brand); border: none; font-weight: 600; font-size: 0.875rem; }

.lang-switch .btn { --bs-btn-padding-y: 0.15rem; --bs-btn-padding-x: 0.55rem; --bs-btn-font-size: 0.75rem; font-weight: 600; }

/* ===== Search: glass bar, centred at home, compact on result pages ===== */
.glass-backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
/* The brand's backdrop: a lime glow in the top corner, one long sweeping line, deep green settling in below */
.glass-backdrop span { position: absolute; border-radius: 50%; }
/* (Soft-edged gradients rather than blurred circles: the same glow, without a large blur filter to paint) */
.glass-backdrop span:nth-child(1) { width: 72vmax; height: 72vmax; left: -26vmax; top: -32vmax; background: radial-gradient(closest-side, var(--blob-1) 45%, transparent); }
.glass-backdrop span:nth-child(2) { width: 210vmax; height: 210vmax; left: calc(69vw - 105vmax); top: calc(-67vh - 105vmax); border: 2px solid var(--blob-2); }
.glass-backdrop span:nth-child(3) { width: 64vmax; height: 64vmax; right: -24vmax; bottom: -30vmax; background: radial-gradient(closest-side, var(--blob-3) 40%, transparent); }
/* Tall screens: the line enters lower down, clear of the search box */
@media (orientation: portrait) { .glass-backdrop span:nth-child(2) { width: 534vw; height: 534vw; left: -23vw; top: calc(12vh - 267vw); } }

.search-shell { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.search-shell.home { padding: 10vh 0 2rem; }
.search-brand { display: flex; align-items: center; gap: 0.9rem; font-size: clamp(2.6rem, 9vw, 3.75rem); font-weight: 800; color: var(--wordmark); letter-spacing: -0.035em; line-height: 1; }
.search-brand .brand-mark { width: clamp(60px, 15vw, 76px); height: auto; filter: drop-shadow(0 6px 14px rgba(36, 74, 42, 0.18)); }
.search-shell.compact { align-items: stretch; gap: 0.5rem; margin-bottom: 1.25rem; }
.search-shell.compact .search-brand { display: none; }
.search-shell.compact .search-wrap { max-width: 720px; }

.search-wrap { position: relative; width: 100%; max-width: 640px; }
.search-box {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  height: 56px; padding: 0 0.4rem 0 1.1rem; border-radius: 999px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.search-shell.compact .search-box { height: 50px; }
.search-box:focus-within { border-color: rgba(var(--brand-rgb), 0.55); box-shadow: var(--glass-shadow), 0 0 0 0.25rem rgba(var(--brand-rgb), 0.18); }
.search-box .search-icon { color: var(--bs-secondary-color); flex: none; }
.search-box input {
  flex: 1; min-width: 0; height: 100%; border: none; outline: none; background: transparent;
  color: var(--bs-body-color); font-size: 1.0625rem;
}
/* The placeholder must not look like typed text: lighter, italic, with a typewriter caret */
.search-box input::placeholder { color: var(--bs-secondary-color); opacity: 0.85; font-style: italic; font-weight: 300; letter-spacing: 0.01em; }
.search-box input { font-weight: 500; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear { border: none; background: none; color: var(--bs-secondary-color); font-size: 1.5rem; line-height: 1; padding: 0 0.25rem; }
.search-voice { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: none; border-radius: 999px; background: none; color: var(--bs-secondary-color); }
.search-voice:hover { color: var(--brand); background: var(--bs-secondary-bg); }
.tr-voice { width: 32px; height: 32px; }
.search-voice.listening { color: var(--on-brand); background: var(--brand); animation: voice-pulse 1.4s ease-in-out infinite; }
@keyframes voice-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--brand-rgb), 0.45); } 50% { box-shadow: 0 0 0 8px rgba(var(--brand-rgb), 0); } }
@media (prefers-reduced-motion: reduce) { .search-voice.listening { animation: none; } }
.search-submit { flex: none; border-radius: 999px; padding-inline: 1.25rem; height: 44px; }
.search-shell.compact .search-submit { height: 40px; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .search-box, .suggest-menu { background: var(--bs-body-bg); }
}

/* Suggestions under the search box */
.suggest-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1050;
  border-radius: 1.25rem; padding: 0.375rem; overflow: hidden;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
}
[data-bs-theme="light"] .suggest-menu { background: rgba(255, 255, 255, 0.86); }
[data-bs-theme="dark"] .suggest-menu { background: rgba(22, 34, 26, 0.92); }
.suggest-item {
  display: flex; align-items: baseline; gap: 0.5rem; width: 100%; padding: 0.5rem 0.75rem;
  border: none; background: none; border-radius: 0.75rem; text-align: left; color: var(--bs-body-color);
}
.suggest-item[aria-selected="true"], .suggest-item:hover { background: rgba(var(--brand-rgb), 0.14); }
.suggest-item .s-icon { color: var(--bs-secondary-color); flex: none; width: 1rem; align-self: center; }
.suggest-item .s-text { font-weight: 600; }
.suggest-item .s-text mark { background: none; color: inherit; font-weight: 400; padding: 0; }
.suggest-item .s-detail { color: var(--bs-secondary-color); font-size: 0.875rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; flex: 1; }
.suggest-item .s-lang { font-size: 0.7rem; font-weight: 600; color: var(--bs-secondary-color); border: 1px solid var(--bs-border-color); border-radius: 999px; padding: 0 0.4rem; flex: none; align-self: center; }
/* Ask Batwan (AI mode), the last row of the suggestions */
.suggest-ai { border-top: 1px solid var(--bs-border-color-translucent); border-radius: 0 0 0.75rem 0.75rem; margin-top: 0.25rem; }
.suggest-item:first-child.suggest-ai { border-top: none; margin-top: 0; border-radius: 0.75rem; }
.suggest-ai .s-icon { color: var(--brand-strong); text-align: center; line-height: 1; }

/* The search direction, at the top of the suggestions */
.suggest-dirs { display: flex; gap: 0.25rem; flex-wrap: wrap; padding: 0.25rem 0.25rem 0.375rem; }
#suggestList:not(:empty) { border-top: 1px solid var(--bs-border-color-translucent); padding-top: 0.25rem; }
.suggest-dirs button {
  border: 1px solid var(--bs-border-color); background: none; color: var(--bs-body-color);
  border-radius: 999px; padding: 0.15rem 0.7rem; font-size: 0.8125rem; line-height: 1.5;
}
.suggest-dirs button:hover { background: rgba(var(--brand-rgb), 0.1); }
.suggest-dirs button.active { background: var(--bs-primary-bg-subtle); color: var(--brand-strong); border-color: var(--bs-primary-border-subtle); font-weight: 600; }
/* The direction chosen, in the search box (not shown for "Any language") */
.search-dir {
  flex: none; margin-left: 0.5rem; border: 1px solid var(--bs-primary-border-subtle); border-radius: 999px;
  background: var(--bs-primary-bg-subtle); color: var(--brand-strong); font-size: 0.75rem; font-weight: 600;
  padding: 0.1rem 0.55rem; white-space: nowrap;
}
@media (max-width: 575.98px) { .search-box:has(.search-dir:not([hidden])) .search-icon { display: none; } }

/* Word of the day: one quiet line under the search box, on the home page only */
.wotd-line { margin: 0.25rem 0 0; max-width: 640px; text-align: center; font-size: 0.9rem; color: var(--bs-secondary-color); line-height: 1.6; }
.wotd-line .wotd-label { font-weight: 600; }
.wotd-line .wotd-word { font-weight: 700; color: var(--bs-body-color); text-decoration: none; font-size: 1rem; }
.wotd-line .wotd-word:hover { text-decoration: underline; }
.wotd-line .wotd-explore { white-space: nowrap; font-weight: 600; margin-left: 0.25rem; }
.search-shell.compact .wotd-line { display: none; }
.glass-card { background: color-mix(in srgb, var(--bs-body-bg) 80%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

/* ===== Results and entries ===== */
.result-word { font-weight: 700; font-size: 1.05rem; }
.result-accent { color: var(--bs-secondary-color); font-size: 0.875rem; }
.result-gloss { color: var(--bs-secondary-color); font-size: 0.9rem; margin-top: 0.15rem; }
.result-head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.result-head .badge:last-child { margin-left: auto; }
.pos { font-style: italic; color: var(--brand-strong); font-size: 0.85rem; }
.suggestions { font-size: 0.9rem; color: var(--bs-secondary-color); margin: 0 0 0.75rem; }
.suggestions button { background: none; border: none; color: var(--bs-link-color); padding: 0 0.15rem; text-decoration: underline; }
.empty { text-align: center; color: var(--bs-secondary-color); padding: 2rem 1rem; }

.entry-title { display: flex; align-items: baseline; gap: 0.625rem; flex-wrap: wrap; margin: 0 0 0.25rem; }
.entry-title h2 { margin: 0; font-size: 1.75rem; font-weight: 700; }
.entry-meta { color: var(--bs-secondary-color); font-size: 0.875rem; display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.senses { margin: 0 0 1rem; padding-left: 1.5rem; }
.senses li { margin-bottom: 0.375rem; }
/* A meaning's German, under its English */
.sense-de { font-size: 0.9rem; color: var(--bs-secondary-color); margin-top: 0.1rem; }
.lang-tag { display: inline-block; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; padding: 0 0.3rem; border-radius: 0.25rem;
  border: 1px solid var(--bs-border-color); color: var(--bs-secondary-color); vertical-align: 0.1em; }
.result-gloss-en { margin-top: 0.1rem; }
.section-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bs-secondary-color); font-weight: 600; margin: 1.25rem 0 0.5rem; }
.example { border-left: 3px solid var(--brand); padding: 0.25rem 0 0.25rem 0.75rem; margin-bottom: 0.5rem; }
.example .hil { font-weight: 500; }
.example .en { color: var(--bs-secondary-color); font-size: 0.9rem; }
.example-actions { display: flex; gap: 0.875rem; margin-top: 0.15rem; font-size: 0.8rem; }
.example mark { background: var(--bs-warning-bg-subtle); color: inherit; padding: 0 0.125rem; border-radius: 2px; }
.example-source { font-size: 0.75rem; color: var(--bs-secondary-color); }
.sentence-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-top: 0.2rem; }
.sentence-tools .stars { font-size: 1rem; }
.sentence-tools .small { font-size: 0.75rem; }
.example-form { border-left: 3px solid var(--brand); padding: 0.5rem 0 0.5rem 0.75rem; margin-bottom: 0.5rem; }
.forms { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.forms span { background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: 999px; padding: 0.125rem 0.625rem; font-size: 0.85rem; }
.forms em { color: var(--bs-secondary-color); font-style: normal; font-size: 0.75rem; }
.attribution { font-size: 0.8rem; color: var(--bs-secondary-color); border-top: 1px solid var(--bs-border-color); padding-top: 0.75rem; margin-top: 1.25rem; }
.back-link { background: none; border: none; color: var(--bs-link-color); padding: 0; font-size: 0.875rem; margin-bottom: 0.75rem; }

/* Wikipedia-style page tabs sit on the card */
.page-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-bottom: none; }
.page-tabs::-webkit-scrollbar { display: none; }
.page-tabs .nav-link { white-space: nowrap; }
.page-tabs .nav-link.active { font-weight: 600; }
.page-tabs .ms-auto { margin-left: auto; }
.card.page-card { border-top-left-radius: 0; }

/* History and diffs */
.hist-list { list-style: none; margin: 0; padding: 0; }
.hist-row { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--bs-border-color); font-size: 0.875rem; }
.hist-row:last-child { border-bottom: none; }
.hist-row.is-current { font-weight: 500; }
.hist-links { color: var(--bs-secondary-color); font-size: 0.8125rem; }
.hist-summary { color: var(--bs-secondary-color); font-style: italic; }
.diff-head { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; font-size: 0.875rem; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--bs-border-color); }
.diff-field { margin-bottom: 0.875rem; }
.diff-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bs-secondary-color); font-weight: 600; margin-bottom: 0.25rem; }
.diff-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.925rem; padding: 0.5rem 0.75rem; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); background: var(--bs-tertiary-bg); }
.diff-field:not(.changed) .diff-body { color: var(--bs-secondary-color); }
ins { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); text-decoration: none; border-radius: 2px; padding: 0 1px; }
del { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); border-radius: 2px; padding: 0 1px; }
.review-box { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--bs-border-color); }

/* Star ratings */
.rating-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0 0; }
.stars { display: inline-flex; gap: 0.125rem; font-size: 1.35rem; line-height: 1; }
.star { color: var(--bs-border-color); background: none; border: none; padding: 0; }
.star.on { color: #f59e0b; }
.stars.interactive .star { cursor: pointer; }
.stars.interactive:hover .star { color: #f59e0b; }
.stars.interactive .star:hover ~ .star { color: var(--bs-border-color); }

/* A rating: the stars and the average. Hovering or focusing it shows the share of each number of stars */
.rating { position: relative; display: inline-flex; align-items: center; gap: 0.375rem; }
.rating:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.rating.needs-signin { cursor: pointer; }
.rating-avg { font-weight: 700; font-size: 0.875rem; font-variant-numeric: tabular-nums; color: var(--bs-body-color); }
.rating-dist { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 210px; padding: 0.625rem 0.75rem; display: none;
  font-size: 0.78rem; line-height: 1.3; color: var(--bs-body-color); background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); pointer-events: none; }
.rating:hover .rating-dist, .rating:focus-within .rating-dist { display: block; }
.rating-dist strong { display: block; margin-bottom: 0.375rem; font-weight: 600; }
.rd-row { display: grid; grid-template-columns: 2.1rem 1fr 2.4rem; align-items: center; gap: 0.375rem; margin: 0.15rem 0; }
.rd-n { white-space: nowrap; color: var(--bs-secondary-color); }
.rd-bar { height: 6px; border-radius: 3px; background: var(--bs-tertiary-bg); overflow: hidden; }
.rd-bar span { display: block; height: 100%; background: #f59e0b; border-radius: 3px; }
.rd-pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--bs-secondary-color); }
.rd-foot { margin-top: 0.375rem; color: var(--bs-secondary-color); }
/* A word's rating sits at the end of its title line; sentences' at their end. With a mouse, they show
   only while the word's definition or the sentence is hovered (or focused); on touch screens, always */
.word-rating { margin: 0 0 0 auto; align-self: center; }
.word-rating .stars { font-size: 1.15rem; }
.sentence-tools .rating { order: 2; margin-left: auto; }
.word-rating .rating-dist, .sentence-tools .rating-dist { left: auto; right: 0; }
@media (hover: hover) {
  .entry-def .word-rating, .example .sentence-tools .rating { opacity: 0; transition: opacity 0.15s; }
  .entry-def:hover .word-rating, .entry-def:focus-within .word-rating,
  .example:hover .sentence-tools .rating, .example:focus-within .sentence-tools .rating { opacity: 1; }
}

/* Tags on words (formal, informal ...): under the pronunciation */
.entry-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: -0.25rem 0 0.75rem; }
.word-tag { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  color: var(--bs-primary-text-emphasis); background: var(--bs-primary-bg-subtle); border: 1px solid var(--bs-primary-border-subtle); }
.tag-suggest { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }
.tag-chip { padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.75rem; color: var(--bs-secondary-color);
  background: none; border: 1px dashed var(--bs-border-color); }
.tag-chip:hover { color: var(--bs-body-color); border-color: var(--brand); border-style: solid; }
.tag-chip::before { content: "+ "; }
.tag-chip.on { color: var(--bs-primary-text-emphasis); background: var(--bs-primary-bg-subtle); border: 1px solid var(--bs-primary-border-subtle); }
.tag-chip.on::before { content: "✓ "; }

/* ===== Translator ===== */
.tr-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.75rem; align-items: stretch; }
.tr-pane { display: flex; flex-direction: column; min-width: 0; }
.tr-pane textarea { border: none; border-radius: 0 0 var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius); min-height: 180px; font-size: 1.05rem; flex: 1; resize: vertical; }
.tr-pane textarea:focus { box-shadow: none; }
.tr-output { padding: 0.875rem 1rem; font-size: 1.05rem; min-height: 180px; white-space: pre-wrap; overflow-wrap: anywhere; flex: 1; }
/* Not Bootstrap's loading .placeholder (a grey block): only the hint text, greyed */
.tr-output.placeholder { display: block; min-height: 180px; vertical-align: baseline; cursor: auto; opacity: 1; background: none; color: var(--bs-secondary-color); }
.tr-swap { align-self: center; width: 44px; height: 44px; border-radius: 50%; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; text-align: left;
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius);
  padding: 0.375rem 0.625rem; color: var(--bs-body-color);
}
.chip:hover:not(:disabled) { border-color: var(--brand); }
.chip .src { font-weight: 600; font-size: 0.9rem; }
.chip .dst { font-size: 0.85rem; color: var(--bs-secondary-color); }
.chip.m-exact, .chip.m-phrase { border-left: 3px solid var(--ok); }
.chip.m-root, .chip.m-stem { border-left: 3px solid var(--warn); }
.chip.m-unknown { border: 1px dashed var(--bs-danger); }
.chip.m-omitted { opacity: 0.6; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.8rem; color: var(--bs-secondary-color); margin-top: 0.75rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 0.25rem; vertical-align: -1px; }
.legend .l-found { background: var(--ok); }
.legend .l-root { background: var(--warn); }
.legend .l-missing { border: 1px dashed var(--bs-danger); }
.meter { height: 6px; background: var(--bs-border-color); border-radius: 3px; overflow: hidden; width: 90px; display: inline-block; vertical-align: middle; margin-left: 0.375rem; }
.meter span { display: block; height: 100%; background: var(--ok); }
.snippet { font-size: 0.9rem; padding: 0.5rem 0; border-bottom: 1px solid var(--bs-border-color); }
.snippet:last-child { border-bottom: none; }
.snippet mark { background: var(--bs-warning-bg-subtle); color: inherit; padding: 0 0.125rem; border-radius: 2px; }
.snippet .src { font-size: 0.75rem; color: var(--bs-secondary-color); }

/* ===== Home, sources, developers ===== */
.wotd { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.wotd-word { font-size: 1.375rem; font-weight: 700; }
.source-item { padding: 0.875rem 0; border-bottom: 1px solid var(--bs-border-color); }
.source-item:last-child { border-bottom: none; }
.source-item h3 { margin: 0 0 0.25rem; font-size: 0.95rem; font-weight: 600; }
.source-item p { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--bs-secondary-color); }
.source-item p.source-who { margin-top: 0; font-style: italic; }
.sources-tools { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.25rem; }
.sources-tools input { max-width: 22rem; }
.sources-tools span { white-space: nowrap; }
.ep-table td { vertical-align: top; }
pre.code { margin: 0; padding: 1rem; background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); font-size: 0.8125rem; line-height: 1.5; }
code { overflow-wrap: anywhere; }

/* ===== Questions ===== */
.q-item { display: flex; gap: 1rem; align-items: center; }
.q-count { display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 0.375rem; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); font-size: 0.75rem; color: var(--bs-secondary-color); flex: none; }
.q-count strong { font-size: 1.125rem; color: var(--bs-body-color); }
.q-count.has { border-color: var(--ok); }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.post-meta { font-size: 0.8125rem; color: var(--bs-secondary-color); margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: center; }
.post-actions { margin-left: auto; display: inline-flex; gap: 0.25rem; flex-wrap: wrap; }
.answer.accepted { border-color: var(--ok); border-width: 2px; }
.accepted-label { color: var(--bs-success-text-emphasis); font-weight: 600; font-size: 0.8125rem; margin-bottom: 0.375rem; }

/* ===== Shared bits ===== */
.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar > .form-control, .toolbar > .form-select { width: auto; flex: 0 1 auto; }
.toolbar > input[type="search"] { flex: 1 1 200px; }
.pager { display: flex; gap: 0.5rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 0.75rem; font-size: 0.85rem; color: var(--bs-secondary-color); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.hint { font-size: 0.8rem; color: var(--bs-secondary-color); margin-top: 0.25rem; }
.page-title { font-size: 1.375rem; font-weight: 700; margin: 0 0 0.25rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.mono { font-family: var(--bs-font-monospace); font-size: 0.8rem; }
.table-wrapper { border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg); background: var(--bs-body-bg); overflow-x: auto; }
.table-wrapper > .table { margin: 0; }
.table-wrapper > .table > :not(caption) > * > * { padding: 0.65rem 0.9rem; }
.table thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--bs-secondary-color); white-space: nowrap; }

.pw-strength { display: flex; gap: 4px; margin-top: 0.375rem; }
.pw-strength span { flex: 1; height: 4px; border-radius: 2px; background: var(--bs-border-color); transition: background 0.2s; }
.pw-strength.s1 span:nth-child(1) { background: var(--bs-danger); }
.pw-strength.s2 span:nth-child(-n+2) { background: #f97316; }
.pw-strength.s3 span:nth-child(-n+3) { background: #eab308; }
.pw-strength.s4 span { background: var(--bs-success); }

.footer { text-align: center; font-size: 0.8rem; color: var(--bs-secondary-color); padding: 1.5rem 1rem 2rem; }
.footer a { color: var(--bs-secondary-color); }
.footer-sign { display: inline-flex; align-items: center; gap: 0.4rem; }
.footer-links { margin-bottom: 0.375rem; line-height: 2; }
.footer-links a { text-decoration: none; padding: 0.25rem 0.375rem; }
.footer-links a:hover { text-decoration: underline; }

/* ===== Pronunciation: respelling and IPA ===== */
.entry-pron { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin: -0.25rem 0 0.75rem; }
.pron-respell { font-weight: 600; letter-spacing: 0.02em; }
.pron-ipa { color: var(--bs-secondary-color); font-family: "Charis SIL", "Doulos SIL", "Gentium Plus", "Noto Sans", "Segoe UI", sans-serif; }
.pron-help { color: var(--bs-secondary-color); }
.result-pron { color: var(--bs-secondary-color); font-size: 0.85rem; letter-spacing: 0.02em; }

/* ===== Pronunciation recordings ===== */
.audio-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; min-height: 2.25rem; padding: 0.25rem;
  color: var(--brand-strong); border-radius: 50%; vertical-align: middle; }
.audio-btn svg { width: 1.25rem; height: 1.25rem; }
.audio-btn:hover { background: var(--bs-primary-bg-subtle); color: var(--brand-strong); }
.audio-btn.playing { background: var(--bs-primary-bg-subtle); animation: audio-pulse 1s ease-in-out infinite; }
@keyframes audio-pulse { 50% { box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.25); } }
@media (prefers-reduced-motion: reduce) { .audio-btn.playing { animation: none; } }
.clip-list, .attest-list { list-style: none; padding: 0; margin: 0 0 0.75rem; }
.clip-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 0.25rem 0; border-bottom: 1px solid var(--bs-border-color-translucent); }
.clip-row:last-child { border-bottom: 0; }
.clip-row .clip-actions { margin-left: auto; display: flex; gap: 0.25rem; }
.attest-list li { padding: 0.375rem 0; border-bottom: 1px solid var(--bs-border-color-translucent); font-size: 0.9rem; }
.attest-list li:last-child { border-bottom: 0; }
.rec-panel { text-align: center; }
.rec-btn { display: inline-flex; align-items: center; gap: 0.5rem; }
.rec-dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: currentColor; display: inline-block; }
.rec-btn.recording { --bs-btn-bg: var(--bs-danger); --bs-btn-border-color: var(--bs-danger); --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--bs-danger); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--bs-danger); }
.rec-btn.recording .rec-dot { animation: rec-blink 1s steps(2) infinite; }
@keyframes rec-blink { 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .rec-btn.recording .rec-dot { animation: none; } }
.rec-timer { font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 600; margin: 0.5rem 0; }
.rec-panel audio { width: 100%; margin-top: 0.5rem; }

/* ===== About and legal pages ===== */
.site-page { max-width: 46rem; margin-inline: auto; line-height: 1.65; }
.site-page h2 { font-size: 1.25rem; font-weight: 600; margin: 1.75rem 0 0.5rem; }
.site-page h3 { font-size: 1.05rem; font-weight: 600; margin: 1.25rem 0 0.5rem; }
.site-page ul, .site-page ol { padding-left: 1.25rem; }
.site-page li { margin-bottom: 0.25rem; }
.about-links { list-style: none; padding-left: 0 !important; }
.about-links li { padding: 0.25rem 0; }

/* ===== Responsive ===== */
@media (max-width: 767.98px) {
  .form-grid, .diff-head { grid-template-columns: 1fr; }
  .tr-grid { grid-template-columns: 1fr; }
  .tr-swap { transform: rotate(90deg); justify-self: center; }
  .search-shell.home { padding-top: 6vh; }
  .search-box { height: 52px; padding-left: 0.9rem; }
  .search-submit { padding-inline: 0.9rem; }
  .q-item { gap: 0.75rem; }
  .q-count { min-width: 52px; }
  .post-actions { margin-left: 0; width: 100%; }
}
@media (max-width: 399.98px) {
  .search-submit .label { display: none; }
}

/* ===== AI mode: a chat with Batwan; the search bar becomes the composer ===== */
.mode-row { display: flex; justify-content: flex-start; }
.search-shell.home .mode-row { display: none; }
.mode-tabs { --bs-nav-underline-gap: 1.25rem; font-size: 0.9rem; }
.mode-tabs .nav-link { padding-block: 0.25rem; }
.no-ai .ai-only { display: none !important; }

#dictionaryView.ai-mode { display: flex !important; flex-direction: column; min-height: calc(100vh - 220px); }
#dictionaryView.ai-mode #aiView { order: 1; flex: 1; }
/* The composer floats as a glass panel, like the cards and bubbles: no band of solid colour across
   the page's background; messages scrolling behind it are blurred */
#dictionaryView.ai-mode .search-shell {
  order: 2; position: sticky; bottom: max(0.75rem, env(safe-area-inset-bottom)); z-index: 10;
  margin: 1rem 0 0; padding: 0.5rem 0.75rem 0.75rem; border-radius: 1.5rem;
  background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
}
#dictionaryView.ai-mode .search-box { box-shadow: none; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #dictionaryView.ai-mode .search-shell { background: var(--bs-body-bg); }
}
/* Typewriter: the newest answer is typed out */
.bubble .msg.typing-out::after { content: "▍"; margin-left: 1px; color: var(--brand); animation: caret-blink 0.9s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
#dictionaryView.ai-mode .search-dir, #dictionaryView.ai-mode .suggest-menu { display: none !important; }
#dictionaryView.ai-mode .search-wrap { max-width: none; }
#dictionaryView.ai-mode .mode-row { order: -1; }

.ai-thread { display: flex; flex-direction: column; gap: 0.875rem; }
.bubble { max-width: min(85%, 680px); padding: 0.75rem 1rem; border-radius: 1.25rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.bubble.user { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 0.375rem; }
.bubble.assistant {
  align-self: flex-start; border-bottom-left-radius: 0.375rem;
  background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.bubble.error { border-color: var(--bs-danger-border-subtle); color: var(--bs-danger-text-emphasis); }
.bubble .who { display: block; font-size: 0.75rem; font-weight: 600; margin-bottom: 0.15rem; color: var(--bs-secondary-color); }
.bubble.user .who { color: var(--on-brand); }
.bubble .lookup { display: inline-block; margin-top: 0.4rem; font-size: 0.8rem; }
.ai-samples { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.typing { display: inline-flex; gap: 4px; align-items: center; height: 1.2em; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--bs-secondary-color); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; } }
@media (max-width: 767.98px) { .bubble { max-width: 92%; } }
.list-group-item-action .result-word, .list-group-item-action .q-title { color: var(--bs-body-color); }
.bubble.user .lookup { color: var(--on-brand); }

/* ===== Trending ===== */
.trend-list { list-style: none; padding: 0; margin: 0; }
.trend-row { display: flex; align-items: flex-start; gap: 0.875rem; padding: 0.625rem 0; border-bottom: 1px solid var(--bs-border-color-translucent); }
.trend-row:last-child { border-bottom: 0; }
.trend-rank { flex: none; width: 1.75rem; text-align: right; font-weight: 600; color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; }
.trend-word { flex: 1; min-width: 0; }
.trend-bar { display: flex; height: 6px; margin-top: 0.4rem; border-radius: 3px; overflow: hidden; background: var(--bs-secondary-bg); }
.trend-bar .s { background: var(--brand); }
.trend-bar .c { background: var(--brand); opacity: 0.45; }
.trend-count { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) { .trend-row { flex-wrap: wrap; } .trend-count { width: 100%; padding-left: 2.625rem; } }

/* ===== Podcast ===== */
.podcast-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.podcast-mark { flex: none; border-radius: 50%; }
.podcast-kicker { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--brand); }
.podcast-show .spotify-embed { margin-bottom: 0.25rem; }
.spotify-embed { display: block; border: 0; border-radius: 12px; max-width: 100%; }
.pod-episode { margin-bottom: 1rem; }
.pod-ep-num { font-weight: 700; color: var(--brand); margin-right: 0.25rem; }
.pod-ep-desc { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
#podFresh[hidden] { display: none !important; }
.pod-count { font-weight: 400; color: var(--bs-secondary-color); }
.pod-latest { border-color: var(--brand); }
.pod-badge { background: var(--brand); color: #fff; font-weight: 600; margin-left: 0.25rem; }
.pod-badge-new { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.pod-player:not(:empty) { margin-top: 0.5rem; }
.pod-audio { display: block; width: 100%; }
.pod-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 0.5rem; }
.pod-transcript { margin-top: 0.75rem; border-top: 1px solid var(--bs-border-color-translucent); padding-top: 0.75rem; }
.tx-lines { list-style: none; padding: 0; margin: 0; }
.tx-line { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid var(--bs-border-color-translucent); }
.tx-line:last-child { border-bottom: 0; }
.tx-play, .tx-play-gap { flex: none; width: 1.75rem; height: 1.75rem; }
.tx-play { border: 1px solid var(--bs-border-color); border-radius: 50%; background: transparent; color: var(--brand); font-size: 0.7rem; line-height: 1; padding: 0; }
.tx-play:hover, .tx-play.playing { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.tx-time { flex: none; width: 3.25rem; padding-top: 0.2rem; font-size: 0.8125rem; color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; }
.tx-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tx-speaker { font-weight: 600; margin-right: 0.375rem; }
.tx-speaker::after { content: ":"; }
.tx-word { color: inherit; text-decoration: none; }
.tx-word:hover, .tx-word:focus-visible { color: var(--bs-link-color); text-decoration: underline dotted; }
.tx-en { font-size: 0.875rem; color: var(--bs-secondary-color); }
@media (max-width: 575.98px) { .podcast-mark { width: 44px; height: 44px; } .tx-time { width: 2.75rem; } }

/* ===== CAPTCHA ===== */
.captcha-row { display: flex; align-items: center; gap: 0.5rem; }
.captcha-row img { display: block; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--bs-border-color); }
.captcha-row .btn { font-size: 1.25rem; line-height: 1; padding: 0.375rem 0.625rem; }
.captcha input { text-transform: uppercase; letter-spacing: 0.2em; font-family: var(--bs-font-monospace); }

/* ===== Sign in with Google ===== */
.or-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1rem 0; color: var(--bs-secondary-color); font-size: 0.8rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--bs-border-color); }
.google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; font-weight: 500; }
.trend-legend { display: flex; gap: 1rem; margin-top: 0.75rem; padding-left: 2.625rem; }
.trend-legend > span { display: inline-flex; align-items: center; gap: 0.35rem; }
.trend-legend i { display: inline-block; width: 0.75rem; height: 6px; border-radius: 3px; background: var(--brand); }
.trend-legend i.c { opacity: 0.45; }

/* ===== Rating and reporting AI-mode answers ===== */
.answer-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-top: 0.5rem; padding-top: 0.4rem; border-top: 1px solid var(--glass-border); white-space: normal; }
.answer-tools .stars { font-size: 1.05rem; }
.answer-tools .btn-link { font-size: 0.8rem; color: var(--bs-secondary-color); text-decoration: none; }
.answer-tools .btn-link:hover { color: var(--bs-danger-text-emphasis); }
.report-form { margin-top: 0.5rem; white-space: normal; }
.ai-fb-note { font-size: 0.75rem; color: var(--bs-secondary-color); text-align: center; margin: 0.25rem 0 0; }

/* ===== Profile badges on Discussion posts ===== */
.post-author { display: inline-flex; align-items: center; gap: 0.4rem; vertical-align: middle; }
.post-avatar { width: 26px; height: 26px; font-size: 0.7rem; }
.post-avatar.sm { width: 20px; height: 20px; font-size: 0.6rem; }
.avatar-btn { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; padding: 0; flex: none; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Quiz: ten questions, one at a time, then the score and every answer */
.quiz-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.quiz-head .btn { display: inline-flex; align-items: center; gap: 0.4rem; }
.quiz-cats { display: flex; gap: 0.375rem; flex-wrap: wrap; margin-bottom: 1rem; }
.quiz-cats button {
  border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); color: var(--bs-body-color);
  border-radius: 999px; padding: 0.25rem 0.9rem; font-size: 0.875rem;
}
.quiz-cats button:hover { background: rgba(var(--brand-rgb), 0.1); }
.quiz-cats button.active { background: var(--bs-primary-bg-subtle); color: var(--brand-strong); border-color: var(--bs-primary-border-subtle); font-weight: 600; }
.quiz-card { max-width: 760px; }
.quiz-progress { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.875rem; color: var(--bs-secondary-color); }
.quiz-bar { height: 6px; margin: 0.5rem 0 1.25rem; }
.quiz-bar .progress-bar { background: var(--brand); transition: width 0.3s; }
@media (prefers-reduced-motion: reduce) { .quiz-bar .progress-bar { transition: none; } }
.quiz-question { font-size: 1.25rem; font-weight: 500; line-height: 1.5; margin: 0 0 1rem; outline: none; }
.quiz-term { font-weight: 700; color: var(--brand-strong); }
.quiz-sentence { margin: 0.75rem 0 0; padding: 0.75rem 1rem; border-left: 3px solid var(--brand); background: var(--bs-tertiary-bg); border-radius: 0 0.5rem 0.5rem 0; font-size: 1.125rem; font-weight: 600; }
.quiz-blank { color: var(--brand-strong); letter-spacing: 0.05em; }
.quiz-hint { margin-top: 0.5rem; font-size: 0.9rem; color: var(--bs-secondary-color); }
.quiz-choices { display: grid; gap: 0.5rem; }
.quiz-choice {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left; padding: 0.7rem 0.9rem;
  border: 1px solid var(--bs-border-color); border-radius: 0.75rem; background: var(--bs-body-bg); color: var(--bs-body-color);
  font-size: 1rem; transition: border-color 0.15s, background 0.15s;
}
.quiz-choice:hover:not(:disabled) { border-color: rgba(var(--brand-rgb), 0.6); background: rgba(var(--brand-rgb), 0.06); }
.quiz-choice:disabled { opacity: 1; cursor: default; }
.quiz-letter {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem;
  border-radius: 999px; border: 1px solid var(--bs-border-color); font-size: 0.8rem; font-weight: 700; color: var(--bs-secondary-color);
}
.quiz-choice.right { border-color: var(--bs-success-border-subtle); background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); font-weight: 600; }
.quiz-choice.right .quiz-letter { background: var(--bs-success); border-color: var(--bs-success); color: #fff; }
.quiz-choice.wrong { border-color: var(--bs-danger-border-subtle); background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.quiz-choice.wrong .quiz-letter { background: var(--bs-danger); border-color: var(--bs-danger); color: #fff; }
.quiz-choice.faded { opacity: 0.6; }
.quiz-feedback { margin-top: 1rem; padding: 0.75rem 1rem; border-radius: 0.75rem; }
.quiz-feedback.right { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.quiz-feedback.wrong { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.quiz-explain { margin-top: 0.25rem; color: var(--bs-body-color); }
.quiz-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.quiz-result { text-align: center; padding: 0.5rem 0 1rem; }
.quiz-score { font-size: 2.25rem; font-weight: 600; color: var(--bs-secondary-color); outline: none; }
.quiz-score span { font-size: 3.5rem; font-weight: 800; color: var(--brand-strong); }
.quiz-review-title { font-size: 1rem; font-weight: 600; margin: 1rem 0 0.5rem; border-top: 1px solid var(--bs-border-color); padding-top: 1rem; }
.quiz-review { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.quiz-review li { display: flex; gap: 0.75rem; align-items: flex-start; }
.quiz-review .quiz-mark { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; color: #fff; }
.quiz-review li.right .quiz-mark { background: var(--bs-success); }
.quiz-review li.wrong .quiz-mark { background: var(--bs-danger); }
.quiz-review .quiz-review-q { font-size: 0.95rem; }
.quiz-review .quiz-sentence { font-size: 0.95rem; padding: 0.4rem 0.75rem; margin-top: 0.35rem; }
.quiz-review .quiz-hint { font-size: 0.8rem; }
/* Narrow phones: one line, the logo without its name */
@media (max-width: 413.98px) {
  .app-navbar .container-fluid { flex-wrap: nowrap; padding-inline: 0.75rem !important; }
  #topLogo { margin-right: 0.25rem !important; }
  #topLogo span { display: none; }
  .apps-btn { width: 36px; height: 36px; }
}

/* The page's own text for bots and browsers without scripts (app/seo.py); hidden once the script runs */
.js .ssr { display: none !important; }
.ssr { max-width: 760px; margin: 0 auto 2rem; }
.ssr ul { columns: 2; }
.footer-tagline { margin: 0 auto 0.375rem; max-width: 46rem; }

/* Signed in: the site and the workspace, one click apart */
.ws-switch { display: inline-flex; padding: 2px; border-radius: 999px; border: 1px solid var(--bs-border-color); background: rgba(var(--brand-rgb), 0.06); flex: none; }
.ws-switch-opt { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.65rem; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 600; line-height: 1.4; color: var(--bs-secondary-color); text-decoration: none; white-space: nowrap; }
.ws-switch-opt:hover { color: var(--bs-emphasis-color); }
.ws-switch-opt.active { background: var(--brand); color: var(--on-brand); }
.ws-switch-opt svg { flex: none; }
@media (max-width: 575.98px) { .ws-switch-opt { padding: 0.3rem 0.5rem; } .ws-switch-opt span { display: none; } }
