/* @asafarim/locale selector: @asafarim/country-language-selector 0.5.3 styles (MIT). Generated by scripts/build-selector.ts; do not edit. */
/* =========================================================================
   @asafarim/country-language-selector
   Design tokens are exposed as CSS variables so consumers can re-theme the
   component without overriding individual rules.
   ========================================================================= */

.cls-root,
.cls-root * {
  box-sizing: border-box;
}

.cls-portal {
  position: static;
  display: block;
}

.cls-root {
  --cls-bg: #ffffff;
  --cls-bg-muted: #f6f7f9;
  --cls-bg-hover: #eef1f6;
  --cls-bg-active: #e4e9f2;
  --cls-fg: #111827;
  --cls-fg-muted: #6b7280;
  --cls-fg-subtle: #9ca3af;
  --cls-border: #e5e7eb;
  --cls-border-strong: #d1d5db;
  --cls-accent: #2563eb;
  --cls-accent-fg: #ffffff;
  --cls-radius: 12px;
  --cls-radius-sm: 8px;
  --cls-shadow: 0 10px 32px -8px rgba(15, 23, 42, 0.22),
    0 4px 12px -4px rgba(15, 23, 42, 0.12);
  --cls-focus: 0 0 0 2px rgba(37, 99, 235, 0.45);
  --cls-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  position: relative;
  display: inline-block;
  font-family: var(--cls-font);
  color: var(--cls-fg);
}

@media (prefers-color-scheme: dark) {
  .cls-root {
    --cls-bg: #0f1115;
    --cls-bg-muted: #171a21;
    --cls-bg-hover: #1e222b;
    --cls-bg-active: #262b37;
    --cls-fg: #f3f4f6;
    --cls-fg-muted: #9ca3af;
    --cls-fg-subtle: #6b7280;
    --cls-border: #262b37;
    --cls-border-strong: #323847;
    --cls-accent: #60a5fa;
    --cls-accent-fg: #0f1115;
    --cls-shadow: 0 12px 36px -8px rgba(0, 0, 0, 0.6),
      0 4px 16px -4px rgba(0, 0, 0, 0.4);
  }
}

/* ---------- Trigger ---------- */

.cls-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--cls-bg-muted);
  color: var(--cls-fg);
  border: 1px solid var(--cls-border);
  border-radius: var(--cls-radius-sm);
  font: inherit;
  font-size: 13.5px;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.cls-trigger:hover:not(:disabled) {
  background: var(--cls-bg-hover);
  border-color: var(--cls-border-strong);
}

.cls-trigger:active:not(:disabled) {
  transform: translateY(0.5px);
}

.cls-trigger:focus-visible {
  outline: none;
  box-shadow: var(--cls-focus);
}

.cls-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cls-trigger__flag {
  font-size: 16px;
  line-height: 1;
}

/* ---------- Flag display modes ---------- */

.cls-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.cls-flag--emoji {
  line-height: 1;
}

.cls-flag--image {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
  background: var(--cls-bg-muted);
}

.cls-flag--image.cls-flag--sm {
  width: 18px;
  height: 13px;
}

.cls-flag--image.cls-flag--md {
  width: 22px;
  height: 16px;
  border-radius: 3px;
}

.cls-trigger__flag.cls-flag--image {
  width: 20px;
  height: 14px;
}

.cls-trigger__code {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cls-trigger__sep {
  color: var(--cls-fg-subtle);
}

.cls-trigger__lang {
  font-weight: 500;
  color: var(--cls-fg-muted);
  text-transform: uppercase;
}

.cls-trigger__chev {
  width: 12px;
  height: 12px;
  margin-left: 2px;
  color: var(--cls-fg-muted);
  transition: transform 160ms ease;
}

.cls-trigger[aria-expanded="true"] .cls-trigger__chev {
  transform: rotate(180deg);
}

/* ---------- Popover ---------- */

.cls-popover {
  position: absolute;
  top: calc(100% + 8px);
  min-width: 320px;
  max-width: min(380px, calc(100vw - 24px));
  background: var(--cls-bg);
  color: var(--cls-fg);
  border: 1px solid var(--cls-border);
  border-radius: var(--cls-radius);
  box-shadow: var(--cls-shadow);
  z-index: 50;
  overflow: hidden;
  animation: cls-pop-in 140ms ease-out;
}

.cls-popover[data-align="end"] {
  right: 0;
}

.cls-popover[data-align="start"] {
  left: 0;
}

@keyframes cls-pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------- Search ---------- */

.cls-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--cls-border);
  background: var(--cls-bg);
}

