/* Shared tokens and shared controls, inside the shadow root.
 *
 * This file knows nothing about the layout: it only defines the language the
 * two screens speak (colour roles, radii, focus ring) so the chooser and the
 * dock stay consistent without sharing selectors.
 */

:host {
  all: initial;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  /* AFRIKARTE green, sampled from the logo (web/ext/afk-icon.png). #1fa66a
   * is the on-dark tint: the deep green does not reach text contrast on the
   * navy surfaces. */
  --afk-brand: #008000;
  --afk-brand-ink: #ffffff;
  --afk-brand-soft: #1fa66a;
  --afk-radius: 999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

:focus-visible {
  outline: 2px solid var(--afk-focus, #1fa66a);
  outline-offset: 2px;
}

/* ---- Country accent ----------------------------------------------------- */

.afk-flag {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 12px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

/* ---- Segmented control (language, theme) -------------------------------- */

.afk-seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--afk-control-border);
  border-radius: var(--afk-radius);
  background: var(--afk-control-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  touch-action: none;
}

.afk-seg-btn {
  min-width: 30px;
  width: 30px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--afk-radius);
  background: transparent;
  color: var(--afk-control-text);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.afk-seg-btn:hover {
  background: var(--afk-control-hover);
}

.afk-seg-btn[aria-pressed="true"] {
  background: var(--afk-control-active-bg);
  color: var(--afk-control-active-text);
}

.afk-seg-icon {
  letter-spacing: 0;
}

.afk-seg-icon svg {
  width: 15px;
  height: 15px;
}

/* ---- Small caps label --------------------------------------------------- */

.afk-label {
  margin: 0;
  color: var(--afk-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.afk-rule {
  height: 1px;
  margin: 2px 0;
  border: 0;
  background: var(--afk-rule-color);
}

/* ---- List row (city, home) ---------------------------------------------- */

.afk-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--afk-item-text);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.afk-item:hover,
.afk-item:focus-visible {
  background: var(--afk-item-hover);
}

.afk-item-name {
  flex: 1;
}

.afk-item.is-current {
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
