/* Visually hidden but announced by screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Block-level text that carries dir="auto" (so Hebrew and English render
   correctly) but should line up with its column/container, i.e. with the UI
   direction rather than its own. Without this a Hebrew cell in an English
   table (or vice versa) flips to the other edge and rows look ragged.
   :dir() on the parent resolves to the inherited UI direction. */
:dir(ltr) > .u-align-ui {
  text-align: left;
}

:dir(rtl) > .u-align-ui {
  text-align: right;
}

/* Full-page loading screen (used as Suspense fallback in App) */
.page-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Generic basic text style for all app */
.text-basic {
  color: var(--text-primary);
  text-align: center;
  margin-top: 40px;
}

/* ─── Design Tokens (CSS Variables) ─────────────────────────────────────────── */
:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: light dark;

  /* ── Layout ── */
  --nav-width-collapsed: 64px;
  --nav-width-expanded: 200px;

  /* ── Scale tokens (theme-independent) ──
     One spacing scale, three radii, three control heights and two icon sizes.
     New or touched UI should use these instead of one-off values so buttons,
     inputs and cells line up across screens. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --radius-sm: 6px;   /* chips, small icon buttons */
  --radius-md: 8px;   /* buttons, inputs, nav items */
  --radius-lg: 12px;  /* cards, panels, tables, modals */
  --radius-pill: 999px;

  --control-h-sm: 32px;  /* compact buttons in toolbars and tables */
  --control-h: 40px;     /* default button / input height */
  --control-h-lg: 44px;  /* primary touch targets (sidebar, mobile) */

  --icon-sm: 16px;
  --icon-md: 18px;

  --font-xs: 0.75rem;     /* 12px - the floor */
  --font-sm: 0.8125rem;   /* 13px */
  --font-md: 0.875rem;    /* 14px - table and form body */
  --font-base: 1rem;

  --transition-fast: 0.15s ease;

  /* ── Light theme (default) ── */
  --bg-base: #f8f9fa;
  --bg-surface: #fff;
  --bg-surface-alt: #f8f9fa;
  --bg-surface-hover: #e9ecef;
  --bg-input: #fff;

  --text-primary: #2c3e50;
  --text-secondary: #5a6c7d;
  --text-muted: #64748b; /* was #95a5a6 - 2.6:1 on white; now 4.7:1 */
  --text-body: #333;
  --text-link: #666;

  --border-color: #ecf0f1;
  --border-input: #868e96;
  --border-subtle: #e9ecef;

  --accent-blue: #1a73ba;
  --accent-indigo: #6366f1;
  --accent-teal: #1abc9c;
  --accent-purple: #9b59b6;
  --accent-amber: #c6720c;
  --login-bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --login-bg-gradient-dark: linear-gradient(135deg, #1e1b4b 0%, #2d1b4e 100%);
  --accent-blue-hover: #1a5fa0;
  --accent-blue-btn: #2563eb;
  --accent-blue-btn-hover: #1d4ed8;
  --accent-blue-link: #2563eb;
  --accent-blue-link-hover: #1d4ed8;
  --accent-green: #27ae60;
  --accent-green-hover: #219a52;
  --accent-red: #e74c3c;
  --accent-red-hover: #c0392b;
  --accent-orange: #e67e22;
  --accent-yellow-bg: #fff3cd;
  --accent-yellow-text: #856404;
  --accent-yellow-border: #ffeaa7;

  --bg-accent-subtle: #e8f4fd;

  /* ── Score colors (used by match tables) ── */
  --score-high: #2d7a31;
  --score-medium: #ff8c00;
  --score-low: #dc3545;
  --score-none: #666;
  --score-high-bg: #2d7a3120;
  --score-medium-bg: #ff8c0020;
  --score-low-bg: #dc354520;
  --score-none-bg: #66666620;

  /* ── Status badge colors (success / info / warning / danger) ── */
  --status-success-bg: #d4edda;
  --status-success-text: #155724;
  --status-info-bg: #cce5ff;
  --status-info-text: #004085;
  --status-warning-bg: #fff3cd;
  --status-warning-text: #856404;
  --status-danger-bg: #f8d7da;
  --status-danger-text: #721c24;

  --shadow-sm: rgba(0, 0, 0, 0.1);
  --shadow-md: rgba(0, 0, 0, 0.15);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --overlay-bg: rgba(0, 0, 0, 0.75);
  --overlay-bg-light: rgba(0, 0, 0, 0.5);
  --focus-ring: rgba(52, 152, 219, 0.1);
  --focus-ring-md: rgba(52, 152, 219, 0.15);
  --accent-red-bg: rgba(220, 53, 69, 0.08);
  --accent-red-border: rgba(220, 53, 69, 0.2);
  --accent-green-bg: rgba(52, 211, 153, 0.08);
  --accent-green-border: rgba(52, 211, 153, 0.2);
  --status-sent-bg: #d1ecf1;
  --status-sent-text: #0c5460;
  --btn-neutral-bg: #6c757d;
  --btn-neutral-bg-hover: #5a6268;

  /* ── Action / semantic colors ── */
  --accent-green-btn: #16a34a;
  --accent-green-btn-hover: #15803d;
  --accent-olive: #6b7c32;
  --accent-olive-bg: rgba(107, 124, 50, 0.06);
  --tooltip-bg: #333;
  --gradient-success: linear-gradient(135deg, #059669, #10b981);
  --gradient-error: linear-gradient(135deg, #dc2626, #ef4444);
  --gradient-blue-pill: linear-gradient(90deg, #2563eb 60%, #1e40af 100%);

  /* ── Nav Panel ── */
  --nav-bg: #2c3e50;
  --nav-text: #ecf0f1;
  --nav-text-dim: #bdc3c7;
  --nav-border: #34495e;
  --nav-hover: rgba(255, 255, 255, 0.15); /* was #34495e — too close to nav-bg; white overlay is visible on any dark nav bg */
  --nav-active: #2471a3; /* was #3498db — 3.15:1 failed WCAG AA; #2471a3 gives 5.30:1 */
  --nav-danger: #fca5a5;          /* the nav is dark in both themes */
  --nav-danger-hover-bg: rgba(248, 113, 113, 0.16);
}

/* ── Auto dark mode via system preference (not overridden by [data-theme]) ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg-base: #111827;
    --bg-surface: #1f2937;
    --bg-surface-alt: #263245;
    --bg-surface-hover: #2d3748;
    --bg-input: #1a2233;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #8b98ab; /* was #718096 - 3.3:1 on surface; now 5:1 */
    --text-body: #cbd5e0;
    --text-link: #94a3b8;

    --border-color: #2d3748;
    --border-input: #64748b;
    --border-subtle: #2d3748;

    --accent-blue: #60a5fa;
    --accent-blue-hover: #3b82f6;
    --accent-blue-btn: #2563eb;
    --accent-blue-btn-hover: #1d4ed8;
    --accent-blue-link: #93c5fd;
    --accent-blue-link-hover: #60a5fa;
    --accent-green: #34d399;
    --accent-green-hover: #10b981;
    --accent-red: #f87171;
    --accent-red-hover: #ef4444;
    --accent-orange: #fb923c;
    --accent-yellow-bg: #3a2e0a;
    --accent-yellow-text: #fcd34d;
    --accent-yellow-border: #92400e;

    --bg-accent-subtle: #1e2d3d;

    --score-high: #86efac;
    --score-medium: #fbbf24;
    --score-low: #f87171;
    --score-none: #9ca3af;
    --score-high-bg: #86efac20;
    --score-medium-bg: #fbbf2420;
    --score-low-bg: #f8717120;
    --score-none-bg: #9ca3af20;

    --status-success-bg: rgba(52, 211, 153, 0.15);
    --status-success-text: #6ee7b7;
    --status-info-bg: rgba(96, 165, 250, 0.15);
    --status-info-text: #93c5fd;
    --status-warning-bg: rgba(251, 191, 36, 0.15);
    --status-warning-text: #fcd34d;
    --status-danger-bg: rgba(248, 113, 113, 0.15);
    --status-danger-text: #fca5a5;
    --status-sent-bg: rgba(96, 165, 250, 0.12);
    --status-sent-text: #93c5fd;

    --shadow-sm: rgba(0, 0, 0, 0.35);
    --shadow-md: rgba(0, 0, 0, 0.45);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);

    --tooltip-bg: #1e293b;

    --nav-bg: #0f172a;
    --nav-text: #e2e8f0;
    --nav-text-dim: #94a3b8;
    --nav-border: #1e293b;
    --nav-hover: rgba(255, 255, 255, 0.15);
    --nav-active: #2563eb; /* was #3b82f6 — 3.68:1 failed WCAG AA; #2563eb gives 5.17:1 */
  }
}

