/*
 * The greek-conversion design system: Papier (light) and Nuit (dark), the
 * cobalt of the Greek half of the tessera for the source, the orange of its
 * Latin half for the target. Bricolage Grotesque for the interface;
 * Literata, one step lighter than Regular, for the texts in all three
 * formats, Beta Code included; a monospace face for code.
 *
 * Shared by the playground and the documentation site. The font URLs are
 * relative to this file: a build serves the fonts in a `fonts/` folder next
 * to the stylesheet that includes it.
 */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("./fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Literata GC";
  src: url("./fonts/literata-gc.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
/*
 * Literata has no symbol forms of Greek letters (ϐ ϑ ϕ ϖ ϰ ϱ ϵ ϒ) nor the
 * reversed lunate sigmas: Noto Serif supplies them, scaled to Literata's
 * x-height.
 */
@font-face {
  font-family: "Literata GC";
  src: url("./fonts/noto-serif-greek-symbols.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  size-adjust: 95%;
  unicode-range: U+037B-037D, U+03D0-03D6, U+03F0-03F1, U+03F5, U+03FD-03FF;
}
/*
 * The code, in every format: Noto Sans Mono covers polytonic Greek and the
 * Latin of transliterations, and stacks their diacritics, on every system.
 * It draws the symbol forms and the lunate sigmas as the ordinary letters
 * (ϐ as β, Ϲ as Σ): Fira Mono, at the same advance, supplies them.
 */
@font-face {
  font-family: "Noto Sans Mono";
  src: url("./fonts/noto-sans-mono.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans Mono";
  src: url("./fonts/fira-mono-greek-symbols.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+037B-037D, U+03D0-03D6, U+03F0-03F2, U+03F4-03F5, U+03F9,
    U+03FD-03FF;
}

:root {
  color-scheme: light;
  --surface: #f6f0e4;
  --raised: #ffffff;
  --line: #e2d9c8;
  --ink: #1f2a44;
  --muted: #5e5a63;
  /* --from: the cobalt of identity and meaning (the name's "greek", the
     symbol's half, the source side of the playground's source and target).
     --link: links and active elements (primary buttons, checked controls,
     selected tabs, hover colours, the focus ring), as the design system's
     link and focus-ring tokens. In
     the light theme the two are the same cobalt; in the dark theme --from
     is bleu-clair and --link cobalt-clair. */
  --from: #2f4fa8;
  --to: #c85a26;
  --to-fill: #dd6a33;
  --link: #2f4fa8;
  --code-bg: #fbf8f2;
  /* --error: a plain red for what fails, such as a token that validation
     rejects; the brand's orange marks the target, not a fault. 5.6:1 on
     code-bg, 5.9:1 on raised. */
  --error: #c0262d;
  --code-keyword: #2f4fa8;
  --code-string: #a9461c;
  --code-function: #1f2a44;
  --code-muted: #5e5a63;
  --shadow: 0 6px 20px rgb(31 42 68 / 0.12);
  /* Notes take a tint darker than the page, unlike the raised pickers. */
  --tip: #e9e1d1;
  --face-ui: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --face-text: "Literata GC", "Gentium Plus", "Noto Serif", serif;
  --face-code: "Noto Sans Mono", ui-monospace, "SF Mono", Menlo, Consolas,
    monospace;
  --radius: 6px;
  /* Button states: the link colour mixed with the ink deepens it, darker
     in the light theme and lighter in the dark one, still blue; a tint of
     the ink marks a pressed secondary button. Defined on the root, they
     follow the theme's --link and --ink. */
  --link-hover: color-mix(in oklab, var(--link) 82%, var(--ink));
  --link-press: color-mix(in oklab, var(--link) 66%, var(--ink));
  /* A button of the target's orange, deep enough to carry text in the
     ground's colour (5.2:1 in light, 6.5:1 in dark): the strings' orange. */
  --to-strong: var(--code-string);
  --to-strong-hover: color-mix(in oklab, var(--to-strong) 82%, var(--ink));
  --to-strong-press: color-mix(in oklab, var(--to-strong) 66%, var(--ink));
  --press: color-mix(in oklab, var(--ink) 8%, transparent);
  /* Pressed, an action button shrinks to --squish in 60ms, then springs
     back with a marked overshoot (--ease-bounce, 320ms). */
  --squish: 0.96;
  --ease-bounce: cubic-bezier(0.3, 2.2, 0.6, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface: #161b2b;
    --raised: #1f2538;
    --line: #323a5c;
    --ink: #d9ddeb;
    --muted: #9aa3bf;
    --from: #c9d3ec;
    --to: #e08a5e;
    --to-fill: #e08a5e;
    /* cobalt-clair: the cobalt's hue (oklch 0.76 0.12 265.8), lightened as
       orange-clair lightens the orange, and as saturated as the screen
       allows; 7.9:1 on nuit, 7:1 on surface-raised. bleu-clair, nearly
       grey, stays the symbol's and the name's: as a link colour it read
       as text a shade lighter rather than as blue. */
    --link: #8daffe;
    --code-bg: #191f31;
    /* 6.5:1 on code-bg, 6:1 on raised. */
    --error: #ff7a70;
    --code-keyword: #c9d3ec;
    --code-string: #e08a5e;
    --code-function: #f4ecdd;
    --code-muted: #9aa3bf;
    --shadow: 0 6px 20px rgb(0 0 0 / 0.4);
    --tip: #0e1220;
  }
}

/*
 * Generated by scripts/generate_icons.ts from lucide-static 1.76.0; do not edit.
 * SPDX-FileCopyrightText: Lucide Icons and Contributors; 2013-present Cole Bemis (Feather)
 * SPDX-License-Identifier: ISC AND MIT
 *
 * Icons as mask images: `mask: var(--icon-search) center / contain no-repeat`
 * over a `currentColor` background draws the icon in the text's colour.
 */
:root {
  --icon-chevron-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --icon-chevron-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
  --icon-external-link: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6'/%3E%3Cpath d='M10 14 21 3'/%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E");
  --icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
  --icon-lightbulb: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5'/%3E%3Cpath d='M9 18h6'/%3E%3Cpath d='M10 22h4'/%3E%3C/svg%3E");
  --icon-menu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16'/%3E%3Cpath d='M4 12h16'/%3E%3Cpath d='M4 19h16'/%3E%3C/svg%3E");
  --icon-octagon-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16h.01'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z'/%3E%3C/svg%3E");
  --icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 21-4.34-4.34'/%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3C/svg%3E");
  --icon-triangle-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
  --icon-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
}

/*
 * The playground. Its design tokens and fonts are in
 * `web/shared/tokens.css`, which the build puts before this file.
 */

/* Safari on iPhone enlarges some text in landscape: the sizes stay those
   the page sets. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Nor does it grey what is tapped: the pressed states of the buttons are
     the only feedback, as with a mouse. */
  -webkit-tap-highlight-color: transparent;
}
/* Below 360px, where the viewport could not be widened to 360px (a narrow
   desktop window, a simulator; on a phone, the head's script lays the page
   out 360px wide), the page keeps 360px and scrolls sideways. */
@media (max-width: 359.98px) {
  html {
    min-width: 360px;
  }
}
:root {
  --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4.5 4.5 8.5-9.5'/%3E%3C/svg%3E");
  font-family: var(--face-ui);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --check-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23161b2b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4.5 4.5 8.5-9.5'/%3E%3C/svg%3E");
  }
}

* {
  box-sizing: border-box;
}
/* Text drawn "antialiased", as the documentation (Starlight) draws it:
   finer on macOS than the browser's default, and the same on both. */
body {
  margin: 0;
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
button,
select,
textarea,
input {
  font: inherit;
  color: inherit;
}
button,
select {
  cursor: pointer;
}
/* Links keep their blue, hovered or not, as in the documentation. The 2px
   underline is faint at rest and takes the link's own colour on hover. */
a,
.link-button,
.reset-note button {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in oklab, currentColor 35%, transparent);
  transition: text-decoration-color 0.15s ease;
}
a:hover,
.link-button:hover,
.reset-note button:hover {
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
/* Links to other sites open in a new tab; the mark says so. */
.external-tail {
  white-space: nowrap;
}
.external-mark {
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-left: 0.2em;
  vertical-align: -0.05em;
  background: currentColor;
  mask: var(--icon-external-link) center / contain no-repeat;
}
/* A button that unfolds a list: the chevron turns when it is open. */
.disclosure-mark {
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-left: 0.25em;
  vertical-align: -0.05em;
  background: currentColor;
  mask: var(--icon-chevron-down) center / contain no-repeat;
  transition: transform 0.15s;
}
[aria-expanded="true"] .disclosure-mark {
  transform: rotate(180deg);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
code {
  font-family: var(--face-code);
  font-size: 0.92em;
}
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.hint {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}
.button.small {
  min-height: 40px;
  padding: 0 12px;
}
.button.primary {
  border-color: var(--link);
  background: var(--link);
  color: var(--surface);
}
/* Copy, in the target's field: the main action there, in its orange. */
.button.target {
  border-color: var(--to-strong);
  background: var(--to-strong);
  color: var(--surface);
}
.button:disabled {
  opacity: 0.5;
  cursor: default;
}
/*
 * Button states, as in the documentation. On hover, a secondary button's
 * line darkens and a primary button's colour deepens (--link-hover);
 * pressed, a secondary button takes a tint of the ink (--press), a primary
 * one deepens further (--link-press), and the action buttons shrink, then
 * spring back (--squish, --ease-bounce): flat at rest, as the whole
 * identity. Hover only where a pointer hovers: on a touch screen, a tapped
 * button would keep it.
 */
.button,
.menu-button,
.add-option,
.pill-remove,
.option-back,
.segments label {
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    color 0.15s ease,
    scale 0.32s var(--ease-bounce);
}
@media (hover: hover) {
  .button:hover:not(:disabled),
  .menu-button:hover {
    border-color: var(--muted);
  }
  .button.primary:hover:not(:disabled) {
    border-color: var(--link-hover);
    background: var(--link-hover);
  }
  .button.target:hover:not(:disabled) {
    border-color: var(--to-strong-hover);
    background: var(--to-strong-hover);
  }
  .segments label:not(:has(input:checked), .detected):hover {
    color: var(--ink);
  }
}
.button:active:not(:disabled),
.menu-button:active {
  background-color: var(--press);
}
.button.primary:active:not(:disabled) {
  border-color: var(--link-press);
  background: var(--link-press);
}
.button.target:active:not(:disabled) {
  border-color: var(--to-strong-press);
  background: var(--to-strong-press);
}
@media (prefers-reduced-motion: no-preference) {
  .button:active:not(:disabled),
  .menu-button:active,
  .add-option:active {
    scale: var(--squish);
    transition:
      border-color 0.15s ease,
      background-color 0.15s ease,
      color 0.15s ease,
      scale 0.06s ease-in;
  }
}

/* Layout */
/*
 * Three spaces: tight between what belongs together (the name and the
 * introduction, the fields and their verdict, the verdict and its details),
 * the usual one between the parts of the converter, and a wider one before
 * the tabs and the footer, which are parts of their own.
 */
:root {
  --space-tight: 16px;
  --space: 28px;
  --space-section: 56px;
}
@media (max-width: 640px) {
  :root {
    --space-tight: 12px;
    --space: 20px;
    --space-section: 40px;
  }
}
.shell {
  display: flex;
  flex-direction: column;
  gap: var(--space);
  max-width: 1200px;
  margin: 0 auto;
  /* As much room under the footer as over the masthead. */
  padding: 32px clamp(16px, 4vw, 48px);
}
/* The masthead and the introduction, spaced as the rest of the page. */
.page-head {
  display: flex;
  flex-direction: column;
  gap: inherit;
}
main {
  display: flex;
  flex-direction: column;
  gap: var(--space);
}
.verdict,
.diagnostics {
  margin-top: calc(var(--space-tight) - var(--space));
}
main > .settings,
footer {
  margin-top: calc(var(--space-section) - var(--space));
}

/* Masthead */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}
.identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.identity img {
  display: block;
  flex: none;
}
h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  font-variation-settings: "opsz" 72;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--from);
}
h1 span {
  color: var(--to);
}
.product {
  padding: 6px 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-left: auto;
  font-size: 15px;
  font-weight: 500;
}
.links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
/* Documentation, the playground's companion, in bold, as the
   documentation's header sets Playground. */
.links .documentation {
  font-weight: 700;
}
.links a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
/* Reset and Share act on the whole page: they sit together, top right. */
.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.share,
.reset,
.copy-action {
  position: relative;
}
/*
 * The notes of the Share, Copy and Reset buttons: centred under the button,
 * with a pointer, in a tint darker than the page, so as not to read as one
 * of the raised pickers.
 */
.note,
.reset-note {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 2;
  width: max-content;
  max-width: 280px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--tip);
  font-size: 15px;
  line-height: 21px;
  text-align: center;
  /*
   * Moved left by --nudge when it would leave the page (placeNote). With
   * `translate`, not `transform`, so that `scale` grows it from its pointer.
   */
  translate: calc(-50% - var(--nudge, 0px)) 0;
}
.note::before,
.reset-note::before {
  content: "";
  position: absolute;
  top: -6px;
  left: calc(50% + var(--nudge, 0px));
  width: 10px;
  height: 10px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--tip);
  transform: translateX(-50%) rotate(45deg);
}
/*
 * A note comes in as the buttons spring back: it fades in while it grows
 * from 96% to its size with the buttons' overshoot (--ease-bounce, 320ms),
 * from its pointer; it leaves faster (120ms), shrinking a little as it
 * fades. Shown on hover and keyboard focus (Share's), or after a click,
 * unless dismissed.
 */
