/* SendForm "Airmail" typography — Space Grotesk (display), Hanken Grotesk (body),
   JetBrains Mono (code). Loaded via the sf_identity_fonts_css registry entry. */

/* ============================================================
   SENDFORM "AIRMAIL" IDENTITY — project token + brand layer
   Warm amber accent + warm-neutral surfaces, full light/dark.
   Defines the design's token vocabulary AND re-points the
   startup base theme tokens so shared chrome (navbar, footer,
   theme switcher) inherits the identity. Hooks into base
   body.theme-dark / body.theme-light. Loaded globally via the
   asset registry (sf_identity_css). The shared base
   (startup_cms/base_*.css) is NOT modified.
   ============================================================ */

:root {
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* airmail design radii (softer than base) */
  --sf-r-sm: 8px;
  --sf-r-md: 14px;
  --sf-r-lg: 22px;
  --sf-r-xl: 30px;

  /* aliases consumed by the ported 1:1 landing + dashboard CSS */
  --maxw: 1180px;
  --r-sm: var(--sf-r-sm);
  --r-md: var(--sf-r-md);
  --r-lg: var(--sf-r-lg);
  --r-xl: var(--sf-r-xl);
  --font-pixel: var(--font-display);

  --airmail-red: #c8553d;
  --airmail-blue: #3e6ca8;
  /* success/active green — used by toggles and "active" states */
  --sf-green: #46a96a;
}