/* ── Manual dark theme override ── */
[data-theme="dark"] {
  color-scheme: dark;

  --bg-base: #111827;
  --bg-surface: #1f2937;
  --bg-surface-alt: #263245;
  --bg-surface-hover: #2d3748;
  --bg-input: #1a2233;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #8b98ab;
  --text-body: #cbd5e0;
  --text-link: #94a3b8;

  --border-color: #2d3748;
  --border-input: #64748b; /* same as auto-dark (was #374151, near-invisible on inputs) */
  --border-subtle: #2d3748;

  --accent-blue: #60a5fa;
  --accent-blue-hover: #3b82f6;
  --accent-blue-btn: #2563eb;
  --accent-blue-btn-hover: #1d4ed8;
  --accent-blue-link: #93c5fd;
  --accent-blue-link-hover: #60a5fa;
  --accent-green: #34d399;
  --accent-green-hover: #10b981;
  --accent-red: #f87171;
  --accent-red-hover: #ef4444;
  --accent-orange: #fb923c;
  --accent-yellow-bg: #3a2e0a;
  --accent-yellow-text: #fcd34d;
  --accent-yellow-border: #92400e;

  --bg-accent-subtle: #1e2d3d;

  --score-high: #86efac;
  --score-medium: #fbbf24;
  --score-low: #f87171;
  --score-none: #9ca3af;
  --score-high-bg: #86efac20;
  --score-medium-bg: #fbbf2420;
  --score-low-bg: #f8717120;
  --score-none-bg: #9ca3af20;

  --status-success-bg: rgba(52, 211, 153, 0.15);
  --status-success-text: #6ee7b7;
  --status-info-bg: rgba(96, 165, 250, 0.15);
  --status-info-text: #93c5fd;
  --status-warning-bg: rgba(251, 191, 36, 0.15);
  --status-warning-text: #fcd34d;
  --status-danger-bg: rgba(248, 113, 113, 0.15);
  --status-danger-text: #fca5a5;
  --status-sent-bg: rgba(96, 165, 250, 0.12);
  --status-sent-text: #93c5fd;

  --shadow-sm: rgba(0, 0, 0, 0.35);
  --shadow-md: rgba(0, 0, 0, 0.45);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);

  --tooltip-bg: #1e293b;

  --nav-bg: #0f172a;
  --nav-text: #e2e8f0;
  --nav-text-dim: #94a3b8;
  --nav-border: #1e293b;
  --nav-hover: rgba(255, 255, 255, 0.15);
  --nav-active: #2563eb; /* was #3b82f6 — 3.68:1 failed WCAG AA; #2563eb gives 5.17:1 */
}