.note {
  visibility: hidden;
  opacity: 0;
  scale: var(--squish);
  transform-origin: calc(50% + var(--nudge, 0px)) top;
  transition:
    opacity 0.12s ease-in,
    scale 0.12s ease-in,
    visibility 0s linear 0.12s;
}
.share:hover .share-note,
.share:has(#share:focus-visible) .share-note,
.share.shown .share-note,
.copy-action.shown .copy-note {
  visibility: visible;
  opacity: 1;
  scale: 1;
  transition:
    opacity 0.16s ease-out,
    scale 0.32s var(--ease-bounce),
    visibility 0s;
}
.share.dismissed #share-help {
  visibility: hidden;
  opacity: 0;
  scale: var(--squish);
  transition:
    opacity 0.12s ease-in,
    scale 0.12s ease-in,
    visibility 0s linear 0.12s;
}
/* A note already shown that takes a new message (Share's help, then "Link
   copied"; a second copy) comes in again, as the button springs back,
   rather than changing under the pointer. */
@keyframes note-in {
  from {
    opacity: 0;
    scale: var(--squish);
  }
}
.note.renewed {
  animation: note-in 0.32s var(--ease-bounce);
}
.copy-action svg[hidden] {
  display: none;
}
/* A bridge over the gap, so that the pointer can reach the note. */
.share-note::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 14px;
}
.share svg[hidden] {
  display: none;
}
/*
 * The note of Reset shows while its Undo is offered. It comes in as the
 * other notes do; it leaves at once, its text gone with the offer.
 */
