:root {
  color-scheme: light;
  --ink: #21183b;
  --muted: #554a6b;
  --accent: #40288f;
  --canvas: #f6f3ff;
  --tint: #eee8fc;
  --line: #cfc3e9;
  --symbols: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", "Segoe UI Emoji", "Apple Color Emoji", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: system-ui, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.55; }
button, textarea { font: inherit; }
a { color: var(--accent); text-underline-offset: .22em; }
:focus-visible { outline: 3px solid #7957c2; outline-offset: 3px; }
.shell { width: min(100% - 48px, 1040px); margin-inline: auto; }
.sr-only, .direction input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip { position: absolute; z-index: 3; top: 8px; left: 10px; padding: 8px 12px; background: #fff; transform: translateY(-150%); }
.skip:focus { transform: none; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner, .footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 66px; flex-wrap: wrap;
}
.topbar a, .footer a { display: inline-flex; align-items: center; min-height: 44px; }
.wordmark { gap: 9px; color: var(--ink); font-size: 20px; font-weight: 780; letter-spacing: -.055em; text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
nav a { color: var(--muted); font-size: 14px; font-weight: 650; text-decoration: none; }
nav a:hover { text-decoration: underline; color: var(--accent); }
.intro { padding: 36px 0 22px; }
h1, h2, p, figure { margin: 0; }
h1 { font-size: clamp(2.125rem, 5.7vw, 4.1rem); line-height: 1.04; font-weight: 810; letter-spacing: -.067em; }
.intro p { margin-top: 12px; color: var(--muted); font-size: clamp(1rem, 2vw, 1.17rem); }
.translator { background: #fff; padding: 20px; border: 1px solid var(--line); border-radius: 19px; }
.direction { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
.direction legend { padding: 0; margin-bottom: 5px; color: var(--muted); font-size: 13px; font-weight: 670; }
.choices { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--canvas); }
.choices label { position: relative; cursor: pointer; }
.choices label > span {
  display: flex; align-items: center; justify-content: center; gap: .32em; min-height: 44px;
  padding: 5px 14px; border-radius: 8px; font-size: 14px; font-weight: 690; white-space: nowrap;
}
.choices input:checked + span { background: var(--accent); color: #fff; }
.choices input:focus-visible + span { outline: 3px solid #7957c2; outline-offset: 2px; }
.scope-note { margin: -3px 0 12px; color: var(--muted); font-size: 13px; }


.editors { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.editor { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.editor-head { padding: 10px 13px; border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 720; font-size: 14px; cursor: text; }
.editor-head label { display: block; cursor: text; }
.result { background: var(--canvas); }
.result .editor-head { background: var(--tint); border-radius: 11px 11px 0 0; }
.editor textarea {
  display: block; width: 100%; min-width: 0; min-height: 156px; flex: 1;
  padding: 11px 13px; color: var(--ink); background: transparent;
  border: 0; border-radius: 0 0 11px 11px; resize: vertical; tab-size: 4;
  font: 17px/1.54 ui-monospace, Consolas, monospace;
}
.editor textarea:focus { outline: 2px solid #7957c2; outline-offset: -2px; }
.editor textarea::placeholder { color: var(--muted); opacity: 1; font: 16px/1.5 system-ui, sans-serif; }
.editor .symbols { font: 23px/1.36 var(--symbols); }
.tool-actions { display: flex; align-items: center; gap: 8px; margin-top: 13px; flex-wrap: wrap; }
.tool-actions button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 7px 13px; color: var(--accent);
  border: 1px solid transparent; border-radius: 9px;
  font-size: 14px; line-height: 1.2; font-weight: 720; cursor: pointer;
}
.tool-actions .primary { margin-inline-start: auto; color: #fff; background: var(--accent); }
.tool-actions .primary:not(:disabled):hover { background: #31206b; }
.tool-actions .secondary { background: #fff; border-color: var(--line); }
.tool-actions .quiet { background: transparent; }
.tool-actions .secondary:not(:disabled):hover, .tool-actions .quiet:not(:disabled):hover { background: var(--tint); }
.tool-actions .primary:disabled { color: #554878; background: #eee8fc; border-color: #e3daf5; }
.tool-actions button:disabled { color: #706685; cursor: default; }
.tool-note { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.tool-note svg { flex: none; }
.tool-warning, .tool-status:not(:empty) { margin-top: 9px; font-size: 14px; }
.tool-warning { padding: 7px 9px; background: #fff3d6; color: #5a3c08; border-radius: 6px; }
.tool-status { color: var(--accent); font-weight: 650; }


.explanation { margin-top: 30px; padding: 22px 0 6px; border-top: 1px solid var(--line); }
.explanation h2 { margin-bottom: 10px; }
.explanation p { max-width: 74ch; margin-top: 10px; color: var(--muted); }
.reference { margin-top: 30px; }
.reference-section { padding: 22px 0; border-top: 1px solid var(--line); scroll-margin-top: 14px; }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); line-height: 1.2; font-weight: 780; letter-spacing: -.035em; }
.steps { margin: 9px 0 0; padding-inline-start: 24px; }
.steps li { margin: 5px 0; }
.steps li::marker { color: var(--accent); font-weight: 750; }
.examples { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 13px; }
.sample { min-width: 0; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.sample figcaption { font-size: 13px; color: var(--muted); font-weight: 675; }
.sample div { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.sample code { font: 17px/1.4 ui-monospace, Consolas, monospace; }
.sample code.symbols { font: 22px/1.4 var(--symbols); }
.sample-arrow { color: var(--accent); }
.mapping-intro { max-width: 74ch; margin-top: 9px; color: var(--muted); }
.mapping-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.mapping-item { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 7px; min-height: 42px; padding: 7px 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.mapping-item code { overflow-wrap: anywhere; font: 15px/1.2 ui-monospace, Consolas, monospace; }
.mapping-item code.symbols { font: 21px/1.2 var(--symbols); text-align: center; }
.mapping-item > span { color: var(--accent); font-weight: 700; }
.faq-list { margin-top: 10px; }
details { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: 12px 0; min-height: 45px; font-weight: 710; }
summary::marker { color: var(--accent); }
details p, .source-note { max-width: 74ch; margin: 0 0 12px; color: var(--muted); }
.source-note { font-size: 14px; margin: 14px 0 0; }
.footer { margin-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; background: #fff; }
.legal-page { width: min(100% - 48px, 720px); padding: 32px 0 34px; min-height: 65vh; }
.legal-page .back { margin-bottom: 12px; }
.legal-page h1 { font-size: clamp(2.1rem, 6vw, 3.25rem); margin-bottom: 17px; }
.legal-page h2 { margin: 22px 0 7px; }
.legal-page p + p { margin-top: 10px; }
@media (max-width: 640px) {
  .shell { width: calc(100% - 28px); }
  .topbar-inner { min-height: 56px; }
  .topbar nav, .footer nav { gap: 8px 13px; }
  .intro { padding: 24px 0 16px; }
  .intro p { margin-top: 9px; }
  .translator { padding: 11px; border-radius: 14px; }
  .choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choices label > span { font-size: clamp(12px, 3.45vw, 14px); padding-inline: 4px; }
  .editors, .examples { grid-template-columns: 1fr; gap: 9px; }
  .mapping-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .mapping-item { padding-inline: 6px; gap: 5px; }
  .editor-head { padding: 7px 10px; }
  .editor textarea { min-height: 105px; height: 105px; flex: none; padding: 8px 10px; }
  .tool-actions { gap: 4px; }
  .tool-actions button { gap: 5px; padding-inline: 8px; }
  .reference { margin-top: 22px; }
  .footer-inner { justify-content: flex-start; gap: 0 18px; padding: 4px 0; }
}
@media (max-width: 345px) {
  .intro { padding: 19px 0 13px; }
  .intro h1 { font-size: 1.75rem; }
  .direction { margin-bottom: 10px; }
  .editor textarea { min-height: 87px; height: 87px; }
  .tool-actions { gap: 3px; }
  .tool-actions button { font-size: 13px; padding-inline: 4px; }
  .tool-actions .primary svg { display: none; }
}