/* ── Manual light theme override ── */
[data-theme="light"] {
  color-scheme: light;
}

/* ─── Base element styles ──────────────────────────────────────────────────── */
a {
  font-weight: 500;
  color: var(--accent-blue);
  text-decoration: inherit;
}

a:hover {
  color: var(--accent-blue-hover);
}

body {
  margin: 0;
  display: flex;
  place-items: center;
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--bg-base);
  color: var(--text-body);
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.25s;
}

button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}
/* Skip navigation link — visually hidden until focused */
.skip-nav-link {
  position: absolute;
  top: -9999px;
  left: -9999px;
  z-index: 10;
  padding: 0.75rem 1.5rem;
  background: var(--accent-blue, #2563eb);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 4px 4px;
  text-decoration: none;

  &:focus {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Vite template brand colors (logo hover effects) */
:root {
  --vite-purple: #646cff;
  --react-cyan: #61dafb;
}

/* Unified main page container */
.main-page {
  padding: 2rem;
  background-color: var(--bg-base);
  min-height: 100vh;
  width: 100%;
  box-sizing: border-box;

}
/* Global page title style */
.page__title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2rem;
  text-align: start;
}
/* Global overflow prevention */
* {
  box-sizing: border-box;
}

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

body {
  overflow-x: hidden;
  max-width: 100vw;
  margin: 0;
  padding: 0;
}

#root {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden auto; /* Prevent horizontal scrolling */ /* Allow vertical scrolling */
  max-width: 100vw;
}

.app {
  display: flex;
  width: 100%;
  height: 100vh;
  position: relative;
  overflow-x: hidden; /* Prevent horizontal overflow */
  max-width: 100vw;
  /* Global language toggle positioning */
  & > .language-toggle {
    z-index: 3;
  }
}

.main-content {
  /* Containing block for absolutely positioned descendants (e.g. .sr-only
     live regions); without it they hang off .app and give it a second,
     phantom scrollbar next to this one. */
  position: relative;
  flex: 1;
  margin-inline-start: var(--nav-width-collapsed);
  overflow: hidden auto; /* Prevent horizontal overflow */
  background-color: var(--bg-base);
  width: calc(100% - var(--nav-width-collapsed));
  max-width: calc(100vw - var(--nav-width-collapsed));
  min-width: 0; /* Allow flex shrinking */
  transition: margin-inline-start 0.3s ease, width 0.3s ease, max-width 0.3s ease;

  /* Apply overflow hidden to all child elements */
  & * {
    max-width: 100%;
    overflow-wrap: break-word;
  }

  /* Exclude Highcharts tooltips from max-width constraint */
  & .highcharts-tooltip,
  & .highcharts-tooltip * {
    max-width: none;
    overflow-wrap: normal;
  }

  /* Specific table handling */
  & table {
    width: 100%;
    table-layout: fixed;
    overflow-x: auto;
  }

  /* Container for tables to add horizontal scroll if needed */
  & .table-container {
    width: 100%;
    overflow: auto visible;
  }

  /* Responsive adjustments */
  @media (max-width: 768px) {
    margin-inline: 0;
    width: 100%;
    max-width: 100vw;

    & * {
      max-width: 100vw;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    transition: none;
  }
}

/* Shift content when desktop nav is expanded */
.app[data-nav-expanded="true"] .main-content {
  margin-inline-start: var(--nav-width-expanded);
  width: calc(100% - var(--nav-width-expanded));
  max-width: calc(100vw - var(--nav-width-expanded));
}

.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;

  &:hover {
    filter: drop-shadow(0 0 2em color-mix(in sRGB, var(--vite-purple) 67%, transparent));
  }

  &.react:hover {
    filter: drop-shadow(0 0 2em color-mix(in sRGB, var(--react-cyan) 67%, transparent));
  }
}

@keyframes logo-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: no-preference) {
  a:nth-of-type(2) .logo {
    animation: logo-spin infinite 20s linear;
  }
}