.cls-search__icon {
  width: 14px;
  height: 14px;
  color: var(--cls-fg-muted);
  flex: 0 0 auto;
}

.cls-search__input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--cls-fg);
  font: inherit;
  font-size: 14px;
  outline: none;
  min-width: 0;
}

.cls-search__input::placeholder {
  color: var(--cls-fg-subtle);
}

/* ---------- Lists ---------- */

.cls-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.cls-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cls-fg-subtle);
  font-weight: 600;
}

.cls-back {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 2px 6px;
  font: inherit;
  font-size: 12px;
  color: var(--cls-accent);
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cls-back:hover {
  background: var(--cls-bg-hover);
}

.cls-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--cls-radius-sm);
  cursor: pointer;
  user-select: none;
  line-height: 1.2;
}

.cls-option[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.cls-option:hover,
.cls-option[data-active="true"] {
  background: var(--cls-bg-hover);
}

.cls-option[aria-selected="true"] {
  background: var(--cls-bg-active);
}

.cls-option__flag {
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}

.cls-option__flag.cls-flag--image {
  width: 24px;
  height: 18px;
}

.cls-option__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cls-option__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--cls-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cls-option__subtitle {
  font-size: 12px;
  color: var(--cls-fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cls-option__meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cls-fg-subtle);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cls-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--cls-bg-muted);
  color: var(--cls-fg-muted);
  border: 1px solid var(--cls-border);
  font-size: 10.5px;
}

.cls-check {
  width: 14px;
  height: 14px;
  color: var(--cls-accent);
}

.cls-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--cls-fg-muted);
  font-size: 13px;
}

/* ---------- Mobile bottom sheet ---------- */