.reset-note {
  transform-origin: calc(50% + var(--nudge, 0px)) top;
  transition:
    opacity 0.16s ease-out,
    scale 0.32s var(--ease-bounce);
}
@starting-style {
  .reset-note {
    opacity: 0;
    scale: var(--squish);
  }
}
.reset-note:empty {
  display: none;
}
/* The two rules that hide Share's note name it by its id: the rule that
   shows it on keyboard focus names the button by its own. */
/* One note at a time in the header: while Reset's offers Undo, Share's help
   waits, rather than lying over it; a click on Share ends the offer
   (`share`), and a click on Reset ends Share's message (`resetAll`). */
.page-actions:has(.reset-note:not(:empty)) .share:not(.shown) #share-help {
  visibility: hidden;
  opacity: 0;
  scale: var(--squish);
  transition:
    opacity 0.12s ease-in,
    scale 0.12s ease-in,
    visibility 0s linear 0.12s;
}
.reset-note button {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.share-done {
  color: inherit;
}
/* Half the width, clear of the links and the Share button. */
.intro {
  max-width: max(55%, 340px);
  text-wrap: pretty;
  margin: calc(var(--space-tight) - var(--space)) 0 0;
  font-size: 18px;
  line-height: 27px;
  color: var(--muted);
}

/* The sentence: Convert [source] to [target] following [standard] */
.controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* The option picker's room for its longer lists (`makeRoom()`). */
  padding: 20px 22px calc(20px + var(--picker-room, 0px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
}
.sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
/*
 * "to" stays with the targets when the line wraps. Where the lines have
 * room, they share four columns spread over the width: the words, the
 * source and the standard, "to" and "with", the targets and the options.
 * The space goes between the columns, and the groups keep their own width.
 */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.target-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}
.option-cell {
  display: contents;
}
/*
 * From a tablet on, the words and the settings share a grid: two columns,
 * each word beside its setting, then, where the lines have room, four.
 */
@media (min-width: 641px) {
  .settings-grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    /* The words sit on the line of the text beside them, the first line
       of options included. */
    align-items: baseline;
    gap: 16px 24px;
  }
  /* The standard spans the column of the sources. */
  .settings-grid .chip-select.standard select {
    width: 100%;
  }
  .settings-grid .sentence,
  .settings-grid .target-group,
  .settings-grid .option-line,
  .settings-grid .option-line .group {
    display: contents;
  }
  .settings-grid .segments {
    flex-wrap: nowrap;
  }
  /* The options wrap within the column of the targets. */
  .option-cell {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    width: 0;
    min-width: 100%;
  }
  .same-format-hint {
    grid-column: 1 / -1;
  }
  /* How the source is written sits under the sources, on a line of its
     own: the standard starts the next one. */
  .settings-grid .source-line {
    display: contents;
  }
  .settings-grid .source-line .chip-select {
    grid-column: 2;
  }
  .settings-grid .source-line .chip-select select {
    width: 100%;
  }
  .settings-grid .option-line .group > .word {
    grid-column: 1;
  }
}
/* Two columns: the formats span theirs, as the menus do. */
@media (min-width: 641px) and (max-width: 1099px) {
  .settings-grid .segments {
    display: flex;
  }
  .settings-grid .segments label {
    flex: 1;
    justify-content: center;
  }
}
@media (min-width: 1100px) {
  .settings-grid {
    grid-template-columns: repeat(4, auto);
    justify-content: space-between;
  }
}
/* How a transliteration in the source is written, when that matters. */
.source-line {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}
.settings-grid .source-line[hidden] {
  display: none;
}
.source-line .chip-select {
  min-width: 0;
}
/* The second line: the standard, then the options. */
.option-line .group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}
.option-line .group .chip-select {
  min-width: 0;
}
.word {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}
.chip-select {
  position: relative;
  display: inline-flex;
  max-width: 100%;
}
.chip-select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  background: currentColor;
  mask: var(--icon-chevron-down) center / contain no-repeat;
  pointer-events: none;
}
.chip-select select {
  min-height: 44px;
  max-width: 100%;
  padding: 0 38px 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 16px;
  font-weight: 700;
  text-overflow: ellipsis;
  appearance: none;
}
.chip-select select:disabled {
  color: var(--muted);
  cursor: default;
}
.chip-select:has(select:disabled)::after {
  opacity: 0.4;
}
.chip-select.standard select {
  font-weight: 600;
}
.sources {
  --accent: var(--from);
}
.targets {
  --accent: var(--to);
}
/*
 * The controls of the conversion are as its menus: 44px high, their text
 * at 16px, their frame of 1.5px. So are a group of formats, its frame and
 * padding included (35px a label), and the button that adds an option,
 * with its pills, whose names are smaller. The groups of the panels (Code,
 * Canonical document) follow. In the panel of the characters, the buttons
 * and the pills are small (.small, 40px, at 15px), as the buttons of the
 * fields.
 */
