:root {
  --ink: #18221e;
  --muted: #66706b;
  --line: #dfe4dc;
  --paper: #ffffff;
  --canvas: #f4f5ef;
  --green: #0d6b4d;
  --green-soft: #e6f1ea;
  --lime: #cde87b;
  --red: #b64032;
  --red-soft: #f9ebe8;
  --amber: #9b6500;
  --shadow: 0 14px 40px rgba(27, 43, 35, 0.07);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(13, 107, 77, 0.22); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.topbar { height: 76px; padding: 0 clamp(22px, 4vw, 64px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; width: fit-content; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--ink); color: var(--lime); font: 500 13px "DM Mono"; }
.brand > span:last-child { display: grid; line-height: 1.1; gap: 4px; }
.brand strong { font-size: 16px; letter-spacing: -.02em; }
.brand small { font-size: 10px; color: var(--muted); font-weight: 500; }
nav { height: 100%; display: flex; gap: 5px; }
.nav-item { padding: 0 18px; border: 0; border-bottom: 2px solid transparent; background: none; color: #748078; font-size: 13px; font-weight: 600; cursor: pointer; }
.nav-item:hover { color: var(--ink); }
.nav-item.active { color: var(--green); border-bottom-color: var(--green); }
.top-status { justify-self: end; display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 20px; font-size: 11px; color: var(--muted); }
.top-status strong { color: var(--green); font: 500 10px "DM Mono"; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4fba73; box-shadow: 0 0 0 4px #e9f6ec; }

.page-head { max-width: 1440px; margin: 0 auto; padding: 58px clamp(22px, 5vw, 74px) 36px; display: flex; align-items: end; justify-content: space-between; gap: 36px; }
.page-head h1 { margin: 5px 0 12px; max-width: 720px; font-size: clamp(30px, 3vw, 48px); line-height: 1.18; letter-spacing: -.055em; }
.page-head > div > p:last-child { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.eyebrow { margin: 0; color: var(--green); font: 500 11px "DM Mono"; letter-spacing: .12em; }
.head-meta { flex: none; min-width: 280px; display: grid; grid-template-columns: 1fr auto; gap: 10px 26px; padding: 18px 0 7px 30px; border-left: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.head-meta strong { color: var(--ink); font: 500 12px "DM Mono"; }

.workspace { max-width: 1440px; margin: 0 auto; padding: 0 clamp(22px, 5vw, 74px); display: grid; grid-template-columns: minmax(420px, .94fr) minmax(460px, 1.06fr); gap: 22px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.input-panel, .result-panel { min-height: 650px; overflow: hidden; }
.card-head { min-height: 86px; padding: 21px 25px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.card-head > div { display: flex; align-items: center; gap: 13px; }
.card-head h2, .table-head h2 { margin: 0; font-size: 15px; letter-spacing: -.025em; }
.card-head p, .table-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.step { width: 37px; height: 37px; border-radius: 10px; display: grid; place-items: center; background: #eef0e9; color: var(--green); font: 500 11px "DM Mono"; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 18px; padding: 7px 10px; white-space: nowrap; font-size: 10px; font-weight: 700; }
.badge svg { width: 14px; height: 14px; stroke-width: 2.5; }
.badge.neutral { background: #f1f2ed; color: #657069; }
.badge.success { background: var(--green-soft); color: var(--green); }
.badge.danger { background: var(--red-soft); color: var(--red); }

.sample-tabs { padding: 18px 24px 8px; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: thin; }
.sample-tab { flex: none; border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; background: white; color: var(--muted); font-size: 11px; cursor: pointer; }
.sample-tab:hover { border-color: #aab7ae; color: var(--ink); }
.sample-tab.active { background: var(--ink); border-color: var(--ink); color: white; }
form { padding: 17px 24px 24px; }
.field-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 13px; }
.field { display: grid; gap: 8px; margin-bottom: 17px; }
.field > span { display: flex; justify-content: space-between; gap: 10px; color: #48524d; font-size: 11px; font-weight: 700; }
.field em { color: #89928d; font-size: 9px; font-style: normal; font-weight: 500; }
input, textarea, select { width: 100%; border: 1px solid #d8ded7; border-radius: 9px; background: #fbfcf9; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input, select { min-height: 43px; padding: 0 12px; font-size: 12px; }
textarea { padding: 12px; resize: vertical; min-height: 122px; font: 400 12px/1.7 "DM Mono", monospace; }
input:hover, textarea:hover, select:hover { border-color: #aab5ad; }
input:focus, textarea:focus, select:focus { border-color: var(--green); background: white; outline: none; box-shadow: 0 0 0 3px rgba(13, 107, 77, .09); }
.fault-row { min-height: 63px; margin: 1px 0 16px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px dashed #d6dcd4; border-radius: 10px; background: #f8f9f5; }
.fault-row > div { display: grid; gap: 3px; }
.fault-row strong { font-size: 11px; }
.fault-row span { color: var(--muted); font-size: 9px; }
.fault-row select { width: 170px; min-height: 37px; background: white; }
.primary-button { width: 100%; min-height: 50px; border: 0; border-radius: 10px; padding: 0 14px; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--green); color: white; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 16px rgba(13,107,77,.18); transition: transform .15s, background .15s; }
.primary-button:hover { background: #085e43; transform: translateY(-1px); }
.primary-button svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.primary-button kbd { position: absolute; margin-left: 410px; padding: 3px 6px; border-radius: 5px; background: rgba(255,255,255,.14); color: rgba(255,255,255,.7); font: 400 9px "DM Mono"; }
.primary-button.small { width: auto; min-height: 42px; padding: 0 18px; }

.empty-state { min-height: 560px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-state h3 { margin: 26px 0 7px; font-size: 14px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.radar { width: 86px; height: 86px; position: relative; display: grid; place-items: center; color: var(--green); border: 1px solid #d7e0d7; border-radius: 50%; background: radial-gradient(circle, #f8fbf4 0 35%, transparent 36%); }
.radar::after, .radar::before { content: ""; position: absolute; border-radius: 50%; border: 1px solid #e4e9e2; }
.radar::before { inset: 13px; }.radar::after { inset: 29px; }
.radar svg { z-index: 1; width: 24px; height: 24px; }
.result-summary { display: grid; grid-template-columns: repeat(3, 1fr); padding: 20px 24px; gap: 9px; }
.result-summary > div { padding: 14px; border-radius: 10px; background: #f6f7f3; display: grid; gap: 7px; }
.result-summary span { color: var(--muted); font-size: 9px; }
.result-summary strong { font: 500 22px "DM Mono"; }
.result-summary small { margin-left: 3px; color: var(--muted); font: 500 9px "Noto Sans KR"; }
.section-label { margin: 3px 24px 8px; display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .03em; }
.item-list, .trace-list { margin: 0 24px 18px; display: grid; gap: 7px; }
.item-row { min-height: 59px; padding: 9px 12px; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 10px; }
.item-row.gift { border-color: #cbdab4; background: #fbfdf5; }
.item-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: #edf0ea; color: var(--green); font: 500 11px "DM Mono"; }
.item-row.gift .item-icon { background: var(--lime); color: #36431f; }
.item-row > div { display: grid; gap: 2px; }
.item-row > div strong { font-size: 11px; }.item-row > div span { color: var(--muted); font: 400 8px "DM Mono"; }
.kind-tag { padding: 4px 7px; border-radius: 10px; background: #eef1ed; color: #657069; font-size: 8px; font-weight: 700; }
.gift .kind-tag { background: #edf5d7; color: #66752e; }
.quantity { min-width: 34px; text-align: right; font: 500 16px "DM Mono"; }.quantity small { margin-left: 2px; color: var(--muted); font: 500 8px "Noto Sans KR"; }
.trace-row { min-height: 52px; padding: 8px 12px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; border-radius: 9px; background: #f7f8f5; border-left: 3px solid #b9c7bd; }
.trace-row.fault { background: var(--red-soft); border-left-color: var(--red); }
.trace-index { color: #8b958f; font: 500 9px "DM Mono"; }
.trace-row > div:nth-child(2) { display: grid; gap: 2px; }.trace-row > div strong { font-size: 10px; }.trace-row > div span { color: var(--muted); font-size: 8px; }
.trace-math { display: flex !important; align-items: center; gap: 6px; font: 500 10px "DM Mono"; }
.trace-math svg { width: 12px; height: 12px; color: #96a099; }.trace-math em { margin-left: 4px; padding: 3px 6px; border-radius: 8px; background: #e5ece7; color: var(--green); font-size: 8px; font-style: normal; }
.fault .trace-math em { background: #f2d7d2; color: var(--red); }
.diagnosis { margin: 12px 24px 24px; padding: 14px; display: flex; gap: 11px; border-radius: 10px; }
.diagnosis.healthy { background: var(--green-soft); color: var(--green); }.diagnosis.fault { background: var(--red-soft); color: var(--red); }
.diagnosis > span { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; }.diagnosis svg { width: 15px; height: 15px; }
.diagnosis > div { display: grid; gap: 3px; }.diagnosis p { margin: 0; font: 500 8px "DM Mono"; letter-spacing: .08em; }.diagnosis strong { font-size: 10px; color: var(--ink); }.diagnosis small { color: currentColor; font-size: 8px; }
.error-result { margin: 24px; padding: 45px 20px; border-radius: 12px; background: #faf4f1; text-align: center; }.error-result > svg { width: 35px; height: 35px; color: var(--red); }.error-result h3 { margin: 7px 0; font-size: 15px; }.error-result > p:last-child { margin: 0; color: var(--muted); font-size: 10px; }

.assurance-strip { max-width: 1292px; margin: 22px auto 60px; padding: 19px 24px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.assurance-strip article { padding: 0 22px; display: flex; gap: 12px; align-items: center; border-right: 1px solid var(--line); }.assurance-strip article:last-child { border: 0; }
.assurance-strip svg { color: var(--green); }.assurance-strip div { display: grid; gap: 3px; }.assurance-strip span { color: var(--muted); font-size: 9px; }.assurance-strip strong { font-size: 10px; }

.page { min-height: calc(100vh - 76px); max-width: 1292px; margin: 0 auto; padding: 0 0 70px; }
.page.single-page { padding-left: 28px; padding-right: 28px; }
.page-head.compact { padding: 53px 0 30px; max-width: none; align-items: center; }
.page-head.compact h1 { font-size: 36px; }
.test-overview { margin-bottom: 18px; padding: 23px 27px; display: grid; grid-template-columns: repeat(4,1fr); }
.test-overview > div { padding: 3px 24px; display: grid; gap: 8px; border-right: 1px solid var(--line); }.test-overview > div:first-child { padding-left: 0; }.test-overview > div:last-child { border: 0; }
.test-overview span { color: var(--muted); font-size: 10px; }.test-overview strong { font: 500 19px "DM Mono"; }.text-success { color: var(--green); }.text-warn { color: var(--amber); }
.test-card, .master-card { overflow: hidden; }
.table-head { min-height: 78px; padding: 20px 25px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
code { font: 400 10px "DM Mono"; }
.test-tr { min-height: 67px; padding: 11px 24px; display: grid; grid-template-columns: 1.1fr 1.45fr 1.1fr .55fr; align-items: center; gap: 22px; border-bottom: 1px solid #ebeee8; font-size: 11px; }.test-tr:last-child { border: 0; }.test-tr.header { min-height: 39px; background: #f5f6f1; color: var(--muted); font-size: 9px; font-weight: 700; }
.test-tr > span { display: grid; gap: 4px; }.test-tr small { color: var(--muted); font-size: 8px; }.test-tr strong { font-size: 11px; }.test-tr b { width: fit-content; padding: 4px 8px; border-radius: 12px; font: 500 9px "DM Mono"; }.pass { background: var(--green-soft); color: var(--green); }.fail { background: var(--red-soft); color: var(--red); }.pending { background: #eef0ec; color: var(--muted); }
.limitation { margin-top: 16px; padding: 16px 19px; display: flex; align-items: baseline; gap: 18px; border: 1px solid #eadcb8; border-radius: 10px; background: #fffaf0; }.limitation strong { flex: none; color: var(--amber); font-size: 10px; }.limitation p { margin: 0; color: #796c4f; font-size: 10px; line-height: 1.7; }
.rules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.rule-card { min-height: 260px; padding: 27px; box-shadow: none; position: relative; overflow: hidden; }.rule-number { position: absolute; right: 22px; top: 17px; color: #e6e9e3; font: 500 38px "DM Mono"; }.rule-card h2 { margin: 21px 0 10px; font-size: 17px; }.rule-card > p { margin: 0 0 20px; max-width: 85%; color: var(--muted); font-size: 11px; line-height: 1.8; }
.rule-card dl { margin: 0; display: grid; gap: 7px; }.rule-card dl div { padding: 9px 12px; display: grid; grid-template-columns: 80px 1fr; border-radius: 7px; background: #f4f6f1; font-size: 10px; }.rule-card dt { color: var(--green); font-weight: 700; }.rule-card dd { margin: 0; font-family: "DM Mono"; }
.token-example { display: flex; flex-wrap: wrap; gap: 7px; }.token-example del, .token-example ins { padding: 7px 9px; border-radius: 6px; font: 400 10px "DM Mono"; text-decoration: none; }.token-example del { background: #f3eeee; color: #988b89; }.token-example ins { background: var(--green-soft); color: var(--green); }
.rule-card ul { margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; list-style: none; }.rule-card li { padding: 8px 10px; border-radius: 6px; background: #f4f6f1; font-size: 9px; }.rule-card li::before { content: "✓"; margin-right: 7px; color: var(--green); }
.audit-line { display: flex; align-items: center; justify-content: space-between; padding: 15px; border-radius: 8px; background: #f4f6f1; color: var(--green); font: 500 9px "DM Mono"; }.audit-line svg { width: 14px; }
.master-card { margin-top: 18px; box-shadow: none; }.master-grid { display: grid; grid-template-columns: repeat(4, 1fr); }.master-grid article { padding: 21px; display: grid; gap: 6px; border-right: 1px solid var(--line); }.master-grid article:last-child { border: 0; }.master-grid span { color: var(--green); font-size: 8px; font-weight: 700; }.master-grid strong { font-size: 11px; }.master-grid code { color: var(--muted); }.master-grid small { color: #89928d; font-size: 8px; line-height: 1.5; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; }.topbar nav { position: fixed; left: 0; right: 0; top: 76px; height: 47px; background: white; border-bottom: 1px solid var(--line); justify-content: center; }.nav-item { padding: 0 14px; }.top-status { display: none; }
  .page-head { padding-top: 88px; }.workspace { grid-template-columns: 1fr; }.input-panel, .result-panel { min-height: auto; }.empty-state { min-height: 420px; }
  .page.single-page { padding-top: 44px; }.rules-grid { grid-template-columns: 1fr 1fr; }.master-grid { grid-template-columns: 1fr 1fr; }.master-grid article:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }.master-grid article:first-child { border-bottom: 1px solid var(--line); }
}

@media (max-width: 680px) {
  .topbar { padding: 0 16px; }.brand small { display: none; }.nav-item { padding: 0 10px; font-size: 11px; }
  .page-head { padding: 79px 18px 27px; display: block; }.page-head h1 { font-size: 31px; }.head-meta { display: none; }
  .workspace { padding: 0 12px; }.card-head { padding: 18px; }.sample-tabs, form { padding-left: 18px; padding-right: 18px; }.field-row { grid-template-columns: 1fr; }.primary-button kbd { display: none; }
  .result-summary { padding: 17px 18px; }.result-summary > div { padding: 10px; }.result-summary strong { font-size: 17px; }.section-label { margin-left: 18px; margin-right: 18px; }.item-list, .trace-list { margin-left: 18px; margin-right: 18px; }.diagnosis { margin-left: 18px; margin-right: 18px; }
  .assurance-strip { grid-template-columns: 1fr; margin: 18px 12px 40px; }.assurance-strip article { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 5px; }
  .page.single-page { padding-left: 12px; padding-right: 12px; }.page-head.compact { padding-left: 6px; padding-right: 6px; display: grid; }.page-head.compact h1 { font-size: 31px; }.page-head.compact .primary-button { margin-top: 18px; }
  .test-overview { grid-template-columns: 1fr 1fr; }.test-overview > div { padding: 10px; }.test-overview > div:nth-child(2) { border: 0; }.test-tr { grid-template-columns: 1fr auto; gap: 9px; }.test-tr > *:nth-child(3) { display: none; }.test-tr.header > *:nth-child(2) { display: none; }
  .rules-grid { grid-template-columns: 1fr; }.rule-card { min-height: auto; }.master-grid { grid-template-columns: 1fr; }.master-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
}