.card {
  padding: 2em;
}

.read-the-docs {
  color: var(--text-muted);
}
/* Shared page styles */
.page {
  padding: 2rem;
  width: 100%;
  box-sizing: border-box;
}

.page__title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2rem;
}


.page__content {
  background: var(--bg-surface);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.placeholder-content {
  margin-top: 2rem;

  & h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
  }

  & ul {
    color: var(--text-secondary);
    line-height: 1.6;
  }

  & li {
    margin-bottom: 0.5rem;
  }
}
.job-form input,
.job-form select,
.job-form textarea {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-input);
  border-radius: 4px;
  font-size: 0.9rem;
  padding: 0.75rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.job-form input::placeholder,
.job-form textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.job-form input:focus,
.job-form select:focus,
.job-form textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--focus-ring-md);
}

.job-form input:disabled,
.job-form select:disabled,
.job-form textarea:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}
.job-form__label {
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-align: start;
  display: block;
}
.job-form__label-text {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
}
.job-form__asterisk {
  color: var(--accent-red);
  font-size: 1.1em;
  line-height: 1;
}
.job-form {
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-surface);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;

  @media (max-width: 768px) {
    padding: 1rem;
    box-shadow: none;
    border-radius: 12px;
  }
}
.job-form__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;

  & label {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    color: var(--text-body);
    gap: 0.5rem;
  }

  & textarea {
    min-height: 80px;
    resize: vertical;
  }

  @media (max-width: 768px) {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
.job-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;

  @media (max-width: 768px) {
    flex-direction: column;
  }
}

/* RTL support for actions */
.job-form--rtl {
  & .job-form__actions {
    justify-content: flex-start;
  }

  /* RTL support for inputs and selects */
  & input,
  & select,
  & textarea {
    text-align: start;
  }
}

.job-form__cancel {
  background: var(--bg-surface-alt);
  color: var(--text-body);
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;

  @media (max-width: 768px) {
    flex: 1;
    padding: 0.875rem;
    width: 100%;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
  }
}
.job-form__ok {
  background: var(--accent-blue-btn);
  color: white;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;

  @media (max-width: 768px) {
    flex: 1;
    padding: 0.875rem;
    width: 100%;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
  }
}
.add-job-page {
  & h1 {
    text-align: center;
    margin-bottom: 2rem;
  }

  @media (max-width: 768px) {
    padding: 0 1rem;
    padding-top: 4rem;
  }
}

/* Hidden label (show-other company field) */
.job-form__label--hidden {
  visibility: hidden;
}

/* Page title (shared) */
.job-form__page-title {
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 2rem;
}
.protected-route__loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-size: 1.1rem;
  color: var(--text-muted, #666);
}
.modal__sticky-header-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-surface);
}
/* General Modal Styles */
/* <dialog> resets — browsers give dialog a border, padding, and background */
.modal__overlay {
  position: fixed;
  top: 0;
  inset-inline: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  background: transparent;
  border: none;
  padding: 1rem;
  align-items: center;
  justify-content: center;
  z-index: 6;

  @media (max-width: 768px) {
    padding: 0.5rem;
  }
}

.modal__overlay[open] {
  display: flex;
}

.modal__overlay::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.modal__content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px -12px var(--shadow-md), 0 2px 6px var(--shadow-sm);
  position: relative;

  @media (max-width: 768px) {
    max-height: 90vh;
  }
}

.modal__content--fullscreen {
  max-width: 90vw;
}


.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: sticky;
  top: 0;
  z-index: 10;

  @media (max-width: 600px) {
    padding: 1rem;
  }
}

.reset-modal .modal__header {
  background: transparent !important;
  border-bottom: none;
  padding: 0.5rem 1rem 0 0;
  min-height: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.modal__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;

  @media (max-width: 600px) {
    font-size: 1.125rem;
  }
}

.modal__header--x-only {
  justify-content: flex-end;
  border-bottom: none;
  padding-block-end: 0;
}

.modal__header--x-only .modal__close-btn svg {
  width: 22px;
  height: 22px;
}

.modal__close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: var(--control-h-sm);
  height: var(--control-h-sm);
  margin-block-start: -4px; /* optically centre on the title's first line */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;

  & svg {
    width: var(--icon-md);
    height: var(--icon-md);
  }

  &:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
  }
}

.modal__body {
  min-height: 0;
  color: var(--text-body);
}

/* Post-login alert consent modal */
.modal__content.alert-modal {
  max-width: 500px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}