.segments {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  /* 44px whatever whole pixels the screen draws the frame on. */
  min-height: 44px;
  padding: 3px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.segments label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 35px;
  padding: 0 14px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.segments input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segments label:has(input:checked),
.segments label.detected {
  border-color: var(--accent);
  background: var(--raised);
  font-weight: 700;
  color: var(--ink);
}
/*
 * Each format keeps at least the width of its selected form, bold and with
 * its square, so that the group does not change width as the selection
 * moves: a hidden copy of the label, stacked with it, sets that width. The
 * name, and the square before it when selected, are centred.
 */
.segments label {
  position: relative;
  display: inline-grid;
}
.segments label > span {
  display: inline-flex;
  grid-area: 1 / 1;
  align-items: center;
  justify-self: center;
}
.segments label::after {
  content: attr(data-label);
  grid-area: 1 / 1;
  height: 0;
  padding-left: 18px;
  overflow: hidden;
  font-weight: 700;
  visibility: hidden;
}
.segments label:has(input:checked) > span:first-of-type::before,
.segments label.detected > span:first-of-type::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 3px;
  background: var(--accent);
}
/* Detected rather than chosen: a dashed border, the text in the source
   colour. */
.sources label.detected {
  border-style: dashed;
  color: var(--from);
}
.segments label:has(input:focus-visible) {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
/* Options: one pill per departure from the standard, then a picker */
.option-line {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
/* The pills flow with "with" and the button, on the same lines. */
.option-pills {
  display: contents;
  margin: 0;
  padding: 0;
  list-style: none;
}
.option-pills[hidden] {
  display: none;
}
.option-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
}
.option-pill.idle {
  border-style: dashed;
  color: var(--muted);
}
.pill-name {
  color: var(--muted);
  font-size: 15px;
}
.pill-value {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  font-weight: 700;
}
.pill-value::after {
  content: "";
  width: 6px;
  height: 6px;
  margin: -3px 2px 0 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.pill-value select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  /* At least 16 px, or iOS zooms in on the menu. */
  font-size: 16px;
  cursor: pointer;
}
.pill-value:has(select:focus-visible) {
  border-radius: 6px;
  outline: 2px solid var(--link);
  outline-offset: 1px;
}
.pill-remove {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
}
@media (hover: hover) {
  .pill-remove:hover {
    background: var(--raised);
    color: var(--ink);
  }
}
.pill-remove:active {
  background: var(--press);
  color: var(--ink);
}
.pill-remove .icon {
  width: 16px;
  height: 16px;
}
.add-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px 0 10px;
  border: 1.5px dashed var(--to);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}
