/* src/web/static/ui/base.css */
@layer base {
  *,*::before,*::after { box-sizing:border-box; }
  html { -webkit-text-size-adjust:100%; }
  /* Component rules set display (e.g. .omnibox-palette{display:flex}), which
     silently beats the UA's [hidden]{display:none}. Re-assert the attribute's
     contract so hidden always means hidden. */
  [hidden] { display:none !important; }
  body.app-shell {
    margin:0; background:var(--canvas); color:var(--text-1);
    font:400 var(--text-base)/1.5 var(--font-ui);
    -webkit-font-smoothing:antialiased;
  }
  .app-shell :focus-visible {
    outline:2px solid var(--accent); outline-offset:2px;
    border-radius:var(--radius-ctl);
  }
  .app-shell a { color:var(--accent); text-decoration:none; }
  .app-shell a:hover { text-decoration:underline; }
  .app-shell .num, .app-shell [data-metric] { font-variant-numeric:tabular-nums; }
  .app-shell h1, .app-shell h2, .page-header-title {
    font-family:var(--font-display); font-weight:600; letter-spacing:-.01em;
  }
  @media (prefers-reduced-motion:reduce) {
    .app-shell *, .app-shell *::before, .app-shell *::after {
      animation-duration:.01ms!important; transition-duration:.01ms!important;
    }
  }
}

/* The language switcher on pages without the app shell
   (_components/lang_switch.html). Loaded here because base.css is the one
   stylesheet every signed-out page shares. In the components layer, where
   the landing nav's link rules live, or they would win outright. */
@layer components {
  .lang-switch { position:relative; display:inline-block; font:inherit; }
  .lang-switch > summary {
    list-style:none; cursor:pointer; display:inline-flex; align-items:center;
    gap:6px; padding:6px 8px; border-radius:var(--radius-ctl);
    color:var(--text-2); font-size:var(--text-sm); white-space:nowrap;
  }
  .lang-switch > summary::-webkit-details-marker { display:none; }
  .lang-switch > summary:hover, .lang-switch[open] > summary { color:var(--text-1); background:var(--accent-soft); }
  .lang-switch > summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
  .lang-switch svg { width:16px; height:16px; flex:none; }
  .lang-switch-menu {
    position:absolute; inset-inline-end:0; top:calc(100% + 6px); z-index:50;
    margin:0; padding:6px; list-style:none; min-width:168px;
    background:var(--surface-raised); border:1px solid var(--border);
    border-radius:10px; box-shadow:var(--shadow-float);
  }
  .lang-switch .lang-switch-menu a {
    display:block; padding:7px 10px; border-radius:6px; text-decoration:none;
    color:var(--text-1); font-size:var(--text-sm);
  }
  .lang-switch .lang-switch-menu a:hover { background:var(--accent-soft); }
  .lang-switch .lang-switch-menu a[aria-current] { font-weight:600; color:var(--accent); }
  .lang-switch--up .lang-switch-menu { top:auto; bottom:calc(100% + 6px); }
  @media (max-width:480px) { .mk-nav .lang-switch-cur { display:none; } }
}
