@font-face { font-family: 'Roboto'; src: url('/fonts/Roboto-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Roboto'; src: url('/fonts/Roboto-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Roboto'; src: url('/fonts/Roboto-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'EF-Font'; src: url('/assets/fonts/EF-Font.ttf') format('truetype'); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light;
  --surface: #fef7ff;
  --on-surface: #1d1b20;
  --on-surface-variant: #49454e;
  --primary: #68548e;
  --outline-variant: #cbc4cf;
  --surface-container-high: #f2ecf4;
  /* Darker than the app's #2196f3, which has only 3:1 contrast on the light surface (WCAG AA: 4.5:1). */
  --link: #1565c0;
  --map-bg: #e8e4dc;
  --map-line: #d9d3c7;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface: #151218;
    --on-surface: #e7e0e8;
    --on-surface-variant: #cbc4cf;
    --primary: #d3bcfd;
    --outline-variant: #49454e;
    --surface-container-high: #2c292f;
    --link: #2196f3;
    --map-bg: #2b2d31;
    --map-line: #3a3c41;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  display: flex; flex-direction: column;
  min-height: 100dvh;
  background: var(--surface);
  color: var(--on-surface);
  font-family: Roboto, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
body > noscript { display: contents; }
/* The app page (index-<lang>.html) shows the lite page above the app until its first frame. */
#loading-fallback {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  background: var(--surface);
}
.loading-bar {
  position: relative; overflow: hidden;
  height: 4px; margin: 16px 0 0; border-radius: 2px;
  background: color-mix(in srgb, var(--primary) 24%, transparent);
}
.loading-bar::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 40%;
  border-radius: 2px; background: var(--primary);
  animation: loading-bar 1.5s ease-in-out infinite;
}
@keyframes loading-bar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .loading-bar::after { animation-duration: 4s; } }

.app-bar {
  flex: none;
  height: 64px;
  display: flex; align-items: center;
  padding: 0 16px;
  background: var(--surface);
  font-size: 22px; line-height: 28px; font-weight: 400;
}
.app-bar h1 { font: inherit; margin: 0; }
/* The title is centered like in the app; the side columns are as wide as each other, so the
   language menu on the right does not push it to the left. */
.app-bar { position: relative; z-index: 2; gap: 8px; display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; }
.app-bar h1, .app-bar .app-title { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.app-bar .app-title { color: inherit; text-decoration: none; }
.app-bar .language-menu { grid-column: 3; justify-self: end; }

.language-menu { flex: none; position: relative; margin-right: -8px; }
.language-menu summary {
  display: flex; align-items: center; gap: 2px;
  height: 40px; padding: 0 4px 0 12px;
  border-radius: 20px;
  list-style: none;
  cursor: pointer;
}
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary::after {
  content: ""; width: 24px; height: 24px;
  background: var(--on-surface-variant);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") center / 24px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") center / 24px no-repeat;
  transition: transform 167ms;
}
.language-menu details[open] summary::after { transform: rotate(180deg); }
.language-menu summary:hover { background: color-mix(in srgb, var(--on-surface) 8%, transparent); }
.language-menu summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.language-menu ul {
  position: absolute; right: 8px; top: 44px;
  min-width: 180px;
  margin: 0; padding: 8px 0;
  list-style: none;
  background: var(--surface-container-high);
  border-radius: 4px;
  box-shadow: 0 2px 6px 2px rgb(0 0 0 / .15), 0 1px 2px rgb(0 0 0 / .3);
}
.language-menu a {
  display: flex; align-items: center; gap: 12px;
  height: 48px; padding: 0 16px;
  font-size: 14px; line-height: 20px; letter-spacing: .1px; font-weight: 500;
  color: var(--on-surface);
  text-decoration: none;
}
.language-menu a:hover { background: color-mix(in srgb, var(--on-surface) 8%, transparent); }
.language-menu a[aria-current] { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.flag {
  flex: none; display: inline-block;
  width: 24px; height: 16px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--on-surface) 15%, transparent);
  background: center / 100% 100% no-repeat;
}
.flag-de { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 3' preserveAspectRatio='none'%3E%3Cpath fill='%23000' d='M0 0h3v1H0z'/%3E%3Cpath fill='%23d00' d='M0 1h3v1H0z'/%3E%3Cpath fill='%23ffce00' d='M0 2h3v1H0z'/%3E%3C/svg%3E"); }
.flag-fr { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2' preserveAspectRatio='none'%3E%3Cpath fill='%23002395' d='M0 0h1v2H0z'/%3E%3Cpath fill='%23fff' d='M1 0h1v2H1z'/%3E%3Cpath fill='%23ed2939' d='M2 0h1v2H2z'/%3E%3C/svg%3E"); }
.flag-nl { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 3' preserveAspectRatio='none'%3E%3Cpath fill='%23ae1c28' d='M0 0h3v1H0z'/%3E%3Cpath fill='%23fff' d='M0 1h3v1H0z'/%3E%3Cpath fill='%2321468b' d='M0 2h3v1H0z'/%3E%3C/svg%3E"); }
.flag-pl { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2' preserveAspectRatio='none'%3E%3Cpath fill='%23fff' d='M0 0h2v1H0z'/%3E%3Cpath fill='%23dc143c' d='M0 1h2v1H0z'/%3E%3C/svg%3E"); }
.flag-en { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40' preserveAspectRatio='none'%3E%3CclipPath id='t'%3E%3Cpath d='M30 20h30v20zv20H0zH0V0zV0h30z'/%3E%3C/clipPath%3E%3Cpath fill='%23012169' d='M0 0h60v40H0z'/%3E%3Cpath stroke='%23fff' stroke-width='8' d='M0 0l60 40m0-40L0 40'/%3E%3Cpath stroke='%23c8102e' stroke-width='5' clip-path='url(%23t)' d='M0 0l60 40m0-40L0 40'/%3E%3Cpath stroke='%23fff' stroke-width='12' d='M30 0v40M0 20h60'/%3E%3Cpath stroke='%23c8102e' stroke-width='7' d='M30 0v40M0 20h60'/%3E%3C/svg%3E"); }

main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex; flex-direction: column;
  background-color: var(--map-bg);
  background-image:
    linear-gradient(var(--map-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--map-line) 1px, transparent 1px);
  background-size: 64px 64px;
}
.banner-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid; place-items: center;
  padding: 24px 16px;
}

.banner {
  width: 100%; max-width: 560px;
  background: var(--surface-container-high);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 2px 6px 2px rgb(0 0 0 / .15), 0 1px 2px rgb(0 0 0 / .3);
}
.banner h2 {
  margin: 0 0 16px;
  font-size: 24px; line-height: 32px; font-weight: 400;
  color: var(--on-surface);
}
.banner p {
  margin: 0;
  font-size: 14px; line-height: 20px; letter-spacing: .25px;
  color: var(--on-surface-variant);
}
.banner p a { color: var(--primary); }
.banner .features {
  margin: 0 0 12px; padding: 0 0 0 20px;
  font-size: 14px; line-height: 20px; letter-spacing: .25px;
  color: var(--on-surface-variant);
}
.banner .features li { margin: 0 0 6px; }
.banner .features strong { font-weight: 500; color: var(--on-surface); }
.banner .more { margin-bottom: 12px; }
.banner .more a { font-weight: 500; }
.banner .actions {
  margin-top: 24px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px;
}
.banner .actions form { margin: 0; }
.attribution {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 calc(8px + env(safe-area-inset-right)) 4px calc(4px + env(safe-area-inset-left));
}
.attribution .imprint,
.attribution .copyright {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  padding: 4px;
  font-size: 14px; line-height: 20px; letter-spacing: .25px;
  color: var(--on-surface);
}
.attribution .imprint { color: var(--on-surface-variant); }
.attribution .copyright a {
  color: var(--link);
  text-decoration: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
}
@supports (anchor-name: --a) and (position-try-fallbacks: --a) {
  main { position: relative; }
  .sheet { anchor-name: --lite-sheet; }
  .attribution { display: contents; }
  .attribution .imprint,
  .attribution .copyright {
    position: absolute;
    position-anchor: --lite-sheet;
    bottom: anchor(bottom);
    width: max-content;
  }
  .attribution .imprint {
    left: 0; right: anchor(left);
    justify-self: start;
    margin: 0 12px calc(4px + env(safe-area-inset-bottom)) calc(4px + env(safe-area-inset-left));
    position-try-fallbacks: --lite-above-left;
  }
  .attribution .copyright {
    left: anchor(right); right: 0;
    justify-self: end;
    margin: 0 calc(8px + env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) 12px;
    position-try-fallbacks: --lite-above-right;
  }
  /* Room for the copyright line above the sheet. `main` outranks the later `.sheet` rule, which
     @supports alone would not. */
  main .sheet { margin-top: 36px; }
}
@position-try --lite-above-left {
  left: 0; right: 0;
  bottom: anchor(top);
  margin: 0 0 8px calc(4px + env(safe-area-inset-left));
}
@position-try --lite-above-right {
  left: 0; right: 0;
  bottom: anchor(top);
  margin: 0 calc(8px + env(safe-area-inset-right)) 8px 0;
}
@supports not ((anchor-name: --a) and (position-try-fallbacks: --a)) {
  @media (min-width: 940px) {
    main { position: relative; }
    .attribution {
      position: absolute; left: 0; right: 0; bottom: calc(4px + env(safe-area-inset-bottom));
      padding-bottom: 0;
      align-items: flex-end;
      pointer-events: none;
    }
    .attribution > * { pointer-events: auto; max-width: calc((100% - 600px) / 2 - 20px); }
  }
}

dialog.license {
  border: 0;
  padding: 24px;
  width: calc(100% - 80px); max-width: 560px;
  border-radius: 28px;
  background: var(--surface-container-high);
  color: var(--on-surface);
  box-shadow: 0 2px 6px 2px rgb(0 0 0 / .15), 0 1px 2px rgb(0 0 0 / .3);
}
dialog.license::backdrop { background: rgb(0 0 0 / .54); }
dialog.license h2 { margin: 0 0 16px; font-size: 24px; line-height: 32px; font-weight: 400; }
.license-text { font-size: 14px; line-height: 20px; letter-spacing: .25px; color: var(--on-surface-variant); }
.license-text p { margin: 0 0 12px; }
.license-text p:last-child { margin-bottom: 0; }
.license-text a { color: var(--link); text-decoration: none; overflow-wrap: anywhere; }

.text-button {
  font: 500 14px/20px Roboto, system-ui, sans-serif; letter-spacing: .1px;
  color: var(--primary);
  background: transparent;
  border: 0; border-radius: 20px;
  padding: 10px 12px;
  min-height: 40px;
  cursor: pointer;
}
.text-button:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.text-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.sheet {
  flex: none;
  width: calc(100% - 16px);
  max-width: 600px;
  margin: 4px auto 0;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 12.5px rgb(0 0 0 / .098);
  padding: 18px 12px calc(4px + env(safe-area-inset-bottom));
}
.sheet form { margin: 0; }
.input-row { display: flex; align-items: center; height: 59px; }

.field {
  --t: 167ms cubic-bezier(.4, 0, .2, 1);
  position: relative;
  flex: 1; min-width: 0;
  height: 57px;
  transform: translateY(-3px);
  transition: height var(--t);
}
.field::before, .field::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; }
.field::before { height: 1px; background: var(--on-surface-variant); }
.field::after { height: 2px; background: var(--primary); transform: scaleX(0); transition: transform var(--t); }
.field:focus-within::after { transform: scaleX(1); }
.field .label {
  position: absolute; left: 0; top: 20px;
  font-size: 16px; line-height: 16px; letter-spacing: .5px;
  color: var(--on-surface-variant);
  white-space: nowrap; pointer-events: none;
  transform-origin: 0 0;
  transition: transform var(--t), color var(--t);
}
.field input {
  position: absolute; left: 0; top: 18px; right: 0;
  height: 36px; width: auto;
  margin: 0; padding: 0; border: 0; outline: 0; background: transparent;
  -webkit-appearance: none; appearance: none;
  font-family: 'EF-Font', monospace;
  font-size: 40px; line-height: 36px; letter-spacing: .5px;
  font-feature-settings: "liga" 1, "calt" 1;
  color: var(--on-surface);
  caret-color: var(--primary);
}
.field input::placeholder { color: var(--on-surface-variant); opacity: 0; transition: opacity var(--t); }
.field input:focus::placeholder { opacity: 1; }
.field:focus-within, .field:has(input:not(:placeholder-shown)) { height: 59px; }
.field:focus-within .label,
.field:has(input:not(:placeholder-shown)) .label { transform: translateY(-16px) scale(.75); }
.field:focus-within .label { color: var(--primary); }
.field input::-webkit-search-decoration { display: none; }
.field input::-webkit-search-cancel-button { display: none; }
/* The clear button like the suffix icon of SearchWidget, over the right end of the field so the
   underline runs below it; only while the field has text. A link to the page without a search, so
   it works without JavaScript too. */
.input-row { position: relative; }
.clear {
  position: absolute; top: 8px; right: -4px;
  width: 48px; height: 48px;
  border-radius: 50%;
  color: var(--on-surface-variant);
}
.clear::before {
  content: ""; position: absolute; inset: 0;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M405 137 375 107 256 226 137 107 107 137 226 256 107 375 137 405 256 286 375 405 405 375 286 256 405 137Z'/%3E%3C/svg%3E") center / 24px 24px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M405 137 375 107 256 226 137 107 107 137 226 256 107 375 137 405 256 286 375 405 405 375 286 256 405 137Z'/%3E%3C/svg%3E") center / 24px 24px no-repeat;
}
.clear:hover { background: color-mix(in srgb, var(--on-surface-variant) 8%, transparent); }
.clear:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.input-row:has(input:placeholder-shown) .clear { display: none; }
.field:has(input:not(:placeholder-shown)) input { right: 52px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.details:empty { display: none; }
.details { padding: 4px 0; }
.result {
  padding: 0 4px;
  font-size: 14px; line-height: 20px; letter-spacing: .25px;
}
.result a { color: var(--link); text-decoration: none; }
.result strong { font-weight: 700; }

body.page { display: block; height: auto; }
body.page .app-bar { position: sticky; top: 0; }
.about { display: block; background: none; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); }
.about article {
  max-width: 720px; margin: 0 auto;
  font-size: 16px; line-height: 24px; letter-spacing: .5px;
  color: var(--on-surface-variant);
}
.about h1 { margin: 16px 0 16px; font-size: 32px; line-height: 40px; font-weight: 400; color: var(--on-surface); }
.about h2 { margin: 32px 0 8px; font-size: 22px; line-height: 28px; font-weight: 400; color: var(--on-surface); }
.about p { margin: 0 0 12px; }
.about strong { font-weight: 500; color: var(--on-surface); }
.about a { color: var(--primary); }
.about .start { margin: 32px 0 0; }
.filled-button {
  display: inline-flex; align-items: center;
  height: 40px; padding: 0 24px;
  border-radius: 20px;
  background: var(--primary);
  font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: .1px;
  text-decoration: none;
}
.about a.filled-button, .filled-button { color: var(--surface); }
.filled-button:hover { box-shadow: 0 1px 2px rgb(0 0 0 / .3), 0 1px 3px 1px rgb(0 0 0 / .15); }
.about footer {
  max-width: 720px; margin: 40px auto 0;
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  font-size: 14px; line-height: 20px;
}
.about footer a { color: var(--on-surface-variant); }