.add-option.small,
.option-pill.small {
  min-height: 40px;
  font-size: 15px;
}
.add-option[aria-expanded="true"] {
  border-style: solid;
}
@media (hover: hover) {
  .add-option:hover {
    border-style: solid;
  }
}
/* Same format on both sides and nothing set yet: the options are the point. */
.add-option.prompt {
  border-style: solid;
  background: color-mix(in srgb, var(--to) 12%, transparent);
}
.add-option .icon {
  width: 16px;
  height: 16px;
  color: var(--to);
}
.same-format-hint {
  flex-basis: 100%;
}
/*
 * The picker floats under its button; for longer lists of values, the
 * settings make room for it, so that the output stays in view.
 */
.option-picker {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(360px, 100%);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
  box-shadow: var(--shadow);
}
.option-picker[hidden] {
  display: none;
}
.option-picker input[type="text"] {
  min-height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 16px;
}
.option-picker input[type="text"]:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 0;
}
.option-step {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 2px 4px;
  font-size: 14px;
  font-weight: 600;
}
.option-step[hidden] {
  display: none;
}
.option-back {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: -4px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
}
@media (hover: hover) {
  .option-back:hover {
    background: var(--code-bg);
    color: var(--ink);
  }
}
.option-back:active {
  background: var(--press);
  color: var(--ink);
}
.option-back .icon {
  width: 18px;
  height: 18px;
}
.option-list {
  max-height: 300px;
  overflow: auto;
}
/* The active value shows where the keyboard is. */
.option-list:focus {
  outline: none;
}
.option-group {
  padding: 8px 8px 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.option-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}
.option-item + .option-item {
  margin-top: 3px;
}
/* The pointer gets a softer tint than the active item, which the keyboard
   and Enter act on. */
.option-item:hover {
  background: var(--code-bg);
}
.option-item[aria-selected="true"] {
  background: var(--surface);
}
.option-item > span:first-child {
  flex: none;
  white-space: nowrap;
}
.option-values {
  min-width: 0;
  overflow: hidden;
  font-family: var(--face-code);
  font-size: 12px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.option-example {
  /* Room for the breathing and accent of a capital, which Literata draws
     left of the letter, where the clip would cut them. */
  padding-left: 0.4em;
  overflow: hidden;
  font-family: var(--face-text);
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.option-standard {
  color: var(--muted);
  cursor: default;
}
.option-standard:hover {
  background: none;
}
.option-tag {
  margin-left: 8px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}
.option-empty {
  padding: 8px;
  font-size: 14px;
  color: var(--muted);
}
.preset-line strong {
  font-weight: 600;
  color: var(--ink);
}
.preset-line p {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}
.preset-line .link-button {
  padding: 0;
  border: none;
  background: none;
  font-size: inherit;
  cursor: pointer;
}
.preset-limits {
  margin: 10px 0 0;
  padding-left: 24px;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}
.preset-limits li + li {
  margin-top: 4px;
}
/* One typeface for the texts, whatever their format */
.face-greek,
.face-transliteration,
.face-beta-code {
  font-family: var(--face-text);
  font-weight: 400;
}

/* The two fields: the source in cobalt, the target in orange */
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px 20px 20px;
  border: 2px solid var(--from);
  border-radius: var(--radius);
  background: var(--raised);
}
/* The result reads on the ground of the code: written by the conversion,
   selectable, not typed in. */
.field.to {
  border-color: var(--to);
  background: var(--code-bg);
}
/*
 * The label and the buttons share the head of the field; only on a phone do
 * the buttons move under the label.
 */
/* The buttons go under the label when the field is too narrow for both. */
.field-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.field-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.field-label::before,
.field-label .label {
  flex: none;
}
.field-label::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--from);
}
.field.to .field-label::before {
  background: var(--to);
}
.field-label .label {
  color: var(--ink);
}
.meta {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
/*
 * The character count sits on the line of the resize handle, at the left
 * edge of the text; the text keeps that line free (padding-bottom of
 * `.text`).
 */
.field-foot {
  position: absolute;
  bottom: 0;
  left: 16px;
  margin: 0;
  line-height: 14px;
  pointer-events: none;
}
.field-foot:empty {
  display: none;
}
/* Typing in the result says where to write, in place of its count. */
.field-tip {
  bottom: -5px;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: var(--tip);
  color: var(--ink);
  font-size: 14px;
  line-height: 18px;
}
.editor:has(.field-tip:not(:empty)) #output-meta {
  visibility: hidden;
}
.field-actions {
  flex: none;
  display: flex;
  gap: 8px;
}
/*
 * A menu drawn as a button: the native menu, transparent, lies over it, so
 * that it keeps the keyboard, the platform's list and what screen readers
 * announce.
 */