.alert-modal__body {
  display: flex;
  flex-direction: column;
  padding: 0.25rem 2.25rem 2rem;
}

/* The shared x-only header is a compact first row above the hero */
.alert-modal .modal__header--x-only {
  background: transparent;
  padding: 0.75rem 0.75rem 0;
}

.alert-modal__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-block-end: 1.5rem;
  padding-inline: 0.5rem;
  text-align: center;
}

.alert-modal__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-block-end: 0.5rem;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-blue-btn), color-mix(in srgb, var(--accent-blue-btn) 55%, #8b5cf6));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent-blue-btn) 35%, transparent);
}

.alert-modal__title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--text-primary);
}

.alert-modal__subtitle {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.alert-modal__paused {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Each option is its own roomy card */
.alert-modal__options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.alert-modal__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 76px;
  box-sizing: border-box;
  padding: 1.1rem 1.35rem;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.alert-modal__option:hover:not(.alert-modal__option--disabled) {
  background: var(--bg-surface-hover);
}

.alert-modal__option:has(.alert-modal__switch-input:checked) {
  border-color: color-mix(in srgb, var(--accent-blue) 55%, var(--border-color));
}

/* Dimmed only: size is unchanged so nothing jumps when the email row toggles */
.alert-modal__option--disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.alert-modal__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.alert-modal__label {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.alert-modal__hint {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* Same switch as the Profile page job-alert toggles */
.alert-modal__switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.alert-modal__switch-input {
  position: absolute;
  inset: 0;
  width: 52px;
  height: 30px;
  margin: 0;
  opacity: 0;
  cursor: pointer;

  &:disabled {
    cursor: not-allowed;
  }

  &:checked + .alert-modal__switch-slider {
    background: var(--accent-blue);
  }

  &:checked + .alert-modal__switch-slider::after {
    content: "✓";
    color: var(--accent-blue);
    transform: translateX(22px);
  }

  :dir(rtl) &:checked + .alert-modal__switch-slider::after {
    transform: translateX(-22px);
  }

  &:focus-visible + .alert-modal__switch-slider {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
  }
}

.alert-modal__switch-slider {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: var(--border-input);
  transition: background-color 0.2s ease;

  &::after {
    content: "✕";
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
  }
}

.alert-modal__footnote {
  margin: 1.1rem 0.25rem 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  text-align: center;
  color: var(--text-secondary);
}

.alert-modal__error {
  margin: 0.75rem 0 0;
  color: var(--accent-red);
  font-size: 0.9rem;
}

/* Full-width primary action with a quiet secondary under it */
.alert-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-block-start: 1.5rem;
}

.alert-modal__save,
.alert-modal__later {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.alert-modal__save {
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent-blue-btn) 30%, transparent);
}

.alert-modal__later {
  min-height: 40px;
  font-weight: 500;
  font-size: 0.95rem;
}

.alert-modal__save {
  background: var(--accent-blue-btn);
  color: #fff;
  border: 1px solid transparent;
}

.alert-modal__save:hover:not(:disabled) {
  background: var(--accent-blue-btn-hover);
}

.alert-modal__later {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.alert-modal__later:hover:not(:disabled) {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.alert-modal__save:focus-visible,
.alert-modal__later:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.alert-modal__save:disabled,
.alert-modal__later:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Mobile: full-width bottom sheet */
@media (max-width: 600px) {
  .modal__overlay[open]:has(.alert-modal) {
    align-items: flex-end;
    padding: 0;
  }

  .modal__content.alert-modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    padding-block-end: env(safe-area-inset-bottom);
  }

  .alert-modal__body {
    padding: 0.25rem 1.5rem 1.5rem;
  }

  .alert-modal__option {
    padding: 1rem 1.1rem;
    gap: 1rem;
  }

  .alert-modal__actions {
    flex-direction: column;
  }
}

/* Notice above historic matches when matching is off */
.matching-off-notice {
  margin-block: 0 1rem;
  padding: 0.6rem 0.9rem;
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border-radius: 8px;
  font-size: 0.9rem;
}

.matching-off-notice__action {
  padding: 0;
  background: none;
  border: none;
  color: var(--accent-blue-link);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.matching-off-notice__action:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.matching-off-notice__error {
  color: var(--accent-red);
}

/* Public unsubscribe page */
.unsubscribe-page {
  /* .app is a flex row: without an explicit width/flex this shrinks to the
     card's content width and sits at the start edge instead of the centre. */
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  /* Stretch to the .app height (not 100vh): the fixed staging banner offset
     would otherwise add a page scrollbar. */
  align-self: stretch;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg-base);
}

.unsubscribe-card {
  width: 100%;
  max-width: 440px;
  box-sizing: border-box;
  padding: 2rem 1.5rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.unsubscribe-card__title {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  line-height: 1.3;
}

.unsubscribe-card__text {
  margin: 0 0 1.5rem;
  color: var(--text-secondary);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.unsubscribe-card__email {
  unicode-bidi: isolate;
  font-weight: 600;
  color: var(--text-primary);
}

.unsubscribe-card__error {
  margin: 0 0 1rem;
  color: var(--accent-red);
  font-size: 0.9rem;
}

.unsubscribe-card__button,
.unsubscribe-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.unsubscribe-card__button {
  background: var(--accent-blue-btn);
  color: #fff;
  border: none;
}

.unsubscribe-card__button:hover:not(:disabled) {
  background: var(--accent-blue-btn-hover);
}

.unsubscribe-card__button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.unsubscribe-card__link {
  background: transparent;
  color: var(--accent-blue-link);
  border: 1px solid var(--accent-blue-link);
}

.unsubscribe-card__link:hover {
  color: var(--accent-blue-link-hover);
  border-color: var(--accent-blue-link-hover);
}
/* Language Toggle Base Styles */
.language-toggle-button {
  font-family: inherit;
  outline: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-body);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  box-shadow: var(--shadow-card);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  &:hover {
    box-shadow: 0 2px 8px var(--shadow-sm);
    border-color: var(--text-muted);
    background-color: var(--bg-surface);
  }

  & svg {
    flex-shrink: 0;
  }

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

/* Position Variants */
.language-toggle--top-right {
  position: absolute;
  top: 20px;
  inset-inline-end: 20px;
}

.language-toggle--top-left {
  position: absolute;
  top: 20px;
  inset-inline-start: 20px;
}

.language-toggle--inline {
  position: static;
  width: 100%;
}

.language-toggle--inline .language-toggle-button {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
}

/* Size Variants */
.language-toggle-button--small {
  padding: 0 var(--space-3);
  font-size: var(--font-sm);
  font-weight: 500;
  gap: var(--space-2);
  min-width: var(--control-h);
  height: var(--control-h);
}

.language-toggle-button--medium {
  padding: 6px 10px;
  font-size: 0.8125rem;
  min-width: 110px;
}

.language-toggle-button--large {
  padding: 8px 12px;
  font-size: 0.875rem;
  min-width: 120px;
}
.nav-panel {
  background-color: var(--nav-bg);
  color: var(--nav-text);
  height: 100lvh;
  padding: 0.5rem 0.5rem calc(0.5rem + 100lvh - 100dvh + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  position: fixed;
  inset-inline-start: 0;
  top: 0;
  overflow: hidden auto;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
  z-index: 10;

}

/* Desktop states */
@media (min-width: 769px) {
  .nav-panel {
    width: var(--nav-width-collapsed, 64px);

    &.nav-panel--expanded {
      width: var(--nav-width-expanded, 228px);
    }
  }
}

/* Mobile states */
@media (max-width: 768px) {
  .nav-panel {
    width: 70vw;
    max-width: 280px;
    min-width: 200px;
    transform: translateX(-100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    overflow: hidden auto;

    &.nav-panel--expanded {
      transform: translateX(0);
    }

    &:dir(rtl) {
      transform: translateX(100%);
      box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);

      &.nav-panel--expanded {
        transform: translateX(0);
      }
    }
  }
}

/* Mobile hamburger button */
.nav-panel__mobile-toggle {
  position: fixed;
  top: 1rem;
  inset-inline-start: 1rem;
  z-index: 11;
  background-color: var(--nav-bg);
  color: var(--nav-text);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: background-color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 44px;
  height: 44px;

  &:hover {
    background-color: color-mix(in sRGB, var(--nav-bg) 80%, white);
    transform: scale(1.05);
  }

  &:focus {
    outline: none;
    border-color: var(--nav-text);
  }

  &:focus:not(:focus-visible) {
    border-color: transparent;
  }

  &:focus-visible {
    outline: none;
    border-color: var(--nav-text);
  }

  @media (max-width: 768px) {
    z-index: 11;
  }

  @media (min-width: 769px) {
    display: none;
  }
}

/* Toggle button - same footprint as a collapsed nav item so its icon sits
   on the same vertical axis as every icon below it. */
.nav-panel__toggle {
  background: none;
  border: 2px solid transparent;
  color: var(--nav-text);
  cursor: pointer;
  padding: 0;
  width: var(--nav-item-w);
  height: var(--nav-item-h);
  flex-shrink: 0;
  border-radius: var(--radius-md);
  outline: none;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover {
    background-color: var(--nav-hover);
  }

  &:focus {
    outline: none;
    border-color: var(--nav-text);
  }

  &:focus:not(:focus-visible) {
    border-color: transparent;
  }

  &:focus-visible {
    outline: none;
    border-color: var(--nav-text);
  }
}

.nav-panel__header {
  border-bottom: 1px solid var(--nav-border);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  transition: border-color 0.3s ease;
  min-height: 48px;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
  justify-content: flex-start;
}

.nav-panel__header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.nav-panel__header--collapsed {
  border-bottom: 1px solid transparent;
}

.nav-panel__title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
  color: var(--nav-text);
  transition: opacity 0.3s ease;
}

.nav-panel__user {
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--nav-text-dim);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.3s ease;
}

/* Hide text but keep space in collapsed state */
.nav-panel--collapsed {
  & .nav-panel__header-text {
    display: none;
  }

  & .nav-panel__title,
  & .nav-panel__user {
    opacity: 0;
    height: 0;
    margin: 0;
    overflow: hidden;
  }

  & .nav-panel__text {
    opacity: 0;
  }
}

.nav-panel__nav {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  overflow: hidden auto;
  gap: 0.25rem;
}

.nav-panel__section {
  display: flex;
  flex-direction: column;
}

/* Small muted group heading; in the icon rail it becomes a thin divider */
.nav-panel__section-label {
  margin: 0.5rem 0 0.25rem;
  padding-inline: var(--nav-item-pad);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nav-text-dim);
  white-space: nowrap;
}

.nav-panel__section:first-child .nav-panel__section-label {
  margin-top: 0.25rem;
}

.nav-panel__section-rule {
  width: 60%;
  margin: 0.375rem auto;
  border: 0;
  border-top: 1px solid var(--nav-border);
}

.nav-panel__section:first-child .nav-panel__section-rule {
  display: none;
}

.nav-panel__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Sidebar control anatomy ──
   Every row in the sidebar (nav links, Profile, collapsed theme button,
   language, Logout) is a .nav-panel__link: one height, one radius, one icon
   size and one icon-label gap. Inline padding is chosen so the icon is
   centered in the collapsed rail and stays on exactly the same x position
   when the panel expands - nothing jumps, in LTR or RTL. */
.nav-panel {
  --nav-item-h: 2.375rem;
  --nav-item-w: calc(var(--nav-width-collapsed, 64px) - 1rem);
  --nav-icon: 20px;
  --nav-item-pad: calc((var(--nav-item-w) - var(--nav-icon)) / 2 - 2px); /* minus the 2px focus border */
}

.nav-panel__link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  width: 100%;
  height: var(--nav-item-h);
  padding: 0 var(--nav-item-pad);
  margin: 0;
  color: var(--nav-text);
  background: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: start;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;

  &:hover {
    background-color: var(--nav-hover);
    color: var(--nav-text);
  }

  &:focus {
    outline: none;
    border-color: var(--nav-text);
  }

  &:focus:not(:focus-visible) {
    border-color: transparent;
  }

  &:focus-visible {
    outline: none;
    border-color: var(--nav-text);
  }
}

.nav-panel__link--active,
.nav-panel__link--active:hover {
  background-color: var(--nav-active);
  color: white;
}

.nav-panel__icon {
  width: var(--nav-icon);
  height: var(--nav-icon);
  flex-shrink: 0;
}

/* Arrow-like icons point the other way in RTL */
.nav-panel__icon--directional:dir(rtl) {
  transform: scaleX(-1);
}

.nav-panel__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Logout: quiet by default, tinted red so it reads as the exit */
.nav-panel__logout {
  color: var(--nav-danger);

  &:hover {
    background-color: var(--nav-danger-hover-bg);
    color: var(--nav-danger);
  }
}

/* RTL support */
.nav-panel:dir(rtl) {
  & .nav-panel__title,
  & .nav-panel__user {
    text-align: start;
  }
}

.nav-panel__footer {
  flex-shrink: 0;
  margin-top: 0.5rem;
  border-top: 1px solid var(--nav-border);
  padding-top: 0.5rem;
  transition: border-color 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-panel__footer--collapsed {
  border-top: 1px solid transparent;
}

/* Overlay for mobile when nav is open */
.nav-overlay {
  position: fixed;
  top: 0;
  inset-inline: 0;
  bottom: 0;
  background-color: var(--overlay-bg-light, rgba(0, 0, 0, 0.5));
  z-index: 9;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  border: none;
  padding: 0;
  cursor: pointer;
  appearance: none;
}

.nav-overlay--visible {
  opacity: 1;
  visibility: visible;
}

/* Never show the overlay on desktop regardless of JS state */
@media (min-width: 769px) {
  .nav-overlay {
    display: none;
  }
}

/* Suppress all transitions during language direction changes to prevent
   the translateX(-100%) ↔ translateX(100%) flip from animating. */
.nav-panel[data-lang-changing] {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .nav-panel,
  .nav-panel__mobile-toggle,
  .nav-panel__toggle,
  .nav-panel__header,
  .nav-panel__link,
  .nav-panel__text,
  .nav-panel__footer,
  .nav-overlay {
    transition: none;
  }

  .nav-panel__mobile-toggle:hover {
    transform: none;
  }
}

/* ─── Header / footer layout ───────────────────────────────────────────────
   Header: brand only. Footer rows: Profile, Theme (opens a menu), Language,
   Logout, then a full-width Collapse / Expand row at the very bottom. */
.nav-panel--expanded .nav-panel__header-text {
  padding-inline-start: 0.5rem;
}

.nav-panel__header--collapsed {
  display: none;
}

.nav-panel__user {
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-panel__collapse {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--nav-border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: var(--nav-text-dim);
  font-size: 0.875rem;

  &:hover {
    color: var(--nav-text);
  }
}

.nav-panel--collapsed .nav-panel__collapse {
  background: var(--nav-hover);
  border-bottom-color: transparent;
  border-radius: var(--radius-md);
  color: var(--nav-text);
}
/* Theme switcher.
   Collapsed sidebar: a single cycling button that reuses the nav item anatomy
   (.nav-panel__link + .nav-panel__icon, see NavPanel.css).
   Expanded: a segmented control - one track at the shared control height
   with three equal segments, each icon + label on one line.
   Colors come from --nav-* so the login card can re-skin it (Login.css). */

.theme-toggle__cycle-btn {
  color: var(--nav-text-dim);
}

.theme-toggle {
  --seg-track-bg: rgba(255, 255, 255, 0.06);
  --seg-hover-bg: rgba(255, 255, 255, 0.08);

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
  height: 2.125rem;
  padding: 3px;
  box-sizing: border-box;
  background: var(--seg-track-bg);
  border: 1px solid var(--nav-border);
  border-radius: var(--radius-md);
}

.theme-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-width: 0;
  height: 100%;
  padding: 0 2px;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--nav-text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: var(--font-xs);
  font-weight: 500;
  line-height: 1;
  outline: none;
  transition: background-color var(--transition-fast), color var(--transition-fast);
  box-sizing: border-box;

  &:hover:not(.theme-toggle__btn--active) {
    background-color: var(--seg-hover-bg);
    color: var(--nav-text);
  }

  &:focus-visible {
    box-shadow: 0 0 0 2px var(--nav-text) inset;
  }
}

.theme-toggle__btn--active {
  background-color: var(--nav-active);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.theme-toggle__btn-icon {
  width: var(--icon-sm);
  height: var(--icon-sm);
  flex-shrink: 0;
}

.theme-toggle__btn-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ─── Sidebar theme menu (ThemeMenu.jsx) ─────────────────────────────────── */
.theme-menu__trigger .nav-panel__text {
  flex: 1;
}

.theme-menu__chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--nav-text-dim);
}

.theme-menu {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  background: var(--nav-bg);
  border: 1px solid var(--nav-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.theme-menu__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  height: 2.25rem;
  padding: 0 0.6rem;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--nav-text);
  font: inherit;
  font-size: 0.9rem;
  text-align: start;
  cursor: pointer;

  &:hover,
  &:focus-visible {
    background: var(--nav-hover);
    outline: none;
  }
}

.theme-menu__item--active {
  font-weight: 600;
}

.theme-menu__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.theme-menu__check {
  width: 16px;
  height: 16px;
  margin-inline-start: auto;
}
.session-expired-modal__overlay {
  position: fixed;
  top: 0;
  inset-inline: 0;
  bottom: 0;
  background-color: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-in-out;
}

.session-expired-modal__content {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 32px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 10px 40px var(--shadow-md);
  text-align: center;
  animation: slideUp 0.3s ease-out;
}

.session-expired-modal__icon {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: pulse 1.5s ease-in-out infinite;
}

.session-expired-modal__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-red);
  margin: 0 0 16px;
}

