:root {
  --bg: #f6f1e8; --panel: #fffdf8; --ink: #211c15; --muted: #7a6f5f; --line: #e5dcc9;
  --accent: #b9741a; --accent-ink: #fff; --soft: #f2e6cf; --err: #b3261e;
  --ipa: "Charis SIL", "Gentium Plus", "Doulos SIL", "Noto Serif", "DejaVu Serif", "Times New Roman", serif;
  --ui: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110d; --panel: #1d1812; --ink: #f1e9da; --muted: #a39682; --line: #332b20;
    --accent: #e8a33d; --accent-ink: #161310; --soft: #2b2316; --err: #ff8a80;
  }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--ui); -webkit-font-smoothing: antialiased; }
.top, main, footer { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 28px; padding-bottom: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo { width: 46px; height: 46px; color: var(--accent-ink); flex: none; }
.logo-bg { fill: var(--accent); }
h1 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.brand p { margin: 0; color: var(--muted); font-size: 14px; }
h2 { margin: 0 0 12px; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.tabs { display: flex; gap: 4px; background: var(--soft); padding: 4px; border-radius: 12px; }
.tabs button { border: 0; background: none; color: var(--muted); padding: 8px 16px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 8px; }
.hint, .muted { color: var(--muted); font-weight: 400; font-size: 14px; }
.hint { margin-left: 6px; }
textarea { width: 100%; resize: vertical; min-height: 110px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font: 18px/1.5 var(--ui); }
textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button, button.ghost { border: 1px solid var(--line); background: transparent; color: var(--ink); padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 14px; cursor: pointer; }
.chips button:hover, button.ghost:hover { border-color: var(--accent); color: var(--accent); }
.out-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.out-head h2 { margin: 0; }
.actions { display: flex; gap: 8px; }
.line { padding: 14px 0; border-top: 1px dashed var(--line); }
.line:first-child { border-top: 0; }
.words { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.word { min-width: 0; }
.word .ipa { font: 30px/1.25 var(--ipa); color: var(--ink); overflow-wrap: anywhere; }
.word .orig { font-size: 13px; color: var(--muted); }
.word .orig b { font-weight: 600; color: var(--accent); }
.sep { color: var(--accent); padding: 0 1px; font-weight: 700; }
.err { color: var(--err); margin: 0 0 16px; }
ul#gecmis { list-style: none; margin: 0; padding: 0; }
#gecmis li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
#gecmis li:first-child { border-top: 0; }
#gecmis li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#gecmis li span:last-child { font-family: var(--ipa); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
#gecmis li:hover span:first-child { color: var(--accent); }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 13px; font-weight: 600; border-top: 0; }
td:nth-child(1), td:nth-child(2) { font: 22px/1.3 var(--ipa); white-space: nowrap; }
td:nth-child(3) { color: var(--muted); font-size: 14px; }
code { font-family: var(--ipa); background: var(--soft); padding: 1px 6px; border-radius: 6px; }
.steps { margin: 0; padding-left: 22px; }
.steps li { margin-bottom: 8px; }
footer { color: var(--muted); font-size: 13px; padding-top: 8px; padding-bottom: 32px; }
[hidden] { display: none !important; }
@media (max-width: 520px) { .word .ipa { font-size: 26px; } .top { padding-top: 18px; } }
.copyright { text-align: center; color: var(--muted); font-size: 13px; padding-top: 8px; padding-bottom: 32px; }
.copyright p { margin: 2px 0; }

.deu-back { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); text-decoration: none; font-size: 14px; }
.deu-back img { height: 36px; width: auto; border-radius: 6px; background: #fff; }
.deu-back:hover { color: var(--ink); text-decoration: underline; }
