@charset "UTF-8";

@font-face {
  font-family: 'HangulIO Compare';
  src: url('./fonts/hanbase-compare-mono.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* Product layout. The shared editor theme owns all colors and interface fonts. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body.encoder-page { margin: 0; background: var(--site-paper); color: var(--site-ink); font: 14px/1.6 var(--site-font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, select, input { touch-action: manipulation; }
button { cursor: pointer; border: 0; }
button:disabled { cursor: default; opacity: .45; }
h1, h2, h3, p { margin: 0; }
code { font-family: var(--site-mono); }
[hidden] { display: none!important; }
:focus-visible { outline: 2px solid var(--site-accent); outline-offset: 3px; }
.visually-hidden { position: absolute!important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 120; background: var(--site-primary); color: #fff; padding: 8px 16px; }
.skip-link:focus { top: 4px; }

.encoder-sections { display: flex; flex-wrap: wrap; gap: 24px; padding: 7px max(24px, calc((100vw - 1088px)/2)); border-bottom: 1px solid var(--site-line); background: var(--site-inset); color: var(--site-muted); font-size: 12px; }
.encoder-sections a:hover { color: var(--site-accent); }
.section, .footer-inner { max-width: 1184px; margin: auto; padding: 32px 48px; }
.section h2 { font-size: 23px; line-height: 1.3; letter-spacing: -.4px; font-weight: 600; }
.section h3 { font-size: 14px; font-weight: 600; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-heading > p { font-size: 12px; color: var(--site-muted); }
.text-link, .quiet-button { color: var(--site-accent); font-size: 12px; }
.text-link:hover, .quiet-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.quiet-button { padding: 4px 0; background: transparent; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 32px; padding: 6px 12px; border-radius: var(--site-radius); font-size: 12px; font-weight: 600; line-height: 1.5; transition: background .15s; }
.button-dark { background: var(--site-primary); color: #fff; }
.button-dark:hover { background: var(--site-primary-hover); }
.button-outline { border: 1px solid var(--site-line); background: transparent; }
.button-outline:hover { background: var(--site-hover); }
.encoder-intro { padding-top: 26px; padding-bottom: 26px; }
.encoder-intro h1 { font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -1px; margin-bottom: 10px; }
.encoder-intro h1 span { color: var(--site-accent); }
.encoder-intro h2 { font-size: 18px; margin-bottom: 10px; letter-spacing: -.2px; }
.encoder-intro p { max-width: 720px; color: var(--site-muted); font-size: 13px; }
.encoder-intro p + p { margin-top: 10px; }
.encoder-intro .intro-example { color: var(--site-accent); }

/* Text is hashed once, then compared across formats and display variants. */
.converter-section { background: var(--site-surface); border-block: 1px solid var(--site-line); }
.converter-inner { padding-top: 26px; padding-bottom: 24px; }
.converter-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--site-line); margin-bottom: 18px; }
.converter-tabs button { background: transparent; color: var(--site-muted); font-size: 12px; font-weight: 600; padding: 8px 0; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.converter-tabs button[aria-selected="true"] { color: var(--site-accent); border-color: var(--site-accent); }
.converter-input > label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
textarea { display: block; width: 100%; min-width: 0; border: 1px solid var(--site-line); border-radius: var(--site-radius); background: var(--site-document); padding: 10px 12px; resize: vertical; font: 14px/1.8 var(--site-mono); }
#input-data { height: 76px; min-height: 76px; }
.decoder-format-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 12px; }
.decoder-format-row select { min-height: 32px; max-width: 100%; padding: 4px 24px 4px 8px; background: var(--site-document); border: 1px solid var(--site-line); border-radius: var(--site-radius); }
#decoder-input { height: 98px; min-height: 76px; }
#bytes-hex { color: var(--site-muted); }
.input-help { font-size: 11px; color: var(--site-muted); margin-top: 6px; }
.input-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 12px; }
.conversion-hint { margin-top: 9px; font-size: 11px; color: var(--site-muted); }
.font-credit a { color: var(--site-accent); text-decoration: underline; text-underline-offset: 2px; }
summary { cursor: pointer; }
.converter-error { padding: 10px 12px; border-left: 3px solid var(--site-error); background: var(--site-error-surface); color: var(--site-error); font-size: 12px; margin-top: 12px; overflow-wrap: anywhere; }
.representations-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 20px 0 10px; }
#result-status { font-size: 11px; color: var(--site-muted); }
.representation-list { border-top: 1px solid var(--site-line); }
.representation-row { display: grid; grid-template-columns: 110px minmax(0,1fr) 220px; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--site-line); }
.representation-label { min-width: 0; font-size: 12px; word-break: keep-all; }
.representation-label strong { font-size: 12px; font-weight: 600; }
.representation-metrics { text-align: right; color: var(--site-muted); font-variant-numeric: tabular-nums; }
.representation-metrics small { display: block; font-size: 10px; line-height: 1.5; }
.representation-value { min-width: 0; user-select: text; }
.representation-label, .representation-metrics { -webkit-user-select: none; user-select: none; }
.representation-row code { font: 14px/1.8 var(--site-mono); overflow-wrap: anywhere; white-space: pre-wrap; }
#converter textarea, .representation-row code {
  font-family: 'HangulIO Compare', var(--site-mono);
  font-feature-settings: normal;
  font-kerning: none;
  font-variant-ligatures: none;
}
.representation-row code[lang="ko"] { word-break: keep-all; }
.representation-row p { font-size: 12px; color: var(--site-muted); }
.featured { background: var(--site-highlight); padding-inline: 12px; margin-inline: -12px; }
#output-data { color: var(--site-accent); }

