:root { color-scheme: light; --paper: #f7f4ed; --card: #fffdf8; --ink: #1e2c25; --muted: #42564a; --green: #234d39; --border: #c8d6c8; --mist: #e9f1e7; font: 1rem/1.65 "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--green); text-underline-offset: .19em; }
:focus-visible { outline: 3px solid #704426; outline-offset: 3px; }
[hidden] { display: none !important; }
header { border-bottom: 1px solid var(--border); }
.wrap { width: min(65rem, calc(100% - 1.5rem)); margin-inline: auto; }
.nav, .nav-links, .brand, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.05rem; }
.nav { justify-content: space-between; padding-block: .5rem; }
.brand { font-weight: 750; text-decoration: none; gap: .5rem; }
.mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .55rem; background: var(--green); color: white; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: .94rem; }
.skip { position: absolute; top: .35rem; left: .6rem; transform: translateY(-170%); padding: .5rem; background: white; }
.skip:focus { transform: none; }
.crumb { color: var(--muted); font-size: .94rem; margin-block: .85rem; }
.crumb a { margin-right: .4rem; }
.hero { padding-bottom: .85rem; }
h1, h2, h3 { line-height: 1.24; letter-spacing: -.035em; word-break: keep-all; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.86rem, 5vw, 3.25rem); margin: .35rem 0 .55rem; }
h2 { font-size: clamp(1.4rem, 3.2vw, 2.05rem); margin: 0 0 .7rem; }
h3 { font-size: 1.12rem; margin: 0 0 .4rem; }
p { margin: 0 0 .65rem; }
p:last-child { margin-bottom: 0; }
.lead { max-width: 70ch; color: var(--muted); }
.section { margin-block: 1.65rem; scroll-margin-top: 1rem; }
.panel, .card { border: 1px solid var(--border); border-radius: .75rem; padding: .85rem clamp(.8rem, 3vw, 1.15rem); background: var(--card); min-width: 0; }
.answer { background: var(--mist); }
.answer h2 { font-size: 1.05rem; }
.answer-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem .85rem; margin-bottom: .35rem; }
.hanzi { font-size: clamp(1.55rem, 6vw, 2.65rem); font-weight: 650; line-height: 1.2; }
.pinyin { color: var(--green); font-size: 1.07rem; }
.help, .status { color: var(--muted); font-size: .94rem; }
.status { min-height: 1.3em; margin-block: .3rem 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.5rem), 1fr)); gap: .65rem; margin: 0; padding: 0; list-style: none; }
.learning-card { display: flex; flex-direction: column; gap: .3rem; padding: .8rem 1rem; min-height: 5rem; text-decoration: none; }
.learning-card strong { text-decoration: underline; text-underline-offset: .19em; }
.learning-card:hover, .learning-card:focus-visible { background: var(--mist); }
.actions { gap: .4rem .55rem; margin-top: .65rem; }
button, input, select, textarea { font: inherit; }
.action, button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid var(--green); border-radius: .5rem; background: white; color: var(--green); font-weight: 630; padding: .42rem .66rem; text-decoration: none; cursor: pointer; }
button[disabled] { opacity: .75; cursor: default; }
.action:hover, button:hover:not([disabled]) { background: var(--mist); }
.primary { background: var(--green); color: white; }
.primary:hover, button.primary:hover:not([disabled]) { background: #335b48; color: white; }
.dialogue { display: grid; margin: 0; padding: 0; list-style: none; gap: .65rem; max-width: 50rem; }
.dialogue span { display: block; }
.translations { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; margin-block: .55rem; }
.translations dt { font-size: .85rem; color: var(--muted); }
.translations dd { margin: 0; font-size: 1.1rem; }
.numbers, .tone-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.2rem), 1fr)); }
.numbers .card, .tone-cards .card { padding: .62rem; }
.numbers button, .tone-cards button { min-width: 100%; }
.numbers .hanzi, .tone-cards .hanzi { font-size: 1.55rem; }
.tone-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr)); }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; max-width: 43rem; background: var(--card); }
caption { text-align: start; font-weight: 650; margin-bottom: .4rem; }
th, td { text-align: start; border-bottom: 1px solid var(--border); padding: .28rem .45rem; }
.num-tool { max-width: 45rem; }
.num-tool label { display: block; font-weight: 640; }
.num-tool input, .num-tool select, .tool select, .tool textarea { min-width: 0; max-width: 100%; border: 1px solid #6f8476; padding: .5rem .6rem; border-radius: .45rem; color: var(--ink); background: white; }
.num-tool input { width: 10.5rem; }
.num-tool output { display: block; word-break: break-word; }
.ko-chart-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .35rem .7rem; margin-bottom: .75rem; align-items: center; }
.ko-chart-form label:nth-of-type(2) { grid-column: 2; grid-row: 1; }
.ko-chart-form :is(input, select) { width: 100%; min-height: 44px; }
.ko-chart-groups { display: grid; gap: .45rem; }
.ko-chart-groups :is(th, td) { padding-inline: .36rem; }
.ko-chart-tone { display: inline-flex; align-items: center; min-height: 44px; }
.tool { max-width: 55rem; }
.tool label { font-weight: 650; }
.tool textarea { display: block; width: 100%; margin: .33rem 0; resize: vertical; }
.tool .converter-toolbar { margin-top: .65rem; }
.tool h2 { margin-top: 1rem; }
.tool .converter-notes { margin-block: .85rem; }
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-bottom: .6rem; }
summary { cursor: pointer; padding-block: .45rem; font-weight: 650; color: var(--green); min-height: 44px; }
.footer, .sources { padding-block: 1rem; border-top: 1px solid var(--border); color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 400px) { .nav { gap: .2rem .5rem; } .nav-links { column-gap: .7rem; } }
