/* ================================================================
   In seltsame Wörter — Bootstrap Supplement
   Only contains styles NOT already handled by Bootstrap 5.3
   ================================================================ */

/* ----------------------------------------------------------------
   Design tokens — the brand palette, defined once.
   Every brand colour below was previously inlined as a raw hex
   (navy alone appeared 13x). Change the identity here, not in 30
   scattered places. Bootstrap semantic colours (success/danger/
   warning) are intentionally left as literals where they appear.
   ---------------------------------------------------------------- */
:root {
    /* Core */
    --brand-navy:        #113951;      /* primary */
    --brand-navy-hover:  #0d2b3e;      /* button hover/active (light) */
    --brand-navy-deep:   #0a1f2e;      /* darkest surfaces (dark theme) */
    --brand-navy-rgb:    17, 57, 81;   /* triplet for rgba() shadows/tints */
    --brand-slate:       #6F8FA2;      /* secondary */
    --brand-slate-muted: #7a99ab;      /* slate on dark theme */

    /* Dark-theme accents */
    --brand-sky:       #68b5d8;        /* links/headwords on dark */
    --brand-navy-mid:  #2c5f7a;        /* active fills on dark */
    --brand-navy-edge: #3a6a85;        /* borders/edges on dark */
    --brand-teal:      #4a7c96;        /* misc dark accents */
}

/* ----------------------------------------------------------------
   Bootstrap button colour overrides (component-level CSS vars)
   ---------------------------------------------------------------- */
.btn-primary {
    --bs-btn-bg: var(--brand-navy);
    --bs-btn-border-color: var(--brand-navy);
    --bs-btn-hover-bg: var(--brand-navy-hover);
    --bs-btn-hover-border-color: var(--brand-navy-hover);
    --bs-btn-active-bg: var(--brand-navy-hover);
    --bs-btn-focus-shadow-rgb: var(--brand-navy-rgb);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand-navy);
    --bs-btn-border-color: var(--brand-navy);
    --bs-btn-hover-bg: var(--brand-navy);
    --bs-btn-hover-border-color: var(--brand-navy);
    --bs-btn-active-bg: var(--brand-navy);
}
:root {
    --bs-link-color: var(--brand-navy);
    --bs-link-hover-color: var(--brand-slate);
    --bs-link-color-rgb: var(--brand-navy-rgb);
}

/* ----------------------------------------------------------------
   Site Header (branding bar above navbar)
   ---------------------------------------------------------------- */
body {
    padding-bottom: 60px; /* clearance above fixed footer */
}

.site-header {
    background-color: var(--brand-navy);
}

.site-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.site-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    margin: 0;
}

.login-input {
    background-color: rgba(255, 255, 255, 0.92);
    max-width: 130px;
}

/* ----------------------------------------------------------------
   Footer (fixed at bottom)
   ---------------------------------------------------------------- */
.footer-bar {
    background-color: var(--brand-slate);
    bottom: 0;
    left: 0;
    position: fixed;
    right: 0;
    z-index: 1019;
}

.footer-bar a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-bar a:hover {
    color: #fff;
}

.language-select {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    width: auto;
}

.language-select option {
    background-color: var(--brand-teal);
    color: #fff;
}

.icon-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-icon {
    opacity: 0.85;
    transition: opacity 0.15s;
}

.footer-icon:hover {
    opacity: 1;
}

/* ----------------------------------------------------------------
   Back to Top Button
   ---------------------------------------------------------------- */
#back-to-top {
    bottom: 4.5rem;
    display: none;
    font-size: 1.4rem;
    height: 44px;
    line-height: 1;
    padding: 0;
    position: fixed;
    right: 1.5rem;
    transition: transform 0.15s;
    width: 44px;
    z-index: 1018;
}

#back-to-top:hover {
    transform: translateY(-2px);
}

/* ----------------------------------------------------------------
   Word of the Day Banner (logged-out home page)
   ---------------------------------------------------------------- */
.wod-banner {
    align-items: center;
    background-color: var(--brand-navy);
    color: white;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 10px 1.5rem;
}