/* The mapping comes first; standard library downloads are secondary. */
.library-downloads { max-width: 760px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--site-line); }
.library-downloads p { font-size: 12px; color: var(--site-muted); margin-top: 6px; }
.individual-downloads { display: flex; flex-wrap: wrap; gap: 20px; font-size: 12px; margin-top: 12px; color: var(--site-accent); }
.individual-downloads a:hover { text-decoration: underline; }
.download-code { margin-top: 20px; font-size: 12px; color: var(--site-muted); }
.code-example { margin-top: 12px; background: var(--site-surface); border: 1px solid var(--site-line); border-radius: var(--site-radius); overflow: hidden; }
.code-tabs { display: flex; gap: 24px; align-items: center; border-bottom: 1px solid var(--site-line); padding: 0 18px; min-height: 36px; background: var(--site-inset); }
.code-tabs button { font: 11px var(--site-mono); background: transparent; color: var(--site-muted); height: 36px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.code-tabs button[aria-selected="true"] { color: var(--site-accent); border-color: var(--site-accent); }
.code-tabs > span { font-size: 10px; margin-left: auto; }
.code-example pre { margin: 0; padding: 18px; overflow: auto; font: 11px/1.8 var(--site-mono); scrollbar-width: thin; scrollbar-color: var(--site-line) transparent; }
.syntax-keyword { color: var(--site-accent); }
.syntax-string { color: var(--site-ink); }
.syntax-comment { color: var(--site-muted); }
.code-example-footer { border-top: 1px solid var(--site-line); padding: 10px 18px; display: flex; justify-content: space-between; gap: 12px; font-size: 11px; }
.mapping-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; max-width: 760px; margin-bottom: 8px; }
.mapping-reference { display: flex; flex-wrap: wrap; justify-content: end; gap: 12px; font-size: 11px; color: var(--site-muted); }
.mapping-reference a { color: var(--site-accent); }
.mapping-description { font-size: 12px; color: var(--site-muted); margin-bottom: 10px; }
.mapping-help { font-size: 11px; color: var(--site-muted); margin-bottom: 12px; }
.mapping-scroll { max-width: 760px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--site-line) var(--site-inset); border-block: 1px solid var(--site-line); }
.mapping-table { width: 100%; min-width: 560px; table-layout: fixed; border-collapse: separate; border-spacing: 0; text-align: center; }
.mapping-table th { padding: 5px 3px; font: 10px/1.5 var(--site-mono); color: var(--site-muted); background: var(--site-inset); -webkit-user-select: none; user-select: none; }
.mapping-table th:first-child { width: 32px; }
.mapping-table thead th { position: sticky; top: 0; z-index: 2; }
.mapping-table thead th:first-child { left: 0; z-index: 3; }
.mapping-table tbody th { position: sticky; left: 0; z-index: 1; border-right: 1px solid var(--site-line); border-top: 1px solid var(--site-line); }
.mapping-table td { -webkit-user-select: text; user-select: text; }
.mapping-table td { padding: 3px; border-top: 1px solid var(--site-line); border-right: 1px solid var(--site-line); transition: background .15s; }
.mapping-table td:last-child { border-right: 0; }
.mapping-table td:hover { background: var(--site-hover); }
.mapping-syllable { display: block; font-size: 16px; line-height: 1.25; color: var(--site-accent); }
.mapping-scroll-hint { display: none; }