@media (max-width: 768px) {
  .cls-popover {
    min-width: min(320px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    display: flex;
    flex-direction: column;
    z-index: 1000;
  }

  .cls-popover .cls-search {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .cls-popover .cls-section-title {
    flex: 0 0 auto;
  }

  .cls-list {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
  }

  .cls-option {
    padding: 10px 12px;
  }
}

/* ---------- Backdrop used on mobile ---------- */

.cls-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 999;
  animation: cls-fade-in 180ms ease-out;
}

@keyframes cls-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* @asafarim/locale: the selector as a compact pill in the @asafarim/theme tokens. Appended to the component's
   own stylesheet by scripts/build-selector.ts, so it always travels with it (selector.css), and written with
   `.cls-root` in front of every rule so it wins over the component's rules and a page's resets whatever the
   order the bundler puts the files in.
   Upstream (@asafarim/country-language-selector 0.5.3) should: ship these sizes itself (its SVG icons have no
   width/height of their own, so without CSS they fill their container), hide a closed popover with `hidden`
   instead of leaving it to its stylesheet, and take its colours from tokens a host can set. */

/* The component's colours are the theme's: the pill and its panel fit the charcoal top bar (where the theme
   remaps the tokens) and the light areas, in both themes. The fallbacks are the component's own values. */
.cls-root {
  --cls-bg: var(--card, #ffffff);
  --cls-bg-muted: transparent;
  --cls-bg-hover: var(--accent-soft, #eef1f6);
  --cls-bg-active: var(--accent-soft, #e4e9f2);
  --cls-fg: var(--ink, #111827);
  --cls-fg-muted: var(--muted, #6b7280);
  --cls-fg-subtle: var(--muted, #9ca3af);
  --cls-border: var(--line, #e5e7eb);
  --cls-border-strong: var(--muted, #d1d5db);
  --cls-accent: var(--accent, #2563eb);
  --cls-accent-fg: var(--accent-ink, #ffffff);
  --cls-focus: 0 0 0 3px var(--accent, #2563eb);
  flex: none;
  max-width: 100%;
  vertical-align: middle;
}

/* The wrapper the component portals the panel into on a narrow screen holds only fixed-position children and
   must take no room in <body>. The component's own `.cls-portal` rule comes before `.cls-root` in its
   stylesheet, so at equal weight `.cls-root` (inline-block, a line box of its own) wins and the page grows. */
.cls-root.cls-portal {
  position: static;
  display: block;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

/* Every icon has a size of its own: an SVG without one is as big as the space it is given. */
.cls-root svg {
  display: block;
  flex: none;
  width: 14px;
  height: 14px;
  overflow: visible;
}
.cls-root .cls-trigger__chev {
  width: 12px;
  height: 12px;
  margin-left: 0;
}
.cls-root .cls-search__icon,
.cls-root .cls-check {
  width: 14px;
  height: 14px;
}

/* The trigger: one pill, as tall as the theme toggle, the app switcher and the avatar (2.25rem). */
.cls-root .cls-trigger {
  box-sizing: border-box;
  height: 2.25rem;
  min-height: 2.25rem;
  margin: 0;
  padding: 0 0.7rem 0 0.6rem;
  gap: 0.4rem;
  border: 1px solid var(--cls-border);
  border-radius: 999px;
  background: var(--cls-bg-muted);
  color: var(--cls-fg);
  font-size: 0.85rem;
  line-height: 1;
  white-space: nowrap;
}
.cls-root .cls-trigger:hover:not(:disabled) {
  background: var(--card, var(--cls-bg-hover));
  border-color: var(--cls-border-strong);
}
.cls-root .cls-trigger:focus-visible {
  outline: 3px solid var(--accent, #2563eb);
  outline-offset: 2px;
  box-shadow: none;
}
.cls-root .cls-trigger__flag {
  font-size: 1rem;
  line-height: 1;
}

/* A closed panel is not in the layout (the component does not render it until it is opened; `hidden` is the
   belt to that braces), and an open one floats over the page under the trigger. On a narrow screen the
   component portals it into <body> inside a `.cls-root.cls-portal` wrapper, so these rules hold there too. */
.cls-root .cls-popover[hidden] {
  display: none;
}
.cls-root .cls-popover {
  position: absolute;
  top: calc(100% + 8px);
  z-index: 1000;
  box-sizing: border-box;
  background: var(--cls-bg);
  color: var(--cls-fg);
  border-color: var(--cls-border);
  text-align: left;
}
.cls-root .cls-popover[data-align="end"] {
  right: 0;
  left: auto;
}
.cls-root .cls-popover[data-align="start"] {
  left: 0;
  right: auto;
}
.cls-root .cls-list,
.cls-root .cls-list li {
  margin: 0;
  list-style: none;
}
.cls-root .cls-search__input {
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}
.cls-root .cls-search__input:focus-visible {
  outline: none;
}
.cls-root .cls-option[data-active="true"] {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: -2px;
}

/* A narrow screen: the component fixes the panel under the trigger (inline style) over a backdrop. */
@media (max-width: 768px) {
  .cls-root .cls-popover {
    min-width: 0;
    width: min(320px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cls-root .cls-trigger,
  .cls-root .cls-trigger__chev,
  .cls-popover,
  .cls-backdrop {
    animation: none;
    transition: none;
  }
}

/* @asafarim/locale: the selector's mount and its no-JavaScript fallback (one link per language), in the
   @asafarim/theme tokens. selector.js replaces the links with the country & language selector. */
.locale-selector {
  display: inline-flex;
  align-items: center;
}
.locale-links {
  display: inline-flex;
  gap: 0.15rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.locale-links a,
.locale-links span {
  padding: 0.25rem 0.45rem;
  border-radius: 0.4rem;
  color: inherit;
  text-decoration: none;
}
.locale-links a:hover,
.locale-links a:focus-visible {
  text-decoration: underline;
}
.locale-links [aria-current="true"] {
  background: color-mix(in srgb, currentColor 16%, transparent);
}