.menu-button {
  position: relative;
}
.menu-button::after {
  content: "";
  width: 0.75em;
  height: 0.75em;
  margin-left: 0.1em;
  background: currentColor;
  mask: var(--icon-chevron-down) center / contain no-repeat;
}
.menu-button select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  /* At least 16 px, or iOS zooms in on the menu. */
  font-size: 16px;
  cursor: pointer;
}
.menu-button:has(select:focus-visible) {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
/*
 * The source sits over a copy of itself in which the letters that lose a
 * distinction are underlined; both must lay out the text identically.
 */
.editor {
  position: relative;
  display: grid;
  /* The field fills the height the grid gives it: that of the longer text. */
  flex: 1;
}
/*
 * Literata draws the breathings and accents of a capital to the left of the
 * letter (Ἕ): the text keeps room for them, and the editor gives that room
 * back so that the text still lines up with the field's label.
 */
.editor {
  margin-left: -16px;
}
.text {
  grid-area: 1 / 1;
  align-self: stretch;
  width: 100%;
  min-height: 220px;
  margin: 0;
  padding: 0 0 28px 16px;
  border: 0;
  background: transparent;
  --text-size: 28px;
  font-size: var(--text-size);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  resize: vertical;
  /* The field grows with its text where browsers allow it. */
  field-sizing: content;
}
.text:focus-visible {
  outline: none;
}
.field:focus-within {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}
.field.to:focus-within {
  outline-color: var(--to);
}
/*
 * While the field is empty, it takes the face and size of its placeholder,
 * so that the caret matches it; the first letter typed brings the text's
 * own face and size back.
 */
textarea.text:placeholder-shown {
  font-family: var(--face-ui);
  font-size: 18px;
  font-weight: 400;
  /* The line keeps the text's height, so that the first line stays put. */
  line-height: calc(var(--text-size) * 1.6);
}
textarea.text::placeholder {
  color: var(--muted);
}
.marks {
  overflow: hidden;
  color: transparent;
  pointer-events: none;
  resize: none;
}
/*
 * Both marks are drawn as backgrounds in the padding under the text, so that
 * the solid line and the dots share one line in every browser: a text
 * decoration sits on the baseline, a background on the descent, and the two
 * drift apart from one browser or font to another. Each is centred 3 px
 * above the bottom of the padding.
 */
.marks mark {
  padding-bottom: 6px;
  background: linear-gradient(var(--to), var(--to)) 0 calc(100% - 1.5px) /
    100% 3px no-repeat;
  color: transparent;
}
/*
 * Copied as is, but read back as Greek: nothing of the Greek is lost. The
 * dots are a pattern, regular in every browser.
 */
.marks mark.literal {
  background: radial-gradient(
    circle,
    var(--from) 1.5px,
    transparent 2px
  ) 0 100% / 8px 6px;
  /* Whole dots only: the spacing gives way at the end of a word. */
  background-repeat: space no-repeat;
}
/*
 * A mark Greek does not allow: short dashes in the colour of the text,
 * whole and evenly spaced, on the line of the others.
 */
.marks mark.invalid {
  background: linear-gradient(90deg, var(--ink) 0 7px, transparent 7px)
    50% calc(100% - 1.5px) / 11px 3px;
  background-repeat: space no-repeat;
}
/* What the value under preview changes in the output */
.marks mark.preview {
  padding-bottom: 0;
  border-radius: 4px;
  background: color-mix(in srgb, var(--to) 20%, transparent);
}
.marks mark.literal.single {
  background-position: 50% 100%;
  background-repeat: no-repeat;
}

/* The verdict: the halves of the tessera meet when nothing is lost */
/* The tessera stands on the first line of the verdict, however many wrap. */
.verdict {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.tessera {
  width: 32px;
  height: 32px;
  flex: none;
  margin-top: -4px;
}
.tessera .grec {
  fill: var(--from);
}
.tessera .latin {
  fill: var(--to-fill);
}
.tessera .half {
  transition: transform 0.2s ease;
}
.verdict.lossy .grec {
  transform: translateX(-2px);
}
.verdict.lossy .latin {
  transform: translateX(2px);
}
.verdict.error .tessera,
.verdict.empty .tessera {
  opacity: 0.35;
}
#status {
  margin: 0;
  font-size: 17px;
  line-height: 24px;
}
#status strong {
  font-weight: 700;
}

/* What a conversion loses */
.diagnostics {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Hidden, the diagnostics take no space, not even the gap before them. */
.diagnostics[hidden] {
  display: none;
}
/* A heading closer to its cards than to the group above. */
.diagnostics h2 {
  margin: 16px 0 -4px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.diagnostics ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.diagnostics li {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
}
.diagnostics h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}
.diagnostics p {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}
.diagnostics .letters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 44px;
  padding: 0 6px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--face-text);
  font-size: 26px;
  line-height: 1;
}
.diagnostics .more {
  align-self: center;
  font-size: 14px;
  color: var(--muted);
}
.diagnostics .code-name {
  font-family: var(--face-code);
  font-size: 12px;
  color: var(--muted);
}

/* Settings and output, in tabs */
.settings {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--raised);
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}
/* Each tab is as wide as its bold label, so that choosing one moves none. */
.tabs [role="tab"] {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-bottom: -1px;
  padding: 0 4px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}
.tabs [role="tab"]::after {
  content: attr(data-label);
  height: 0;
  overflow: hidden;
  font-weight: 700;
  visibility: hidden;
}
.tabs [role="tab"][aria-selected="true"] {
  border-bottom-color: var(--link);
  font-weight: 700;
  color: var(--ink);
}
@media (hover: hover) {
  .tabs [role="tab"]:hover {
    color: var(--ink);
  }
}
.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px 24px;
}
.panel[hidden] {
  display: none;
}
.panel > label {
  font-weight: 600;
}
.panel > label .hint {
  display: block;
  margin-top: 2px;
  font-weight: 400;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
/* The text of a panel's head wraps beside its controls, which keep the
   top right of the panel, rather than pushing them to a line of their
   own; on a phone they go under it. */
.panel-head > .hint {
  flex: 1 1 20rem;
  max-width: 680px;
}
pre.code {
  max-height: 480px;
  margin: 0;
  padding: 18px 20px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
  font-family: var(--face-code);
  font-size: 14px;
  line-height: 23px;
  /* Medium (500), as the documentation's code; keywords and functions
     bold (700). */
  font-weight: 500;
}
pre.code code {
  font-size: inherit;
}
.tok-keyword {
  font-weight: 700;
  color: var(--code-keyword);
}
.tok-string {
  color: var(--code-string);
}
.tok-number {
  color: var(--code-keyword);
}
.tok-function {
  font-weight: 700;
  color: var(--code-function);
}
/* Object keys and punctuation keep the ink: only comments are muted. */
.tok-comment {
  font-style: italic;
  color: var(--code-muted);
}
/* The document's views and the languages of the code: two segments, in the
   blue and the orange of the logo and of the fields, as the formats are. */
.views label:first-of-type,
.languages label:first-of-type {
  --accent: var(--from);
}
.views label:last-of-type,
.languages label:last-of-type {
  --accent: var(--to);
}
/*
 * Copy, in the top right corner of the code, as in the documentation's code
 * blocks: an icon on the code's ground, which covers the code under it.
 * Where a pointer hovers, it shows when the code is hovered or focused, or
 * while its note is shown.
 */
.code-frame {
  position: relative;
}
.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
}
.code-copy .button {
  justify-content: center;
  width: 40px;
  min-height: 40px;
  padding: 0;
  background: var(--code-bg);
}
/* Its note hangs from the button's right edge, within the code, rather than
   centred under it, where it would leave the code's frame. */