.faq-section { border-top: 1px solid var(--site-line); }
.faq-section h2 { margin-bottom: 20px; }
.details-list details { border-bottom: 1px solid var(--site-line); }
.details-list details:first-child { border-top: 1px solid var(--site-line); }
.details-list summary { display: flex; justify-content: space-between; gap: 20px; list-style: none; font-size: 13px; font-weight: 500; padding: 13px 0; }
.details-list summary::-webkit-details-marker { display: none; }
.details-list summary > span:last-child { color: var(--site-muted); font-size: 17px; line-height: 1; transition: transform .15s; }
.details-list details[open] summary > span:last-child { transform: rotate(45deg); }
.details-list details p { max-width: 840px; font-size: 12px; color: var(--site-muted); padding-bottom: 14px; }
.details-list details a { color: var(--site-accent); text-decoration: underline; text-underline-offset: 3px; }
.footer { border-top: 1px solid var(--site-line); background: var(--site-inset); }
.footer-inner { padding-top: 18px; padding-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.publication { font-size: 11px; color: var(--site-muted); }
.wordmark { font-size: 14px; font-weight: 600; }
.footer-inner > a { font-size: 11px; color: var(--site-muted); }

@media (max-width: 1000px) {
  .section, .footer-inner { padding-left: 32px; padding-right: 32px; }
}
@media (max-width: 900px) {
  .representation-row { grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; }
  .representation-label { grid-column: 1; grid-row: 1; }
  .representation-metrics { grid-column: 2; grid-row: 1; }
  .representation-value { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 700px) {
  .section, .footer-inner { padding-left: 20px; padding-right: 20px; }
  .encoder-sections { gap: 20px; padding: 7px 20px; font-size: 11px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 8px; }
  .input-actions { gap: 12px; }
  .representations-heading { display: block; }
  #result-status { display: block; margin-top: 3px; }
  .mapping-heading { align-items: start; }
  .mapping-reference { text-align: right; }
  .footer-inner { flex-wrap: wrap; gap: 16px; }
  .publication { order: 3; flex-basis: 100%; }
}
@media (max-width: 599px) { .mapping-scroll-hint { display: inline; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none!important; transition: none!important; }
}

/* Keep the same readable values; let labels and counts wrap on narrow screens. */
@media (max-width: 480px) {
  .representation-row { gap: 6px 10px; }
  .representation-label { overflow-wrap: anywhere; }
  .representation-metrics { max-width: 160px; }
  .representation-row code { font-size: 14px; line-height: 1.85; }
  .font-credit a { display: inline-block; padding-block: 5px; }
  .mapping-table { min-width: 560px; }
  .converter-tabs button, .quiet-button { min-height: 40px; }
}