.wod-banner a {
    color: #cce8f4;
    font-weight: 600;
    text-decoration: none;
}

.wod-banner a:hover {
    color: white;
}

.wod-label {
    background-color: var(--brand-slate);
    border-radius: 10px;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 2px 10px;
    text-transform: uppercase;
    white-space: nowrap;
}

.wod-lang {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    margin-left: auto;
}

/* ----------------------------------------------------------------
   Home page images
   ---------------------------------------------------------------- */
.home-image {
    height: 340px;
    object-fit: cover;
    width: 100%;
}

@media (max-width: 767.98px) {
    .home-image {
        height: 220px;
    }
}

/* ----------------------------------------------------------------
   Post Cards — subtle hover lift
   ---------------------------------------------------------------- */
.card-post {
    transition: box-shadow 0.15s, transform 0.1s;
}

.card-post:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px);
}

/* ----------------------------------------------------------------
   Related Posts section heading
   ---------------------------------------------------------------- */
.related-heading {
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

/* ----------------------------------------------------------------
   Share message
   ---------------------------------------------------------------- */
.share-msg {
    color: #198754;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ----------------------------------------------------------------
   Character Counter
   ---------------------------------------------------------------- */
.char-counter {
    display: block;
    font-size: 0.78rem;
    margin-top: 3px;
}

.char-counter.near-limit {
    color: #d97706;
    font-weight: 600;
}

.char-counter.at-limit {
    color: #dc2626;
    font-weight: 600;
}

/* ----------------------------------------------------------------
   Comment inline edit/delete
   ---------------------------------------------------------------- */
.inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.inline-delete-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.82rem;
    padding: 0;
    text-decoration: underline;
}

.inline-delete-btn:hover {
    background: none;
    color: #a71d2a;
}

/* ----------------------------------------------------------------
   Page fade-in transition
   ---------------------------------------------------------------- */
body {
    animation: pageFadeIn 0.25s ease-in;
}

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

/* ----------------------------------------------------------------
   Tag cloud badges (sidebar)
   ---------------------------------------------------------------- */
.tag-cloud-badge {
    background-color: var(--brand-navy);
    color: #fff;
    font-size: 0.8rem !important;
    transition: opacity 0.15s, transform 0.1s;
}

.tag-cloud-badge:hover {
    opacity: 1 !important;
    transform: translateY(-1px);
    color: #fff;
}

[data-bs-theme="dark"] .tag-cloud-badge {
    background-color: var(--brand-navy-mid);
}

/* ----------------------------------------------------------------
   Language / tag cards — popularity bar
   ---------------------------------------------------------------- */
.popularity-bar {
    background-color: var(--brand-navy);
    border-radius: 2px;
    height: 3px;
    margin-top: 4px;
    transition: width 0.3s ease;
}

[data-bs-theme="dark"] .popularity-bar {
    background-color: var(--brand-teal);
}

/* ----------------------------------------------------------------
   Profile bio
   ---------------------------------------------------------------- */
.profile-bio {
    border-left: 3px solid var(--brand-slate);
    padding-left: 0.75rem;
    color: inherit;
}

/* ----------------------------------------------------------------
   Empty state comment area
   ---------------------------------------------------------------- */
.empty-state-comments {
    padding: 1.5rem 0;
}

/* ----------------------------------------------------------------
   Dark Mode — only custom elements; Bootstrap handles its own
   ---------------------------------------------------------------- */
[data-bs-theme="dark"] .site-header {
    background-color: var(--brand-navy-deep);
}

[data-bs-theme="dark"] .footer-bar {
    background-color: #3a5f70;
}

[data-bs-theme="dark"] .wod-banner {
    background-color: var(--brand-navy-deep);
}

[data-bs-theme="dark"] .card-post:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.4) !important;
}

[data-bs-theme="dark"] .related-heading {
    color: #9ca3af;
}

/* ----------------------------------------------------------------
   Post Card v2 — Editorial Lexicon
   Fonts: Fraunces (headwords) + DM Sans (chrome), loaded in base.html
   ---------------------------------------------------------------- */

