/* KPulse 1차 시제품 — 왼쪽 입력(원문) · 오른쪽 관찰(분석) */
:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #2f5fd0; --accent-soft: #e8eefc; --hl: #fff1b8; --hl-line: #e0b400;
  --warn-bg: #fff7e6; --warn: #8a5a00; --err-bg: #fdecec; --err: #9b1c1c; --info-bg: #eef4ff; --info: #1e3a8a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.35rem; margin: 0 0 .6rem; }
h2 { font-size: 1.05rem; margin: 1.2rem 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; word-break: break-all; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 1.4rem; background: #141a26; color: #fff; }
.top .brand { color: #fff; font-weight: 700; font-size: 1.1rem; }
.top .brand span { font-weight: 400; color: #9aa4b8; font-size: .85rem; margin-left: .4rem; }
.top nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.top nav a, .top nav .link { color: #d5dbe6; font-size: .92rem; }
.link { background: none; border: 0; cursor: pointer; padding: 0; font: inherit; }
.inline { display: inline; }

main { max-width: 1180px; margin: 1.2rem auto; padding: 0 1rem; }
main.split { max-width: 1440px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1rem; align-items: start; }
@media (max-width: 960px) { main.split { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.2rem 1.4rem; margin-bottom: 1rem; }
.card.narrow { max-width: 560px; }
.card.center { margin: 3rem auto; }
.panel.left { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
@media (max-width: 960px) { .panel.left { position: static; max-height: none; } }

.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.gap { gap: .8rem; margin-bottom: .8rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 1rem; }
.grid2 .wide { grid-column: 1 / -1; }
.field { margin-bottom: .7rem; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
input[type=text], input[type=url], input[type=date], input[type=password], select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
textarea { line-height: 1.7; }
.check { display: flex; gap: .5rem; align-items: center; color: var(--ink) !important; }
.check input { width: auto; }
.errorlist { color: var(--err); margin: .2rem 0; padding-left: 1rem; font-size: .85rem; }

.btn { display: inline-block; padding: .45rem .9rem; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; font: inherit; font-size: .9rem; }
.btn:hover { background: #f1f3f6; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #244ab0; }
.btn.danger { color: var(--err); border-color: #f2c4c4; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.actions select { width: auto; }

.banner { padding: .6rem 1rem; border-radius: 8px; margin: 0 0 .8rem; }
body > .banner { margin: 0; border-radius: 0; text-align: center; font-size: .9rem; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.error { background: var(--err-bg); color: var(--err); }
.banner.info { background: var(--info-bg); color: var(--info); }
.messages { list-style: none; max-width: 1180px; margin: .8rem auto 0; padding: 0 1rem; }
.messages li { background: var(--info-bg); color: var(--info); padding: .5rem 1rem; border-radius: 8px; }
.messages li.error { background: var(--err-bg); color: var(--err); }
.notice { background: #f8f9fb; border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; margin: .8rem 0 1rem; font-size: .9rem; }
.notice ul { margin: .4rem 0; padding-left: 1.2rem; }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
table.list th { color: var(--muted); font-weight: 500; font-size: .82rem; }
table.dist td.has { background: var(--accent-soft); text-align: center; font-weight: 600; }
table.dist td, table.dist th { text-align: center; }
table.dist td:first-child, table.dist th:first-child { text-align: left; }
.tag { display: inline-block; font-size: .75rem; padding: .05rem .45rem; border-radius: 999px; background: #eef0f3; color: #4b5563; margin-left: .2rem; }
.tag.hot { background: #fde8e8; color: var(--err); }
.st { font-size: .85rem; }
.st-ok, .st-ok_with_drops { color: #166534; }
.st-queued, .st-running { color: var(--accent); }
[class*="st-failed"] { color: var(--err); }

/* 원문 */
.title { font-size: 1.15rem; }
.article { white-space: pre-wrap; line-height: 1.95; font-size: 1rem; padding: .4rem 0; }
.sent { border-radius: 3px; transition: background .2s; }
.sent:hover { background: #f3f5f9; }
.sent.hl { background: var(--hl); box-shadow: 0 2px 0 var(--hl-line); }

/* 결과 */
.sec { border-top: 1px solid var(--line); padding: .3rem 0 .6rem; }
.sec:first-of-type { border-top: 0; }
.sec > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .5rem; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary h2 { margin: .6rem 0; }
.sec > summary::before { content: "▸"; color: var(--muted); font-size: .8rem; }
.sec[open] > summary::before { content: "▾"; }
.sec.disabled summary h2 { color: var(--muted); }
dl.kv { display: grid; grid-template-columns: 7.5rem 1fr; gap: .35rem .8rem; margin: 0; }
dl.kv dt { color: var(--muted); font-size: .88rem; }
dl.kv dd { margin: 0; }
.ev { font: inherit; font-size: .92rem; border: 1px solid #cfd8ee; background: var(--accent-soft); color: #1e3a8a;
  border-radius: 6px; padding: .1rem .5rem; margin: .1rem .1rem .1rem 0; cursor: pointer; text-align: left; }
.ev:hover { border-color: var(--accent); }
.ev.active { background: var(--hl); border-color: var(--hl-line); color: var(--ink); }
.ev.plain { background: none; border-color: transparent; color: var(--ink); padding: 0 .2rem; }
.ev.plain:hover { border-color: #cfd8ee; }
.ev.plain.active { background: var(--hl); }
.unit { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin: .5rem 0; }
.unit-head { font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.unit-btn { font-size: .82rem; }
.pick .param { color: #4b5563; }
.conf { font-size: .72rem; padding: 0 .35rem; border-radius: 4px; background: #e5e7eb; color: #374151; margin-left: .2rem; }
.conf-강 .conf { background: #1e3a8a; color: #fff; }
.conf-중 .conf { background: #93a7d8; color: #fff; }
.shift { margin: .4rem 0 0; font-size: .9rem; }
table.mini, table.axes { border-collapse: collapse; font-size: .88rem; margin: .3rem 0; }
table.mini th, table.axes th { text-align: left; color: var(--muted); font-weight: 500; padding: .15rem .8rem .15rem 0; white-space: nowrap; vertical-align: top; }
table.mini td, table.axes td { padding: .15rem 0; }
.omitted { background: #fbfaf5; border-left: 3px solid #d9c27a; padding: .4rem .8rem; margin: .5rem 0; font-size: .9rem; }
.omitted ul { margin: .2rem 0; padding-left: 1.1rem; }
.history { margin-top: 1rem; padding-top: .6rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .4rem .8rem; }
.history a.cur { font-weight: 700; }
pre.json { max-height: 420px; overflow: auto; background: #0f1420; color: #d6deeb; padding: .8rem; border-radius: 6px; font-size: .78rem; }
.waiting { text-align: center; padding: 3rem 1rem; }
.spinner { width: 34px; height: 34px; margin: 0 auto 1rem; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
ol.scope { padding-left: 1.1rem; }
ol.scope li { margin-bottom: .4rem; list-style: none; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem 1rem 2rem; }
ul#id_domains { list-style: none; padding: 0; display: flex; gap: 1rem; }
ul#id_domains label, #id_domains label { display: inline-flex; gap: .3rem; align-items: center; color: var(--ink); }