.session-expired-modal__message {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 16px;
  line-height: 1.5;
}

.session-expired-modal__countdown {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 24px;

  & strong {
    color: var(--accent-red);
    font-size: 1.125rem;
    font-weight: 600;
  }
}

.session-expired-modal__button {
  background-color: var(--accent-blue-btn);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;

  &:hover {
    background-color: var(--accent-blue-hover);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}
/* Single source of truth for banner height and all derived offsets */
html.env-banner {
  --env-banner-height: 30px;
}

.staging-banner {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  z-index: 50;
  height: var(--env-banner-height, 30px);
  background-color: var(--accent-yellow-bg);
  color: var(--accent-yellow-text);
  border-bottom: 1px solid var(--accent-yellow-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  user-select: none;
  pointer-events: none;
}

/* Offset fixed NavPanel and push app content below the banner */
html.env-banner .nav-panel {
  top: var(--env-banner-height);
  height: calc(100lvh - var(--env-banner-height));
}

html.env-banner .app {
  box-sizing: border-box;
  padding-top: var(--env-banner-height);
}

/* Raise skip-nav link above the banner so keyboard users can reach it */
html.env-banner .skip-nav-link {
  z-index: 51;
}

html.env-banner .skip-nav-link:focus,
html.env-banner .skip-nav-link:focus-visible {
  top: var(--env-banner-height);
}

/* Mobile: offset the hamburger toggle button */
@media (max-width: 768px) {
  html.env-banner .nav-panel__mobile-toggle {
    top: calc(1rem + var(--env-banner-height));
  }
}

/* Offset absolutely-positioned top-right language toggle so it clears the banner */
html.env-banner .language-toggle--top-right {
  top: calc(var(--env-banner-height) + 20px);
}