.cpv2 {
  --cpv2-navy:   var(--brand-navy);
  --cpv2-slate:  var(--brand-slate);
  --cpv2-border: rgba(var(--brand-navy-rgb), 0.13);
  --cpv2-bg:     #faf9f7;
  --cpv2-ink:    #1c1c1e;
  --cpv2-muted:  #5c6878;

  background: var(--cpv2-bg);
  border: 1px solid var(--cpv2-border);
  border-left: 3px solid var(--cpv2-navy);
  border-radius: 0 6px 6px 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  margin-bottom: 0.7rem;
  padding: 1rem 1.2rem 0.85rem 1.1rem;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.18s ease, border-left-color 0.2s;
}

.cpv2:hover {
  border-left-color: var(--cpv2-slate);
  box-shadow: -2px 0 0 var(--cpv2-slate), 5px 8px 28px rgba(var(--brand-navy-rgb), 0.08);
  transform: translateX(4px);
}

[data-bs-theme="dark"] .cpv2 {
  --cpv2-border: rgba(111, 143, 162, 0.18);
  --cpv2-bg:     #0d1d28;
  --cpv2-ink:    #dde5ea;
  --cpv2-muted:  var(--brand-slate-muted);
  border-left-color: var(--brand-navy-edge);
}

[data-bs-theme="dark"] .cpv2:hover {
  box-shadow: -2px 0 0 var(--cpv2-slate), 5px 8px 28px rgba(0, 0, 0, 0.38);
  border-left-color: var(--cpv2-slate);
}

.cpv2__word {
  color: var(--cpv2-navy);
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-optical-sizing: auto;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  text-decoration: none;
}

.cpv2__word:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

[data-bs-theme="dark"] .cpv2__word {
  color: var(--brand-sky);
}

.cpv2__translation {
  color: var(--cpv2-muted);
  font-size: 0.9rem;
  font-weight: 400;
}

/* Native-script forms: keep the system font stack (not Fraunces) so the
   browser selects correct glyphs per script, guided by the lang attribute. */
.cpv2__native {
  color: var(--cpv2-slate);
  font-size: 1.05rem;
  font-weight: 500;
}

.native-script {
  color: var(--bs-secondary-color);
  font-size: 0.85em;
  margin-left: 0.25rem;
}

.cpv2__pron {
  color: var(--cpv2-slate);
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-size: 0.78rem;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1;
  margin-top: 4px;
}

.cpv2__lang {
  align-self: flex-start;
  border: 1px solid var(--cpv2-navy);
  border-radius: 2px;
  color: var(--cpv2-navy);
  flex-shrink: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 2px 8px 1px;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.13s, color 0.13s;
  white-space: nowrap;
}

.cpv2__lang:hover {
  background: var(--cpv2-navy);
  color: #fff;
}

[data-bs-theme="dark"] .cpv2__lang {
  border-color: var(--brand-navy-edge);
  color: var(--brand-sky);
}

[data-bs-theme="dark"] .cpv2__lang:hover {
  background: var(--brand-navy-edge);
  color: #fff;
}

.cpv2__desc {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--cpv2-ink);
  display: -webkit-box;
  font-size: 0.875rem;
  line-height: 1.58;
  margin: 0;
  overflow: hidden;
}

.cpv2__avatar {
  align-items: center;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  flex-shrink: 0;
  font-size: 0.6rem;
  font-weight: 700;
  height: 22px;
  justify-content: center;
  letter-spacing: 0;
  text-transform: uppercase;
  width: 22px;
}