/* ---------- Dark theme tokens ---------- */
body.theme-dark {
  /* airmail vocabulary */
  --bg: #0e0d0b;
  --bg-grad: #15120d;
  --surface: #19150f;
  --surface-2: #221d15;
  --surface-3: #2a241a;
  --border: #2c2619;
  --border-2: #3a3322;
  --text: #f6f1e7;
  --text-muted: #ada38f;
  --text-faint: #6e6657;
  --accent: #e89b47;
  --accent-ink: #f4b061;
  --accent-soft: color-mix(in oklab, var(--accent) 16%, transparent);
  --accent-line: color-mix(in oklab, var(--accent) 38%, transparent);
  --code-bg: #100d08;
  --sf-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --sf-shadow-sm:
    0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow: var(--sf-shadow);
  --shadow-sm: var(--sf-shadow-sm);
  --grid-line: rgba(255, 255, 255, 0.035);

  /* re-point startup base tokens */
  --bg-gradient: var(--bg);
  --text-color: var(--text);
  --muted-text: var(--text-muted);
  --heading-color: var(--text);
  --container-bg: var(--surface);
  --border-color: var(--border);
  --card-bg: var(--surface);
  --input-bg: var(--surface-2);
  --link: var(--accent-ink);
  --link-hover: var(--accent);
  --primary-blue: var(--accent);
  --primary-blue-hover: color-mix(in oklab, var(--accent) 86%, #fff 14%);
  --primary-color: var(--accent);
  /* base components (e.g. navbar user-panel avatar) read --accent-color; map it
     to the brand accent so it isn't the base purple (#6366f1) fallback. */
  --accent-color: var(--accent);
  --shadow-elev: var(--sf-shadow);
  --navbar-gradient: linear-gradient(
    135deg,
    #f0a94e 0%,
    #ce7c2b 55%,
    #9e5e1e 100%
  );
  --navbar-underline: linear-gradient(90deg, var(--accent-ink), var(--accent));
  --btn-gradient: var(--accent);
  --btn-gradient-hover: color-mix(in oklab, var(--accent) 86%, #fff 14%);
  --collapse-accent-rgb: 232, 155, 71;
  --info-item-bg: rgba(232, 155, 71, 0.08);
  --primary-shadow: rgba(232, 155, 71, 0.25);
  --button-disabled-bg: rgba(232, 155, 71, 0.07);
  --button-disabled-border: rgba(232, 155, 71, 0.15);
  /* base footer surfaces → airmail (distinct panel, lighter than body bg) */
  --footer-section-bg: #221d15;
  --footer-bottom-bg: #1b1610;
  --footer-nav-bg: #2a241a;
  --footer-border: #3a3322;
}

/* ---------- Light theme tokens ---------- */
body.theme-light {
  --bg: #faf6ee;
  --bg-grad: #f3ecdd;
  --surface: #fffdf8;
  --surface-2: #f5efe2;
  --surface-3: #ede5d4;
  --border: #e7decc;
  --border-2: #d8ccb4;
  --text: #211c14;
  --text-muted: #6e6555;
  --text-faint: #9a9080;
  --accent: #e89b47;
  --accent-ink: #a9651a;
  --accent-soft: color-mix(in oklab, var(--accent) 18%, transparent);
  --accent-line: color-mix(in oklab, var(--accent) 55%, transparent);
  --code-bg: #211c14;
  --sf-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 24px 50px -26px rgba(60, 45, 20, 0.28);
  --sf-shadow-sm:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 10px 26px -16px rgba(60, 45, 20, 0.22);
  --shadow: var(--sf-shadow);
  --shadow-sm: var(--sf-shadow-sm);
  --grid-line: rgba(40, 30, 10, 0.05);

  --bg-gradient: var(--bg-grad);
  --text-color: var(--text);
  --muted-text: var(--text-muted);
  --heading-color: var(--text);
  --container-bg: var(--surface);
  --border-color: var(--border);
  --card-bg: var(--surface);
  --input-bg: var(--surface);
  --link: var(--accent-ink);
  --link-hover: var(--accent);
  --primary-blue: var(--accent);
  --primary-blue-hover: color-mix(in oklab, var(--accent) 86%, #000 14%);
  --primary-color: var(--accent);
  --accent-color: var(--accent);
  --shadow-elev: var(--sf-shadow);
  --navbar-gradient: linear-gradient(
    135deg,
    #f0a94e 0%,
    #ce7c2b 55%,
    #9e5e1e 100%
  );
  --navbar-underline: linear-gradient(90deg, var(--accent-ink), var(--accent));
  --btn-gradient: var(--accent);
  --btn-gradient-hover: color-mix(in oklab, var(--accent) 86%, #000 14%);
  --collapse-accent-rgb: 232, 155, 71;
  --info-item-bg: rgba(232, 155, 71, 0.08);
  --primary-shadow: rgba(232, 155, 71, 0.25);
  --button-disabled-bg: rgba(232, 155, 71, 0.07);
  --button-disabled-border: rgba(232, 155, 71, 0.15);
  /* base footer surfaces → airmail (distinct panel, deeper than body bg) */
  --footer-section-bg: #f1e7d6;
  --footer-bottom-bg: #ece1ce;
  --footer-nav-bg: #f6f0e3;
  --footer-border: #e0d5be;
}

/* ---------- Kill the startup page background texture ----------
   base_style.css paints assets/img/contour-pattern-bg.svg as a fixed
   full-page overlay via body.theme-*::before. The airmail design has no
   such circuit texture (only a faint grid inside the hero), so neutralize
   it site-wide. Same selector/specificity as base; sf-identity loads after
   base_style so this wins. */
body.theme-dark::before,
body.theme-light::before {
  background: none !important;
  filter: none !important;
  opacity: 0 !important;
  content: none !important;
}

/* ---------- Feedback page (.bugs-app) accent → amber ----------
   The bugs app declares its own --accent token that shadows the airmail one,
   so our global .btn-primary rule (background: var(--accent)) would otherwise
   resolve to the app's black accent. Pin it to amber here in the always-loaded
   identity layer so the feedback primary buttons + active tab are amber. */
body.theme-light .bugs-app,
body.theme-dark .bugs-app,
body.theme-light .bugs-app[data-theme='light'],
body.theme-dark .bugs-app[data-theme='dark'] {
  --accent: #e89b47;
  --accent-fg: #1c1407;
}
/* Direct, token-independent override: make the feedback primary button the
   real brand primary (amber + inset highlight + glow + hover lift), not a
   flat fill. Higher specificity (body .bugs-app .x) + amber literal beats
   web_bugs.css and any --accent resolution. */
body .bugs-app .btn-primary,
body .bugs-app .btn.btn-primary {
  background: #e89b47 !important;
  background-image: none !important;
  color: #1c1407 !important;
  border: 1px solid color-mix(in oklab, #e89b47 70%, #000 14%) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.32) inset,
    0 10px 24px -12px #e89b47 !important;
  transition:
    transform 0.14s ease,
    box-shadow 0.2s ease,
    background 0.2s ease !important;
}
body .bugs-app .btn-primary:hover,
body .bugs-app .btn.btn-primary:hover {
  background: color-mix(in oklab, #e89b47 88%, #fff 12%) !important;
  color: #1c1407 !important;
  opacity: 1 !important;
  transform: translateY(-1px) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 16px 32px -12px #e89b47 !important;
}
/* active filter tab: amber fill only (no lift) */
body .bugs-app .filter-btn.active {
  background: #e89b47 !important;
  color: #1c1407 !important;
  border-color: #e89b47 !important;
}

/* feedback secondary buttons = design ghost (transparent, outlined,
   fills --surface-2 on hover). Excludes the primary button. */
body .bugs-app .btn:not(.btn-primary) {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid var(--border-2) !important;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease !important;
}
body .bugs-app .btn:not(.btn-primary):hover {
  background: var(--surface-2) !important;
  border-color: var(--text-faint) !important;
  color: var(--text) !important;
  opacity: 1 !important;
}

/* ---------- Base dropdown component → airmail accent ----------
   base_dropdown.css intentionally uses no brand colour: the selected option is
   marked with a near-black `--text-color` left bar + tint + icon. Re-point just
   those selected-state colours to the amber brand so the component fits
   SendForm (everything else — sizing, layout — stays the base default). */
.custom-dropdown-option.selected:not(.disabled) {
  background: var(--accent-soft) !important;
  color: var(--accent-ink) !important;
}
.custom-dropdown-option.selected:not(.disabled)::before {
  background: var(--accent) !important;
}
.custom-dropdown-option.selected.focused:not(.disabled) {
  background: color-mix(in oklab, var(--accent) 18%, transparent) !important;
}
.custom-dropdown-option.selected .custom-dropdown-option-icon {
  color: var(--accent-ink) !important;
}

/* ---------- Global typography ---------- */
body {
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
code,
pre,
kbd,
.mono {
  font-family: var(--font-mono);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
   Buttons → airmail design system (project-wide).
   The base (base_elements.css) gives a neutral .button/.btn
   (container-bg + border) secondary and a purple-gradient
   .button-primary. Re-skin BOTH to the design: flat-amber
   primary + transparent-outline secondary. Matching selectors
   + !important beat the base. Secondary comes first so the
   primary block (same specificity) wins on .button.button-primary.
   ============================================================ */

/* ---- Secondary / default button → design "ghost"
   (transparent by default, fills --surface-2 on hover) ---- */
.button,
.btn,
input[type='submit'],
input[type='reset'],
input[type='button'] {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid var(--border-2) !important;
  border-radius: var(--r-md) !important;
  font-weight: 600;
}
.button:hover,
.btn:hover,
input[type='submit']:hover,
input[type='reset']:hover,
input[type='button']:hover {
  background: var(--surface-2) !important;
  border-color: var(--text-faint) !important;
  color: var(--text) !important;
}

/* ---- Primary button → design flat amber ---- */
.button-primary,
.btn-primary,
body.theme-light .button-primary,
body.theme-light .btn-primary,
body.theme-dark .button-primary,
body.theme-dark .btn-primary {
  background: var(--accent) !important;
  color: #1c1407 !important;
  border: 1px solid color-mix(in oklab, var(--accent) 70%, #000 14%) !important;
  border-radius: var(--r-md) !important;
  font-weight: 600 !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.32) inset,
    0 10px 24px -12px var(--accent) !important;
}
.button-primary:hover,
.btn-primary:hover,
body.theme-light .button-primary:hover,
body.theme-light .btn-primary:hover,
body.theme-dark .button-primary:hover,
body.theme-dark .btn-primary:hover {
  background: color-mix(in oklab, var(--accent) 88%, #fff 12%) !important;
  color: #1c1407 !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 14px 30px -12px var(--accent) !important;
}
.button-primary:active,
.btn-primary:active,
body.theme-dark .button-primary:active,
body.theme-dark .btn-primary:active {
  background: color-mix(in oklab, var(--accent) 82%, #000 18%) !important;
  color: #1c1407 !important;
  transform: translateY(1px);
}
/* base forces primary icons white; match the dark amber-button ink */
.button-primary i,
.button-primary .fas,
.button-primary .fab,
.button-primary .far,
.btn-primary i,
.btn-primary .fas,
.btn-primary .fab,
.btn-primary .far {
  color: #1c1407 !important;
}

/* Base navbar dropdown chevron hardcodes indigo; match link text. */
.navbar a .fa-chevron-down,
.dropdown:hover > a .fa-chevron-down,
.navbar a:hover .fa-chevron-down {
  color: currentColor !important;
}

/* ---------- Hero brand title gradient → amber ----------
   Base .base-hero-title-brand hardcodes a purple text gradient. */
.base-hero-title-brand,
body.theme-light .base-hero-title-brand,
body.theme-dark .base-hero-title-brand {
  background: linear-gradient(
    120deg,
    #f4b061 0%,
    #e89b47 50%,
    #ce7c2b 100%
  ) !important;
  -webkit-background-clip: text;
  background-clip: text;
}

/* ---------- Brand: paper-plane mark + "sendform" wordmark ---------- */
/* base's .nb-brand__badge/.nb-brand__img now natively render the mark as an
   <img> in a tile, so the old background-image plane-icon hack is gone.
   The "SendForm" custom font/letter-spacing lives on the bare
   `.footer-brand-name` selector below (see base's brand.jinja2: the navbar
   wordmark span carries `footer-brand-name` on purpose so it picks up the
   same display font as the footer). The ".net" suffix keeps its own
   accent-ink tint here since that's a shade brighter than the
   --primary-blue base uses for `.brand-tld` by default. */
.nb-brand__text .brand-tld {
  color: var(--accent-ink) !important;
}

/* ============================================================
   Base navbar → airmail "design" look (overrides only).
   The startup base navbar is a dark amber gradient bar with a
   contour texture and white text. The design's nav is a clean,
   light, minimal sticky bar with dark text. We keep the base
   structure + wiring and only restyle appearance. base uses
   color:#fff !important across links/logo/icons, so we match
   with !important.
   ============================================================ */
.navbar {
  background: color-mix(in oklab, var(--surface) 86%, transparent) !important;
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
  box-shadow: none !important;
}
/* drop the contour texture + amber underline pseudo-elements */
.navbar::before {
  display: none !important;
}
.navbar::after {
  display: none !important;
}

/* dark text on the light bar */
.navbar a,
.navbar a:hover,
.navbar a:active,
.nb-brand,
.nb-brand:hover {
  color: var(--text) !important;
}
.navbar a .fas,
.navbar a .fab,
.navbar a .far,
.navbar a i,
.navbar a svg {
  color: currentColor !important;
}

/* primary nav links: muted, pill hover (design look).
   Exclude the CTA so its amber fill/hover isn't overridden by these
   higher-specificity center-link rules. */
.navbar .navbar-section--center a:not(.navbar-cta) {
  color: var(--text-muted) !important;
  font-weight: 500;
  border-radius: 8px;
}
.navbar .navbar-section--center a:not(.navbar-cta):hover {
  color: var(--text) !important;
  background: var(--surface-2) !important;
}

/* space the right-side controls apart (base sets gap:0) */
.navbar .navbar-section--right {
  gap: 10px !important;
  align-items: center;
}

/* right-side controls (theme switcher, language, gear, sign-in) */
.navbar-theme-switcher,
.navbar .icon-btn,
.navbar-section--right a,
.navbar-section--right button {
  color: var(--text) !important;
}

/* theme toggle → design icon-button (outlined square, surface bg) */
.navbar .theme-toggle-button,
body.theme-light .navbar .theme-toggle-button,
body.theme-dark .navbar .theme-toggle-button {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  border-radius: 10px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border-2) !important;
  color: var(--text-muted) !important;
}
.navbar .theme-toggle-button:hover,
body.theme-light .navbar .theme-toggle-button:hover,
body.theme-dark .navbar .theme-toggle-button:hover {
  background: var(--surface-2) !important;
  border-color: var(--text-faint) !important;
  color: var(--text) !important;
}
.navbar .theme-toggle-button .theme-icon {
  color: inherit !important;
  width: 18px;
  height: 18px;
  display: block;
}
/* dark → show moon (switch to light); light → show sun */
.navbar .theme-toggle-button .ti-sun {
  display: none;
}
body.theme-light .navbar .theme-toggle-button .ti-sun {
  display: block;
}
body.theme-light .navbar .theme-toggle-button .ti-moon {
  display: none;
}

/* "Sign in" → primary amber button (design .btn-primary.btn-sm). */
.navbar .navbar-action--ghost {
  display: inline-flex !important;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 16px !important;
  border: 1px solid color-mix(in oklab, var(--accent) 70%, #000 14%) !important;
  background: var(--accent) !important;
  color: #1c1407 !important;
  border-radius: var(--r-md) !important;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.32) inset,
    0 10px 24px -12px var(--accent);
}
.navbar .navbar-action--ghost:hover {
  background: color-mix(in oklab, var(--accent) 88%, #fff 12%) !important;
  color: #1c1407 !important;
}
.navbar .navbar-action--ghost i {
  color: inherit !important;
}

/* language switcher trigger → minimal, consistent with the cluster */
.navbar .language-changer-button,
.navbar .language-selector-toggle,
.navbar-section--right .dropdown > a {
  color: var(--text) !important;
}

/* push the CTA's list item to the right edge of the center group so it sits
   next to the sign-in / theme controls (design places it on the right) */
.navbar .navbar-section--center > li:has(> a.navbar-cta) {
  margin-left: auto;
}
/* primary CTA ("Get started free") = the design's .btn-primary.btn-sm,
   including the mono ">_" chev, so it matches the hero CTA exactly. */
.navbar .navbar-cta {
  display: inline-flex !important;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 15px !important;
  background: var(--accent) !important;
  color: #1c1407 !important;
  font-weight: 600;
  font-size: 13.5px;
  border-radius: var(--r-md) !important;
  border: 1px solid color-mix(in oklab, var(--accent) 70%, #000 14%) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.32) inset,
    0 10px 24px -12px var(--accent);
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease;
}
.navbar .navbar-cta::before {
  content: '>_';
  font-family: var(--font-mono);
  font-weight: 700;
  opacity: 0.7;
}
.navbar .navbar-cta:hover {
  background: color-mix(in oklab, var(--accent) 88%, #fff 12%) !important;
  color: #1c1407 !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 14px 30px -12px var(--accent);
}
.navbar .navbar-cta span {
  color: inherit !important;
}

/* ============================================================
   Mobile navbar (hamburger) → airmail.
   The base navbar already collapses into a hamburger < 750px and
   base_navbar.js wires the toggle. But the base is built for a DARK
   bar: the hamburger bars are #fff (invisible on our light bar) and
   the open menu uses a red/purple gradient. Re-skin both for amber.
   ============================================================ */
@media (max-width: 750px) {
  /* pull the logo + hamburger off the screen edges (base uses only 10px of
     side padding) so they sit a little more toward the middle. */
  .navbar .navbar-wrapper {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  /* hamburger icon + its three bars → dark, visible on the light bar.
     Box it like the dashboard top-bar ☰ button (.icon-btn): surface card,
     1px brand border, rounded square. */
  .navbar .nav-toggle {
    right: 20px !important;
    color: var(--text) !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    background: var(--surface) !important;
    border: 1px solid var(--border-2) !important;
    border-radius: 10px !important;
    box-shadow: none !important;
  }
  /* the base positions its 3 bars (26px wide, top 12/19/26) for a 44px box;
     in our smaller 34px box those sit low and wide → looks broken. Re-center
     and narrow the bars so they read as a tidy ☰ inside the box. */
  .navbar .nav-toggle span {
    background-color: var(--text) !important;
    width: 16px !important;
  }
  .navbar .nav-toggle span:nth-child(1) {
    top: 11px !important;
  }
  .navbar .nav-toggle span:nth-child(2) {
    top: 16px !important;
  }
  .navbar .nav-toggle span:nth-child(3) {
    top: 21px !important;
  }
  /* keep the open-state X centered on the same midline */
  .navbar .nav-toggle[aria-expanded='true'] span:nth-child(1),
  .navbar .nav-toggle[aria-expanded='true'] span:nth-child(3) {
    top: 16px !important;
  }

  /* collapsed menu panel → clean airmail surface card (drop base gradient) */
  .navbar .navbar-nav {
    background: var(--surface) !important;
    border-top: 1px solid var(--border) !important;
    box-shadow: var(--sf-shadow) !important;
  }
  /* menu links readable on the surface; warm pill hover */
  .navbar .navbar-nav a,
  .navbar .navbar-nav .userpanel-nav-toggle,
  .navbar .navbar-section--center a:not(.navbar-cta) {
    color: var(--text) !important;
  }
  .navbar .navbar-nav a:not(.navbar-cta):not(.navbar-action--ghost):hover {
    background: var(--surface-2) !important;
    color: var(--text) !important;
  }
  /* divider between the center + right groups → brand border */
  .navbar .navbar-section--right {
    border-top-color: var(--border) !important;
  }
  /* base already keeps `.nb-brand` visible on mobile on its own (the old
     `.navbar-section--left { display: flex }` forcing rule is dead weight
     from the pre-unification navbar and has been dropped), just sized down
     to match the dashboard top-bar logo (26px mark + 18px wordmark). */
  .nb-brand__badge {
    width: 30px;
    height: 30px;
  }
  .nb-brand__img {
    width: 22px;
    height: 22px;
  }
  .nb-brand__text {
    font-size: 18px !important;
  }
  .nb-brand__text .brand-tld {
    font-size: 11px;
  } /* like the dashboard tld */
  /* full-width CTA / sign-in inside the menu so they don't look cramped */
  .navbar .navbar-nav .navbar-cta,
  .navbar .navbar-nav .navbar-action--ghost {
    justify-content: center;
    width: calc(100% - 32px);
    margin: 6px 16px;
  }
  /* the base renders BOTH the inline icon theme switcher and the labelled
     "Toggle theme" mobile switcher — hide the redundant inline one here. */
  .navbar .navbar-nav .navbar-theme-switcher {
    display: none !important;
  }
  /* the user-panel trigger is icon-only (its "User Panel" label is sr-only),
     which looks like a blank row in the flattened mobile menu — un-hide the
     label so it reads as a proper "User Panel" item next to the icon. */
  .navbar .navbar-nav .userpanel-nav-toggle .sr-only {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
    white-space: normal !important;
  }
  /* an OPEN dropdown row (e.g. expanded "EN") gets a base purple gradient +
     a 3px --primary-blue (amber here) left bar — that's the "weird orange
     thing". Replace with a flat warm surface highlight, no left border. */
  .navbar .navbar-nav .dropdown.open > a,
  .navbar .navbar-nav .mega-menu.open > a {
    background: var(--surface-2) !important;
    border-inline-start: 0 !important;
    padding-inline-start: 20px !important;
  }
  /* the desktop dropdown re-skin below styles .dropdown-content as a floating
     CARD (surface bg, border, radius, shadow, padding). In the flattened mobile
     menu that reads as a nested boxed container — strip it so the submenu is a
     clean flat list (the base already lays it out full-width). */
  .navbar .navbar-nav .dropdown-content,
  .navbar .navbar-nav .mega-menu-content {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .navbar .navbar-nav .dropdown-content a,
  .navbar .navbar-nav .mega-menu-standalone-item,
  .navbar .navbar-nav .mega-menu-category-item {
    border-radius: 0 !important;
    background: transparent !important;
  }
  .navbar .navbar-nav .dropdown-content a:not(:last-child) {
    border-bottom: 1px solid var(--border) !important;
  }
  .navbar .navbar-nav .dropdown-content a:hover {
    background: var(--surface-2) !important;
  }
}

/* ---------- Navbar dropdown / mega-menu → airmail amber ----------
   Base navbar dropdowns (e.g. the Feedback menu) use hardcoded indigo
   (rgba(99,102,241,…)) + pink panel gradients. Re-skin to amber + the
   airmail surface so menus match the design. */
.navbar .dropdown-content,
.navbar .mega-menu-content {
  background: var(--surface) !important;
  border: 1px solid var(--border-2) !important;
}
/* mega-menu items (icon + text rows) — no left accent bar / wash; just a
   smooth amber-soft fill that animates in on hover. */
.mega-menu-category-item::before,
.mega-menu-category-item::after {
  display: none !important;
}
.mega-menu-category-item {
  transition:
    background 0.18s ease,
    color 0.18s ease !important;
}
.mega-menu-category-item:hover,
body.theme-light .mega-menu-category-item:hover,
body.theme-dark .mega-menu-category-item:hover {
  background: var(--accent-soft) !important;
  box-shadow: none !important;
  transform: none !important;
}
.mega-menu-category-item,
.mega-menu-category-item .mega-menu-item-text,
.mega-menu-category-item .dropdown-icon {
  color: var(--text) !important;
}
/* simple (non-mega) dropdown links */
.dropdown-content a::before,
.dropdown-content a::after {
  display: none !important;
}
.dropdown-content a {
  transition:
    background 0.18s ease,
    color 0.18s ease !important;
}
.dropdown-content a:hover {
  background: var(--accent-soft) !important;
  box-shadow: none !important;
  transform: none !important;
}

/* language switcher options — smooth amber hover (was jumping because base
   animated `transform`/`all`; here we fade only the colors and pin transform). */
.navbar .language-dropdown-content .language-option {
  border-radius: 8px;
  transform: none !important;
  transition:
    background-color 0.2s ease,
    color 0.2s ease !important;
}
.navbar .language-dropdown-content .language-option:hover,
.navbar .language-dropdown-content .language-option.active {
  background-color: var(--accent-soft) !important;
  color: var(--accent-ink) !important;
  transform: none !important;
}
.navbar .language-dropdown-content .language-option:hover .language-name,
.navbar .language-dropdown-content .language-option.active .language-name {
  color: var(--accent-ink) !important;
}

/* dashboard sidebar brand + footer brand use the display font */
.base-sidebar__title-name {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}
.base-sidebar__title-subtext {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Base footer → airmail look (overrides only) ----------
   We use the startup base footer (web/layout/footer.jinja2 → .footer)
   and only restyle it. The footer tokens are re-pointed per-theme above
   (--footer-section-bg / --footer-bottom-bg / --footer-border /
   --footer-nav-bg). These rules add the airmail fonts + amber accents. */
.footer-nav-title {
  color: var(--text-faint);
  font-weight: 600;
}
.footer-brand-name {
  font-family: var(--font-display) !important;
  letter-spacing: -0.03em;
  color: var(--text) !important;
}
.footer-brand-tagline {
  color: var(--text-muted);
}
.footer-nav-links a {
  color: var(--text-muted);
}
.footer-nav-links a:hover {
  color: var(--text);
}
.footer-nav-link-title--highlight {
  color: var(--accent-ink);
}
.footer-stars {
  color: var(--accent);
}
.footer-rating-link:hover {
  color: var(--accent-ink);
}
.footer-social:hover {
  color: var(--text);
  border-color: var(--text-faint);
}
.footer-red-heart {
  color: var(--airmail-red);
}
.footer-credit-inline a {
  color: var(--accent-ink);
}

/* ============================================================
   Navbar dropdown component → airmail design panel.
   The base navbar dropdown / user-panel mega-menu is already
   re-skinned to amber surfaces above; this rounds the panel,
   adds the warm shadow + comfortable padding and rounds the
   item rows so it reads as a clean floating card (the design).
   ============================================================ */
.navbar .dropdown-content,
.navbar .mega-menu-content,
.navbar .userpanel-nav-panel {
  border-radius: var(--r-md) !important;
  box-shadow: var(--sf-shadow) !important;
  padding: 8px !important;
  margin-top: 10px !important;
}
.navbar .dropdown-content a,
.navbar .mega-menu-standalone-item,
.navbar .mega-menu-category-item {
  border-radius: var(--r-sm) !important;
}
/* user-panel dropdown: separate the identity header from the items */
.navbar .userpanel-nav-user-info {
  border-bottom: 1px solid var(--border) !important;
  margin-bottom: 6px;
  padding: 6px 8px 12px;
}
.navbar .userpanel-nav-user-avatar img {
  border-radius: 9px;
}
.navbar .userpanel-nav-item-logout {
  border-top: 1px solid var(--border) !important;
  margin-top: 6px;
  padding-top: 10px;
  color: var(--airmail-red) !important;
}
.navbar .userpanel-nav-item-logout .dropdown-icon {
  color: var(--airmail-red) !important;
}
