:root {
  --bg: #f6f5f3; --card: #ffffff; --ink: #1d1d1f; --muted: #6b6b70; --line: #e3e1dc;
  --accent: #c8102e; --accent-soft: #fbe9ec; --b: #8a8f98; --ev: #b9bcc3;
  --ok: #1f7a4d; --ok-soft: #e6f4ec; --warn: #9a6200; --warn-soft: #fff4dc;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141416; --card: #1d1d20; --ink: #ececef; --muted: #9a9aa2; --line: #2e2e33;
    --accent: #ff5468; --accent-soft: #3a1a20; --b: #7d828c; --ev: #4b4e55;
    --ok: #4cc38a; --ok-soft: #173126; --warn: #e3b04b; --warn-soft: #33290f;
  }
}
:root[data-theme="dark"] {
  --bg: #141416; --card: #1d1d20; --ink: #ececef; --muted: #9a9aa2; --line: #2e2e33;
  --accent: #ff5468; --accent-soft: #3a1a20; --b: #7d828c; --ev: #4b4e55;
  --ok: #4cc38a; --ok-soft: #173126; --warn: #e3b04b; --warn-soft: #33290f;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }
code, .mono { font-family: var(--mono); font-size: .9em; }
small, .small { font-size: .82em; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .85em; margin: .5em 0 0; }

.top { background: var(--card); border-bottom: 1px solid var(--line); padding-top: 22px; }
.eyebrow { margin: 0; color: var(--accent); font-weight: 600; font-size: .82em; letter-spacing: .02em; }
h1 { margin: .2em 0 .3em; font-size: clamp(1.3rem, 3vw, 1.9rem); line-height: 1.25; }
.sub { margin: 0 0 14px; color: var(--muted); max-width: 820px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; }
.tab { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600;
  padding: 10px 14px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tab.active { color: var(--ink); border-color: var(--accent); }

main { padding-top: 18px; padding-bottom: 24px; }
.panel { display: none; }
.panel.active { display: block; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-bottom: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-width: 0; }
.card + .card { margin-top: 0; }
.panel > .card { margin-bottom: 14px; }
.card h2 { font-size: 1.05rem; margin: 0 0 10px; }
.card h3 { font-size: .95rem; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.card-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; }
.note p { margin: .4em 0; }

textarea, input, select { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 9px; width: 100%; }
textarea { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; min-height: 260px; resize: vertical; white-space: pre; }
textarea.short { min-height: 120px; }
.btns select, .btns input { width: auto; min-width: 140px; }
button { font: inherit; cursor: pointer; border-radius: 6px; }
.primary { background: var(--accent); color: #fff; border: 0; padding: 9px 18px; font-weight: 600; margin-top: 10px; }
.ghost { background: none; border: 1px solid var(--line); color: var(--ink); padding: 6px 12px; font-size: .9em; }
.file { position: relative; display: inline-block; cursor: pointer; border-radius: 6px; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chip { background: var(--bg); border: 1px solid var(--line); color: var(--ink); padding: 5px 11px; border-radius: 999px; font-size: .85em; }
.chip:hover, .ghost:hover { border-color: var(--accent); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 4px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .82em; color: var(--muted); }
.form .full { grid-column: 1 / -1; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stats.small { margin-bottom: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.45rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .8em; }
.stat.accent b { color: var(--accent); }
.card .stat { background: var(--bg); }

.bars .row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr; gap: 10px; align-items: center; padding: 3px 0; }
.bars .lbl { font-size: .82em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-line { display: flex; align-items: center; gap: 6px; min-height: 16px; }
.bar { height: 11px; border-radius: 3px; flex: none; max-width: calc(100% - 92px); }
.bar.a { background: var(--accent); }
.bar.b { background: var(--b); }
.bar-line span { font-size: .78em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-line small { color: var(--muted); }
.legend { font-size: .78em; color: var(--muted); font-weight: 400; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.sw.a { background: var(--accent); } .sw.b { background: var(--b); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot.ev { background: var(--ev); border-radius: 2px; width: 4px; } .dot.lg { background: var(--accent); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85em; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td small { color: var(--muted); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .8em; font-weight: 600; background: var(--bg); border: 1px solid var(--line); }
.pill.drop, .pill.reject, .pill.sdrop { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.verdict { padding: 14px; border-radius: 8px; margin-bottom: 12px; font-size: 1rem; }
.verdict.idle { background: var(--bg); color: var(--muted); }
.verdict.drop { background: var(--accent-soft); color: var(--accent); }
.verdict.alert { background: var(--warn-soft); color: var(--warn); }
.verdict.pass { background: var(--ok-soft); color: var(--ok); }
.hit { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; display: grid; gap: 4px; }
.warn { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: 8px; margin-top: 12px; font-size: .85em; }
.warn ul { margin: 6px 0 0; padding-left: 18px; }

canvas { width: 100%; display: block; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.foot { color: var(--muted); font-size: .8em; padding-bottom: 28px; }

@media (max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
  .bars .row { grid-template-columns: 1fr; gap: 2px; }
  textarea { min-height: 200px; }
}

.brand { display: flex; gap: 16px; align-items: center; margin-bottom: 6px; }
.brand img { width: 64px; height: 64px; border-radius: 50%; background: #fff; flex: none; object-fit: contain; border: 1px solid var(--line); }
.brand h1 { margin-bottom: 0; }
.ghost.strong { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.top0 { margin: 0 0 8px; }
#base-text { min-height: 90px; }
.qs { margin: 0; padding-left: 20px; }
.qs li { margin: .45em 0; }
.pill.public { background: var(--bg); color: var(--b); }
.pill.likely { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.local { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.diff-list { font-size: .85em; margin: 8px 0 0; }
.diff-list summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.diff-list li { margin: 4px 0; }
.diff-list code { word-break: break-all; }
del { color: var(--accent); } ins { color: var(--ok); text-decoration: none; }
@media (max-width: 560px) { .brand img { width: 48px; height: 48px; } }

/* korean summary MT demo */
.txt { font-size: .92em; line-height: 1.75; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; }
.txt mark { background: #ffe08a; color: #3d2c00; border-radius: 3px; padding: 0 1px; }
.txt mark.j { background: #c7ecc9; color: #0f3d14; }
.txt mark.s { background: #cfe0fb; color: #0d2a57; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .txt mark { filter: brightness(.85); } }
.verdict.ok { background: var(--ok-soft); color: var(--ok); }
.verdict.ng { background: var(--accent-soft); color: var(--accent); }
.ctrl { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 8px; }
.ctrl label { display: flex; flex-direction: column; gap: 4px; font-size: .82em; color: var(--muted); }
.ctrl select, .ctrl input:not([type=range]) { width: auto; min-width: 120px; }
.ctrl input[type=range] { width: 140px; padding: 0; }
.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.three h4 { margin: 0 0 6px; font-size: .85em; color: var(--muted); }
.mrbars .row { grid-template-columns: 70px 1fr; }
.score td, .score th { text-align: right; font-variant-numeric: tabular-nums; }
.score td:first-child, .score th:first-child { text-align: left; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
textarea.mid { min-height: 150px; white-space: pre-wrap; font-family: inherit; font-size: .9em; line-height: 1.6; }