.cpv2__meta {
  align-items: center;
  color: var(--cpv2-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.75rem;
  gap: 0;
  row-gap: 2px;
}

.cpv2__meta a {
  color: var(--cpv2-muted);
  font-weight: 500;
  text-decoration: none;
}

.cpv2__meta a:hover {
  color: var(--cpv2-navy);
}

[data-bs-theme="dark"] .cpv2__meta a:hover {
  color: var(--brand-sky);
}

.cpv2__dot {
  margin: 0 0.28rem;
  opacity: 0.35;
}

.cpv2__action {
  align-items: center;
  background: transparent;
  border: 1px solid rgba(111, 143, 162, 0.32);
  border-radius: 3px;
  color: var(--cpv2-muted);
  cursor: pointer;
  display: inline-flex;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  gap: 4px;
  line-height: 1.4;
  padding: 3px 9px;
  text-decoration: none;
  transition: background 0.13s, border-color 0.13s, color 0.13s;
}

.cpv2__action:hover {
  background: rgba(var(--brand-navy-rgb), 0.05);
  border-color: var(--cpv2-navy);
  color: var(--cpv2-navy);
}

.cpv2__action--active {
  background: var(--cpv2-navy);
  border-color: var(--cpv2-navy);
  color: #fff;
}

.cpv2__action.htmx-request {
  opacity: 0.45;
  pointer-events: none;
}

[data-bs-theme="dark"] .cpv2__action {
  border-color: rgba(111, 143, 162, 0.22);
  color: var(--cpv2-muted);
}

[data-bs-theme="dark"] .cpv2__action:hover {
  background: rgba(58, 106, 133, 0.12);
  border-color: var(--brand-navy-edge);
  color: var(--brand-sky);
}

[data-bs-theme="dark"] .cpv2__action--active {
  background: var(--brand-navy-mid);
  border-color: var(--brand-navy-mid);
  color: #fff;
}

.cpv2__like-static {
  align-items: center;
  color: var(--cpv2-muted);
  display: inline-flex;
  font-size: 0.72rem;
  gap: 3px;
}

.cpv2__tags {
  border-top: 1px solid var(--cpv2-border);
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 0.6rem;
  padding-top: 0.55rem;
}

.cpv2__tag {
  background: transparent;
  border: 1px solid rgba(111, 143, 162, 0.32);
  border-radius: 2px;
  color: var(--cpv2-slate);
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  text-decoration: none;
  transition: border-color 0.12s, color 0.12s;
}

.cpv2__tag:hover {
  border-color: var(--cpv2-slate);
  color: var(--cpv2-navy);
}

[data-bs-theme="dark"] .cpv2__tag {
  border-color: rgba(111, 143, 162, 0.2);
  color: var(--brand-slate-muted);
}

[data-bs-theme="dark"] .cpv2__tag:hover {
  border-color: var(--brand-navy-edge);
  color: var(--brand-sky);
}

/* ================================================================
   App shell — Editorial redesign (header, WoD bar, sidebar, feed)
   Semantic --ui-* tokens layered over the brand palette; dark theme
   via Bootstrap's [data-bs-theme="dark"] (same toggle as everything).
   ================================================================ */
:root {
    --ui-bg:        #eceae6;                          /* page background */
    --ui-surface:   #faf9f7;                          /* cards, header */
    --ui-surface-2: #ffffff;
    --ui-ink:       #1c1c1e;
    --ui-muted:     #5c6878;
    --ui-border:    rgba(var(--brand-navy-rgb), .13);
    --ui-border-2:  rgba(var(--brand-navy-rgb), .09);
    --ui-field:     #ffffff;
    --ui-shadow:    rgba(var(--brand-navy-rgb), .10);
    --ui-accent:       var(--brand-navy);             /* buttons, active */
    --ui-accent-hover: var(--brand-navy-hover);
    --ui-word:  var(--brand-navy);                    /* headwords */
    --ui-slate: var(--brand-slate);
    --ui-bar:   var(--brand-navy);                    /* WoD bar */
    --ui-pill:  var(--brand-slate);
}
[data-bs-theme="dark"] {
    --ui-bg:        #0a1722;
    --ui-surface:   #0d1d28;
    --ui-surface-2: #0b1922;
    --ui-ink:       #dde5ea;
    --ui-muted:     var(--brand-slate-muted);
    --ui-border:    rgba(111, 143, 162, .18);
    --ui-border-2:  rgba(111, 143, 162, .10);
    --ui-field:     #0a1722;
    --ui-shadow:    rgba(0, 0, 0, .38);
    --ui-accent:       var(--brand-navy-mid);
    --ui-accent-hover: var(--brand-navy-edge);
    --ui-word:  var(--brand-sky);
    --ui-slate: var(--brand-slate-muted);
    --ui-bar:   var(--brand-navy-deep);
    --ui-pill:  var(--brand-navy-mid);
}

/* Page canvas gets the warm background when the shell is in use. */
body.app-shell { background: var(--ui-bg); }

/* ---- Header ---------------------------------------------------- */
.app-header {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px;
    padding: 12px 26px;
    background: var(--ui-surface);
    border-bottom: 1px solid var(--ui-border);
}
.app-brand { display: flex; align-items: baseline; gap: 8px; flex-shrink: 0; text-decoration: none; }
.app-brand__name {
    font-family: 'Fraunces', Georgia, serif; font-weight: 600;
    font-size: 1.32rem; letter-spacing: -.02em; color: var(--ui-word);
}
.app-brand__tag {
    font-family: 'Fraunces', Georgia, serif; font-style: italic;
    font-weight: 300; font-size: .82rem; color: var(--ui-muted);
}
.app-search {
    flex: 1; min-width: 0; max-width: 440px; margin: 0 auto;
    display: flex; align-items: center; gap: 8px;
    background: var(--ui-field); border: 1px solid var(--ui-border);
    border-radius: 8px; padding: 8px 12px;
}
.app-search input {
    border: 0; outline: 0; background: transparent; width: 100%;
    font-family: inherit; font-size: .9rem; color: var(--ui-ink);
}
.app-search svg { flex-shrink: 0; color: var(--ui-muted); }
.app-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: auto; flex-wrap: wrap; }