.code-copy .note {
  right: 0;
  left: auto;
  translate: 0 0;
  transform-origin: calc(100% - 20px) top;
}
.code-copy .note::before {
  right: 20px;
  left: auto;
  transform: translateX(50%) rotate(45deg);
}
@media (hover: hover) {
  .code-copy .button {
    opacity: 0;
    transition:
      opacity 0.2s ease,
      border-color 0.15s ease,
      background-color 0.15s ease,
      scale 0.32s var(--ease-bounce);
  }
  .code-frame:hover .code-copy .button,
  .code-frame:focus-within .code-copy .button,
  .code-copy.shown .button {
    opacity: 1;
  }
}
/*
 * The canonical document as a table: in a frame of the code's ground, as
 * the JSON, which scrolls both ways with its head kept in view. Every cell
 * is in code, the text read as the values, which are written as the JSON
 * writes them; only validation's messages, which are sentences, are in the
 * face of the interface. An empty cell shows a muted dash, read "none"; a
 * token that validation rejects has its number in red (--error).
 */
.document-table {
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
}
.document-table[hidden] {
  display: none;
}
.document-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--face-code);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}
.document-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--code-bg);
  font-family: var(--face-ui);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
}
.document-table td {
  padding: 6px 14px;
  border-top: 1px solid var(--line);
  vertical-align: baseline;
  line-height: 24px;
  white-space: nowrap;
}
/* Each column fits its content; the last takes the width left. */
.document-table :is(th, td):not(:last-child) {
  width: 1%;
}
.document-table tbody tr:first-child td {
  border-top: 0;
}
.document-table td:empty::before {
  content: "—" / "none";
  color: var(--muted);
}
.document-table .index,
.document-table .kind,
.document-table .read.blank {
  color: var(--muted);
}
.document-table .validation {
  min-width: 18em;
  white-space: normal;
  font-family: var(--face-ui);
  font-weight: 400;
}
/* The row hovered, or tapped (`active`, one at a time), takes a tint: in
   the light theme the page's beige, as the pickers' items take it; in the
   dark, a tint of the source's colour, the document being the input as
   read. */
.document-table {
  --row-active: var(--surface);
}
@media (prefers-color-scheme: dark) {
  .document-table {
    --row-active: color-mix(in oklab, var(--from) 10%, var(--code-bg));
  }
}
.document-table tbody tr {
  cursor: default;
}
.document-table tbody td {
  transition: background-color 0.15s;
}
@media (hover: hover) {
  .document-table tbody tr:hover td {
    background: var(--row-active);
  }
}
.document-table tbody tr.active td {
  background: var(--row-active);
}
.document-table tr.invalid .index {
  font-weight: 700;
  color: var(--error);
}
.document-limit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.document-limit[hidden] {
  display: none;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
}
/*
 * Check boxes and radio buttons in the colours of the page, not the
 * system's: 24 px targets (WCAG 2.2), the source colour once checked.
 */
.check input,
.picker-formats input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 1.5px solid var(--muted);
  border-radius: 5px;
  background: var(--raised) center / 20px no-repeat;
  appearance: none;
  cursor: pointer;
}
.check input:checked {
  border-color: var(--link);
  background-color: var(--link);
  background-image: var(--check-icon);
}
.picker-formats input {
  border-radius: 50%;
}
.picker-formats input:checked {
  border-color: var(--link);
  background-image: radial-gradient(
    circle,
    var(--link) 0 6px,
    transparent 6.5px
  );
}
.check input:focus-visible,
.picker-formats input:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
/* The character inventory: rows of pills, as for the options */
.inventory {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* The words share a column, so that the pills start on one line and wrap
   under one another, never under the word. The column is measured in the
   row's em (16px), not the words' (18px): 10em holds "New characters" on
   one line (137px), with room to spare for other renderings. */
.inventory-row {
  display: grid;
  grid-template-columns: 10em minmax(0, 1fr);
  align-items: baseline;
  gap: 10px 12px;
}
.inventory-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
.inventory-pills > .option-pills {
  display: contents;
}
.pill-text {
  padding: 6px 0;
  white-space: nowrap;
}
.picker-search,
.picker-field input {
  min-height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 16px;
}
.picker-search:focus-visible,
.picker-field input:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 0;
}
.picker-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px;
}
.picker-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}
.picker-field input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  font-family: var(--face-text);
  font-weight: 400;
}
.picker-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.picker-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 15px;
}
.picker-formats label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* Scrolled into view with a margin, not against the edge of the window. */
.option-picker {
  scroll-margin: 24px;
}
/* A form opens in the page, under its row, rather than over it. */
.option-picker.inline {
  position: static;
  box-shadow: none;
}
/* A new character's form needs the room of its two columns. */
.option-picker.wide {
  width: min(480px, 100%);
}
.picker-form .check {
  align-items: center;
}