.theme-toggle {
    cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
    background: transparent; border: 1px solid var(--ui-border); border-radius: 20px;
    color: var(--ui-muted); font-family: inherit; font-size: .78rem; font-weight: 500; padding: 6px 12px;
}
.theme-toggle:hover { color: var(--ui-word); border-color: var(--ui-slate); }

.btn-accent {
    cursor: pointer; display: inline-flex; align-items: center;
    background: var(--ui-accent); border: 1px solid var(--ui-accent); border-radius: 6px;
    color: #fff; font-family: inherit; font-size: .86rem; font-weight: 500;
    padding: 8px 15px; text-decoration: none; white-space: nowrap;
}
.btn-accent:hover { background: var(--ui-accent-hover); border-color: var(--ui-accent-hover); color: #fff; }

.app-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    color: #fff; font-size: .72rem; font-weight: 700; text-decoration: none;
}
.app-authlink { font-size: .86rem; font-weight: 500; color: var(--ui-muted); text-decoration: none; white-space: nowrap; }
.app-authlink:hover { color: var(--ui-word); }
/* Log out is a submit button (POST-only view) styled to match its neighbours. */
.app-logout { display: inline-flex; margin: 0; }
button.app-authlink { background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }
/* Mobile-only stand-in for the inline login form (see mobile header block). */
.app-authlink--login { display: none; }
.app-login { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.app-login input {
    background: var(--ui-field); border: 1px solid var(--ui-border); border-radius: 6px;
    color: var(--ui-ink); font-family: inherit; font-size: .82rem; padding: 6px 10px; max-width: 118px;
}

/* ---- Word of the Day bar --------------------------------------- */
.app-wod {
    display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
    padding: 10px 26px; background: var(--ui-bar); color: #fff;
}
.app-wod__label {
    background: var(--ui-pill); border-radius: 10px; color: #fff;
    font-size: .68rem; font-weight: 700; letter-spacing: .06em;
    padding: 3px 11px; text-transform: uppercase; white-space: nowrap;
}
.app-wod__word { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.12rem; }
.app-wod__trans { color: rgba(255, 255, 255, .82); font-size: .9rem; }
.app-wod__link { color: #cce8f4; font-weight: 600; }
.app-wod__link:hover { color: #fff; }
.app-wod__lang { color: rgba(255, 255, 255, .5); font-size: .85rem; margin-left: auto; }

/* ---- Shell (sidebar + main) ------------------------------------ */
.shell { display: flex; gap: 30px; max-width: 1200px; margin: 0 auto; padding: 28px 26px 64px; }
.shell__main { flex: 1; min-width: 0; }
.sidebar { width: 210px; flex-shrink: 0; }
.side-heading {
    font-size: .64rem; text-transform: uppercase; letter-spacing: .1em;
    color: var(--ui-muted); font-weight: 700; margin: 26px 0 11px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    border-radius: 7px; font-size: .9rem; font-weight: 500;
    color: var(--ui-muted); text-decoration: none;
}
.side-link:hover { color: var(--ui-word); background: var(--ui-surface); }
.side-link--active { color: var(--ui-word); background: var(--ui-surface); }
.side-link__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .28; }
.side-link--active .side-link__dot { opacity: 1; }
.lang-filter { display: flex; flex-direction: column; gap: 2px; }
.lang-chip {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px; border-radius: 6px; font-size: .85rem; font-weight: 400;
    color: var(--ui-ink); text-decoration: none;
}
.lang-chip:hover { color: var(--ui-word); background: var(--ui-surface); }
.lang-chip--active { font-weight: 700; color: var(--ui-word); background: var(--ui-surface); }
.lang-chip__count { font-size: .72rem; opacity: .7; }
.side-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Feed head + grid ------------------------------------------ */
.feed-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.feed-title { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.7rem; letter-spacing: -.02em; margin: 0 0 4px; color: var(--ui-word); }
.feed-sub { margin: 0; color: var(--ui-muted); font-size: .9rem; }
.sort-group { display: flex; gap: 6px; flex-wrap: wrap; }
.sort-btn {
    cursor: pointer; font-family: inherit; font-size: .8rem; font-weight: 500;
    padding: 7px 13px; border-radius: 6px; text-decoration: none;
    border: 1px solid var(--ui-border); background: transparent; color: var(--ui-muted);
}
.sort-btn:hover { color: var(--ui-word); border-color: var(--ui-slate); }
.sort-btn--active { background: var(--ui-accent); border-color: var(--ui-accent); color: #fff; }
.sort-btn--active:hover { color: #fff; }

.feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.feed-grid .cpv2 { margin-bottom: 0; }
.feed-grid__empty { grid-column: 1 / -1; }

@media (max-width: 880px) {
    .sidebar { display: none; }
    .shell { padding-left: 18px; padding-right: 18px; }
}
/* Mobile header. The desktop layout keeps the brand and the actions cluster
   rigid (flex-shrink: 0) so they hold their shape on wide screens — but that
   makes them overflow narrow phones (the actions cluster, right-aligned by
   margin-left:auto, pushes "Register" off the right edge). Below 620px we
   let both shrink and wrap, drop the tagline, and collapse the inline login
   form to a single link (.app-authlink--login → the login page). */
@media (max-width: 620px) {
    .app-search { display: none; }
    .app-header { padding: 10px 16px; gap: 10px 12px; }
    .app-brand { min-width: 0; flex-shrink: 1; }
    .app-brand__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .app-brand__tag { display: none; }
    .app-actions { flex-shrink: 1; flex-wrap: wrap; justify-content: flex-end; gap: 8px 10px; }
    .app-login { display: none; }
    .app-authlink--login { display: inline-flex; }
}

/* ---- Primary nav row (global) ---------------------------------- */
.app-nav {
    display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
    padding: 4px 22px 8px; background: var(--ui-surface);
    border-bottom: 1px solid var(--ui-border);
}
.app-nav__link {
    padding: 6px 12px; border-radius: 7px; font-size: .86rem; font-weight: 500;
    color: var(--ui-muted); text-decoration: none; white-space: nowrap;
}
.app-nav__link:hover { color: var(--ui-word); background: var(--ui-bg); }
.app-nav__link--active { color: var(--ui-word); background: var(--ui-bg); }
.app-nav__badge {
    display: inline-block; margin-left: 5px; background: #dc3545; color: #fff;
    font-size: .62rem; font-weight: 700; border-radius: 9px; padding: 1px 6px;
}