.picker-form .button {
  align-self: flex-start;
}

/* Footer: the scope of the presets faces the package */
footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 32px;
  padding-top: 24px;
  border-top: 1.5px solid var(--line);
}
footer p {
  max-width: 620px;
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}
footer .package {
  text-align: right;
}
/* A line for each distribution: the TypeScript package, the Python one. */
footer .package > span {
  display: block;
}
footer strong {
  color: var(--ink);
}

/* When the masthead has no room for one line (fitMasthead), the links go
   under the name, and Share stays beside it. */
.masthead.stacked .links {
  margin-left: 0;
  order: 3;
  width: 100%;
}
.masthead.stacked .page-actions {
  margin-left: auto;
}
/* Still no room beside the name: Reset and Share keep their icons, and their
   names for screen readers. */
.masthead.compact {
  column-gap: 12px;
}
.masthead.compact .page-actions .button {
  width: 44px;
  padding: 0;
  justify-content: center;
}
.masthead.compact .page-actions .button-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* With the settings in one column, the introduction takes the width. */
@media (max-width: 1099px) {
  .intro {
    max-width: none;
  }
}
/*
 * Without a pointer to hover with, the state of the source format shows
 * under the verb, or beside it on a phone (showDetection): it says what the
 * titles say on hover, that choosing a format again detects it.
 */
.verb-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.source-state {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 400;
  line-height: 16px;
  color: var(--muted);
  white-space: nowrap;
}
/* As wide as its longest text in every state, so that nothing moves. */
.source-state::after {
  content: "tap again to detect";
  height: 0;
  overflow: hidden;
  visibility: hidden;
}
.source-state:empty {
  display: none;
}
/* A narrow phone: a smaller name, so that the buttons fit beside it, and
   closer links, on one line. */
@media (max-width: 380px) {
  .identity h1 {
    font-size: 20px;
  }
  .masthead .links {
    column-gap: 16px;
  }
}
/* A narrow tablist: the canonical document is called the document. */
@media (max-width: 440px) {
  .tabs {
    gap: 4px 18px;
    padding: 0 16px;
  }
  .tabs [role="tab"] .tab-full {
    display: none;
  }
  .tabs [role="tab"][data-short]::after {
    content: attr(data-short);
  }
}
@media (min-width: 441px) {
  .tabs [role="tab"] .tab-short {
    display: none;
  }
}
@media (max-width: 640px) {
  /* The settings in one column: each word over its setting. */
  .settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .settings-grid .sentence,
  .settings-grid .target-group,
  .settings-grid .source-line,
  .settings-grid .option-line,
  .settings-grid .option-line .group {
    display: contents;
  }
  .settings-grid .word {
    margin-top: 10px;
    font-size: 16px;
  }
  .verb-cell {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
  }
  .settings-grid #verb {
    margin-top: 0;
  }
  .settings-grid .chip-select select {
    width: 100%;
  }
  .option-cell {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
  }
  .same-format-hint {
    margin-top: 6px;
  }
  /* The characters: each word over its pills. */
  .inventory-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .inventory-row > .word {
    font-size: 16px;
  }
  .diagnostics h2 {
    font-size: 20px;
  }
  .diagnostics ul {
    gap: 12px;
  }
  .diagnostics li {
    gap: 10px;
    padding: 16px;
  }
  /* The code wraps rather than scroll sideways. */
  pre.code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .shell {
    padding-block: 20px;
  }
  h1 {
    font-size: 22px;
  }
  /* The name over the product label, beside the symbol. */
  .identity {
    display: grid;
    grid-template-columns: auto auto;
    column-gap: 10px;
    row-gap: 4px;
  }
  .identity picture {
    grid-row: span 2;
  }
  .identity img {
    width: 40px;
    height: 40px;
  }
  .product {
    justify-self: start;
    padding: 0;
    border: 0;
  }
  .target-group {
    width: 100%;
  }
  .target-group .segments {
    flex: 1;
    min-width: 0;
  }
  .segments {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
  }
  .segments label {
    flex: auto;
    white-space: nowrap;
    justify-content: center;
    padding: 0 8px;
  }
  /* No room for the square: the border marks the format. */
  .segments label::after {
    padding-left: 0;
  }
  /* Below 375px, the formats are smaller, to hold on one line. */
  @media (max-width: 374px) {
    .segments label {
      font-size: 15px;
    }
  }
  .segments label:has(input:checked) > span:first-of-type::before,
  .segments label.detected > span:first-of-type::before {
    display: none;
  }

  .intro {
    max-width: none;
    font-size: 16px;
    line-height: 24px;
  }
  /* Every block keeps its content 17px from its outer edge, as tight as the
     settings of the conversion: 16px inside a border of 1px, 15px inside the
     fields' border of 2px. */
  .controls {
    padding: 16px;
  }
  .field {
    padding: 15px;
  }
  .panel {
    padding: 16px;
  }
  pre.code {
    padding: 16px;
  }
  .text {
    --text-size: 24px;
    min-height: 96px;
  }
  footer .package {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .note.renewed {
    animation: none;
  }
  .tessera .half,
  .disclosure-mark,
  .note,
  .reset-note,
  .share.dismissed #share-help,
  .page-actions:has(.reset-note:not(:empty)) .share:not(.shown) #share-help,
  .share:hover .share-note,
  .share:has(#share:focus-visible) .share-note,
  .share.shown .share-note,
  .copy-action.shown .copy-note {
    transition: none;
    scale: 1;
  }
}
