/* 마감전 / 함임음. 디자인 방향 = DESIGN.md (Cal.com, Monochrome Utility, Human Touch).
   바탕 위 카드, 알약 버튼, 색은 판정색 셋과 AI 파랑 하나만. 글꼴 Pretendard. 아이콘 없음(체크 표시 하나만 SVG).
   2026-09-06 두 번째 손질. 밝게/어둡게 두 벌, 본문 17px 로 키움, 보조 글자 대비 상향.
   대비는 밝은 판과 어두운 판 각각 계산해 본문 4.5:1, 비텍스트 3:1 을 넘긴다. */

:root {
  color-scheme: light;
  --paper: #f2f2f3;            /* 페이지 바탕 */
  --white: #ffffff;            /* 카드 */
  --ink: #101010;              /* 주 버튼 바탕, 가장 진한 면 */
  --on-ink: #ffffff;
  --graphite: #1f2124;         /* 본문 */
  --slate: #4b5563;            /* 보조 글자. 카드 위 7.0:1, 바탕 위 6.4:1 */
  --stone: #7c828c;            /* 비활성, 입력 테두리(비텍스트 3.7:1) */
  --silver: #dfe1e5;           /* 실선 */
  --action-ink: #0b5fc4;       /* AI 표시 글자 6.1:1, 포커스 링 */
  --action-wash: #e8f1fd;
  --selection: #bcdcff;
  --ok: #10692f;               /* 6.3:1 */
  --warn: #9a4708;             /* 6.4:1 */
  --warn-wash: #fdf0e0;
  --warn-wash-strong: #ffdcb4;
  --warn-wash-faint: #fdf8f2;
  --bad: #ac1717;              /* 7.5:1 */
  --scrim: rgba(16, 16, 16, 0.45);
  --shadow-card: rgba(30, 32, 36, 0.06) 0 4px 10px 0;
  --shadow-hover: rgba(30, 32, 36, 0.12) 0 6px 18px 0;
  --ring: rgba(11, 95, 196, 0.18);

  --sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', Roboto, sans-serif;
  --r-card: 12px;
  --r-input: 8px;
  --r-pill: 9999px;
  --wrap: 1120px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121316;
  --white: #1c1e22;
  --ink: #ededf0;
  --on-ink: #121316;
  --graphite: #eaebee;
  --slate: #a8afbb;            /* 카드 위 7.7:1 */
  --stone: #7e8695;            /* 4.6:1 */
  --silver: #31353d;
  --action-ink: #7fb8ff;       /* 8.0:1 */
  --action-wash: #17253a;
  --selection: #29486b;
  --ok: #58d68d;               /* 9.0:1 */
  --warn: #f0a93b;             /* 8.2:1 */
  --warn-wash: #2c2214;
  --warn-wash-strong: #4a3618;
  --warn-wash-faint: #201d18;
  --bad: #f6787a;              /* 6.4:1 */
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow-card: 0 0 0 1px #2b2f36, rgba(0, 0, 0, 0.35) 0 2px 10px 0;
  --shadow-hover: 0 0 0 1px #3a3f47, rgba(0, 0, 0, 0.5) 0 8px 24px 0;
  --ring: rgba(127, 184, 255, 0.28);
}

* { box-sizing: border-box; }
html { background: var(--paper); scrollbar-width: thin; scrollbar-color: var(--stone) transparent; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
b, strong { font-weight: 600; color: var(--graphite); }
button { font: inherit; letter-spacing: inherit; color: inherit; }
a { color: var(--action-ink); text-underline-offset: 3px; }
::selection { background: var(--selection); color: var(--graphite); }
:focus-visible { outline: 2px solid var(--action-ink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.meta { font-size: 14px; color: var(--slate); line-height: 1.55; margin: 0; }
.meta.gap { margin-top: 12px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--action-ink); cursor: pointer; font-size: 14px; }
.linkbtn:hover { text-decoration: underline; }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

/* 상단 띠 */
.top { background: var(--white); border-bottom: 1px solid var(--silver); position: sticky; top: 0; z-index: 10; }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }
.brand { font-size: 19px; font-weight: 600; letter-spacing: -0.3px; color: var(--graphite); text-decoration: none; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand-sub { font-size: 14px; font-weight: 400; color: var(--slate); }
.top-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tag { border-radius: var(--r-pill); padding: 5px 12px; font-size: 13px; color: var(--slate); background: var(--paper); white-space: nowrap; }
.tag.ai { color: var(--action-ink); }

/* 버튼. 진한 알약 = 주 동작 하나, 유령 알약 = 나머지 */
.pill {
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--r-pill);
  padding: 11px 22px;
  cursor: pointer;
  border: 1px solid var(--silver);
  background: var(--white);
  color: var(--graphite);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.pill:hover { border-color: var(--stone); }
.pill:active { transform: translateY(1px); }
.pill.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.pill.primary:hover { opacity: 0.88; }
.pill.small { padding: 7px 14px; font-size: 14px; }
.pill:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.pill.busy { cursor: wait; opacity: 0.75; }

/* 칩과 점 */
.chip { font-size: 13px; border: 0; border-radius: var(--r-pill); padding: 6px 12px; background: var(--paper); color: var(--graphite); cursor: pointer; transition: background 0.15s, color 0.15s; }
.chip:hover { background: var(--silver); }
.chip.on { background: var(--ink); color: var(--on-ink); }
.chip .n { margin-left: 6px; opacity: 0.75; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--stone); flex: none; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.run { background: var(--action-ink); }

/* 체크 상자. 브라우저 기본 대신 팔레트로. 체크 표시는 이 화면의 유일한 아이콘 */
input[type="checkbox"], input[type="radio"] {
  appearance: none;
  width: 19px; height: 19px; margin: 0; flex: none;
  border: 1.5px solid var(--stone);
  border-radius: 5px;
  background: var(--white);
  display: inline-grid; place-items: center;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--ink); border-color: var(--ink); }
input[type="checkbox"]:checked::after {
  content: "";
  width: 11px; height: 11px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6.5l2.6 2.6L10 3.5'/%3E%3C/svg%3E");
}
[data-theme="dark"] input[type="checkbox"]:checked::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23121316' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6.5l2.6 2.6L10 3.5'/%3E%3C/svg%3E"); }
input[type="radio"]:checked::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--on-ink); }

/* 카드 */
.card { background: var(--white); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 20px; }
.card h2 { font-size: 14px; font-weight: 600; color: var(--slate); margin: 0 0 12px; }
.card .big { font-size: 28px; font-weight: 600; letter-spacing: -0.4px; line-height: 1.2; }
.card .big.warn { color: var(--warn); }
.card .big.bad { color: var(--bad); }

/* ---------- 작업실 골격 ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr) 300px; gap: 24px; max-width: 1360px; margin: 0 auto; padding: 24px; align-items: start; }
.app > * { min-width: 0; }
.app.wide { grid-template-columns: 236px minmax(0, 1fr); }
.rail { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 4px; }
.step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 12px;
  align-items: center;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--r-card);
  padding: 10px 12px;
  color: var(--graphite);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
/* 동그라미는 순서 하나만 뜻한다. 지금 어디인지는 카드가, 어떻게 됐는지는 아래 줄의 점과 말이 알린다 */
.step:hover:not(:disabled) { background: var(--white); box-shadow: inset 0 0 0 1px var(--silver); }
.step[aria-current="step"] { background: var(--white); box-shadow: var(--shadow-card); }
.step:disabled { color: var(--stone); cursor: default; background: transparent; box-shadow: none; }
.step .no { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--silver); display: grid; place-items: center; font-size: 13px; font-weight: 600; grid-row: span 2; background: var(--white); color: var(--slate); }
.step:disabled .no { color: var(--stone); background: transparent; }
.step[aria-current="step"] .no { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.step .name { font-size: 15px; font-weight: 600; line-height: 1.35; }
.step .st { font-size: 13px; color: var(--slate); line-height: 1.35; display: flex; align-items: center; gap: 6px; }
.step .st .dot { width: 8px; height: 8px; }
.step .st.s-ok { color: var(--ok); }
.step .st.s-warn { color: var(--warn); }
.step .st.s-bad { color: var(--bad); }
.rail-legend { font-size: 13px; color: var(--slate); padding: 4px 12px 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; line-height: 1.5; }
.rail-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rail-foot { margin-top: 16px; padding: 0 12px; display: flex; flex-direction: column; gap: 6px; }

.stage { background: var(--white); border-radius: var(--r-card); box-shadow: var(--shadow-card); min-width: 0; }
/* 공고문에 띄어쓰기 없는 긴 주소나 붙여 쓴 이름이 들어오면 판을 옆으로 밀어낸다.
   375px 화면에서 1,211px 까지 밀렸다. overflow-wrap 은 물려받는 성질이라 감싸는 자리에 한 번만 둔다 */
.stage, .side, .rail, dialog { overflow-wrap: anywhere; }
.stage-head { padding: 28px 32px 0; }
.stage-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.4px; margin: 0 0 8px; line-height: 1.3; }
.stage-head p { margin: 0; color: var(--slate); font-size: 17px; line-height: 1.6; max-width: 700px; }
.stage-body { padding: 24px 32px 8px; }
.stage-body.two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, 1fr); gap: 28px; }
.stage-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 32px 20px; border-top: 1px solid var(--silver); flex-wrap: wrap; margin-top: 16px; }
.stage-foot .left, .stage-foot .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.note { font-size: 14px; color: var(--slate); margin: 0; }
.note.bad { color: var(--bad); }
.note:empty { display: none; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--slate); margin: 0; }
.status-line:empty { display: none; }
.stage-body > .status-line { padding: 12px 0; }

.side { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 16px; }
.dd { display: grid; grid-template-columns: 76px 1fr; gap: 8px 10px; font-size: 15px; margin: 0; line-height: 1.5; }
.dd dt { color: var(--slate); }
.dd dd { margin: 0; overflow-wrap: anywhere; }
.side-row { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; padding: 8px 0; border-bottom: 1px solid var(--silver); line-height: 1.45; }
.side-row:last-child { border-bottom: 0; }
.side-row .dot { margin-top: 7px; }
.side-row .t { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-row .off { text-decoration: line-through; color: var(--slate); }

/* 입력 */
.field { margin-bottom: 16px; }
.field > label, .field > .lbl { display: block; font-size: 14px; font-weight: 600; color: var(--graphite); margin-bottom: 6px; }
.field .hint { font-size: 14px; color: var(--slate); margin-top: 6px; }
input[type="text"], input[type="number"], input[type="password"], select, textarea {
  width: 100%;
  min-width: 0;
  font: inherit;
  letter-spacing: inherit;
  color: var(--graphite);
  background: var(--white);
  border: 1px solid var(--stone);
  border-radius: var(--r-input);
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  scrollbar-width: thin;
  scrollbar-color: var(--stone) transparent;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.65; }
input:focus, select:focus, textarea:focus { border-color: var(--action-ink); box-shadow: 0 0 0 3px var(--ring); }
textarea::placeholder, input::placeholder { color: var(--slate); opacity: 1; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 10px 0; cursor: pointer; }
.inline { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.app.no-side { grid-template-columns: 236px 1fr; }
.app.no-side .side { display: none; }
#notice-unknown .line { display: block; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 0 0 18px; }
.two-fields .field { margin-bottom: 0; }
.two-fields textarea { min-height: 78px; }
@media (max-width: 900px) { .two-fields { grid-template-columns: 1fr; } }
.row-fields { display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; margin: 16px 0 10px; }
.row-fields > div { display: flex; flex-direction: column; gap: 6px; }
.row-fields label { font-size: 14px; font-weight: 600; }
.row-fields input[type="number"] { width: 110px; }
.check.wide { margin: 0 0 8px; }
details.more { border-top: 1px solid var(--silver); padding-top: 12px; margin-top: 16px; }
details.more summary { font-size: 14px; color: var(--action-ink); cursor: pointer; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { color: var(--slate); }
details.more .field { margin-top: 12px; }
.dropzone { border: 1px solid var(--silver); border-radius: var(--r-card); padding: 16px 20px; display: flex; align-items: center; gap: 14px; background: var(--paper); margin-bottom: 12px; transition: border-color 0.15s; }
.dropzone.over { border-style: dashed; border-color: var(--action-ink); }
.dropzone .meta { flex: 1; }
#src-text { min-height: 420px; }
#final-text { min-height: 240px; }

/* 공고가 묻는 조건. 이 공고에만 있는 질문이라 답하면 코드가 바로 판정한다 */
.reqs { margin-bottom: 8px; }
.req { display: grid; grid-template-columns: 1fr minmax(200px, 300px); gap: 6px 18px; padding: 14px 0; border-bottom: 1px solid var(--silver); align-items: center; }
.req:last-of-type { border-bottom: 0; }
.req .ask { font-size: 16px; font-weight: 500; }
.req .ev { grid-column: 1; font-size: 14px; color: var(--slate); }
.req .ans { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; grid-row: span 2; }
.req .ans label { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; cursor: pointer; }
.req .verdict-mark { font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--slate); }
.req .v-bad { color: var(--bad); }
.req .v-warn { color: var(--warn); }
.req .v-ok { color: var(--ok); }
.req input[type="number"], .req input[type="text"], .req select { width: 150px; }
.reqs-none { font-size: 15px; color: var(--slate); padding: 12px 0; }

/* 판정 행, 표. 문법 하나. 점 + 굵은 판정어 + 이유 + 원문 */
.vrow { display: grid; grid-template-columns: 112px 1fr; gap: 2px 14px; padding: 13px 0; border-bottom: 1px solid var(--silver); font-size: 16px; align-items: start; }
.vrow:last-child { border-bottom: 0; }
.vrow .v { font-weight: 600; display: flex; align-items: center; gap: 8px; line-height: 1.5; }
.vrow .why { color: var(--graphite); line-height: 1.5; }
.vrow .ev { grid-column: 2; font-size: 14px; color: var(--slate); }
.vrow .check { grid-column: 2; margin: 6px 0 0; font-size: 14px; color: var(--slate); }
.v-bad .v { color: var(--bad); }
.v-warn .v { color: var(--warn); }
.v-ok .v { color: var(--ok); }
.verdict-card { display: flex; align-items: baseline; gap: 14px; padding: 4px 0 14px; border-bottom: 1px solid var(--silver); margin: 0 0 4px; flex-wrap: wrap; }
.verdict-card .big { font-size: 24px; font-weight: 600; letter-spacing: -0.3px; }
.verdict-card.bad .big { color: var(--bad); }
.verdict-card.warn .big { color: var(--warn); }
.verdict-card.ok .big { color: var(--ok); }
.verdict-card .meta { flex: 1; min-width: 220px; font-size: 15px; }
.verdict-card.col { flex-direction: column; align-items: flex-start; gap: 4px; }
.verdict-card.col .meta { flex: none; }
.verdict-card.col .big { font-size: 18px; line-height: 1.5; }
.kv { display: grid; grid-template-columns: 100px 1fr; gap: 0 16px; font-size: 16px; }
.kv > div { display: contents; }
.kv .k { color: var(--slate); padding: 12px 0; border-bottom: 1px solid var(--silver); font-size: 15px; }
.kv .val { padding: 12px 0; border-bottom: 1px solid var(--silver); }
.kv .val.null { color: var(--warn); }
.kv .ev { display: block; font-size: 14px; color: var(--slate); margin-top: 2px; }
.section-title { font-size: 17px; font-weight: 600; margin: 26px 0 8px; }
.section-title:first-child { margin-top: 0; }
.section-title .meta { font-weight: 400; margin-left: 8px; display: inline; }

/* 근거대장. 판정 행과 같은 문법 */
.fact { display: grid; grid-template-columns: 112px 1fr; gap: 3px 14px; padding: 14px 0; border-bottom: 1px solid var(--silver); font-size: 16px; align-items: start; }
.fact:last-of-type { border-bottom: 0; }
.fact .st { font-weight: 600; display: flex; align-items: center; gap: 8px; line-height: 1.5; white-space: nowrap; }
.fact .st.ok { color: var(--ok); }
.fact .st.q { color: var(--warn); }
.fact .claim { line-height: 1.55; }
.fact .claim .meta { display: block; }
.fact .src { grid-column: 2; font-size: 14px; color: var(--slate); overflow-wrap: anywhere; }
.fact .src a { color: var(--action-ink); }
.fact .keep { grid-column: 2; margin: 4px 0 0; font-size: 14px; color: var(--slate); }
.fact.off .claim, .fact.off .src { color: var(--slate); text-decoration: line-through; text-decoration-color: var(--silver); }

/* 각도. 행 셋. 고른 행만 잉크 테두리 */
.angles { display: flex; flex-direction: column; gap: 8px; }
.angle {
  border: 1px solid var(--silver);
  border-radius: var(--r-card);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  cursor: pointer;
  text-align: left;
  background: var(--white);
  color: var(--graphite);
  width: 100%;
  transition: border-color 0.15s;
  line-height: 1.55;
}
.angle:hover { border-color: var(--stone); }
.angle.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.angle h3 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -0.2px; line-height: 1.35; }
.angle .one { font-size: 16px; }
.angle .fit { font-size: 14px; color: var(--slate); }
.angle .weak { font-size: 15px; color: var(--warn); }
.angle .needs { font-size: 14px; color: var(--slate); }

/* 초안 */
.doc { border: 1px solid var(--silver); border-radius: var(--r-card); overflow: hidden; min-width: 0; background: var(--white); }
.doc-head { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--silver); font-size: 14px; color: var(--slate); flex-wrap: wrap; }
.doc-head .grow { flex: 1; min-width: 220px; }
.doc-head .grow b.warn { color: var(--warn); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.doc-body { padding: 10px 0; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; }
.ln { display: grid; grid-template-columns: 46px 1fr; padding-right: 20px; }
.gut { color: var(--slate); font-size: 13px; text-align: right; padding: 7px 12px 0 0; user-select: none; }
.ln.flag .gut { color: var(--warn); }
.txt { min-height: 1.85em; }
.ln-note { grid-column: 2; font-size: 13px; color: var(--warn); padding-bottom: 4px; line-height: 1.45; }
.cite { display: inline-block; font-size: 13px; font-weight: 600; border-radius: var(--r-pill); padding: 1px 9px; background: var(--action-wash); color: var(--action-ink); vertical-align: 1px; line-height: 1.55; white-space: nowrap; }
.cite.plan { background: var(--paper); color: var(--slate); }
.cite.blank, .cite.q { background: var(--warn-wash); color: var(--warn); }
mark.hit { background: var(--warn-wash); color: inherit; border-bottom: 2px solid var(--warn); padding: 1px 0; cursor: pointer; transition: background 0.15s; }
mark.hit.dim { background: transparent; border-bottom-color: var(--silver); }
mark.hit.focus { background: var(--warn-wash-strong); }
mark.num { background: var(--warn-wash); color: inherit; border-bottom: 2px dotted var(--warn); padding: 1px 0; }
.issue { padding: 13px 0; border-top: 1px solid var(--silver); font-size: 15px; }
.issue:first-child { border-top: 0; }
#draft-issues { margin-top: 16px; }
.issue .t { font-weight: 600; margin-bottom: 2px; }
.issue .t .meta { font-weight: 400; margin-left: 6px; display: inline; }
.issue ul { margin: 4px 0 0; padding-left: 20px; }
.issue li { margin: 3px 0; }
.issue.ai .t { color: var(--action-ink); }

/* 반박 */
.crit { display: grid; grid-template-columns: 112px 1fr; gap: 4px 14px; padding: 15px 0; border-bottom: 1px solid var(--silver); font-size: 16px; align-items: start; }
.crit:last-child { border-bottom: 0; }
.crit .sev { font-weight: 600; color: var(--slate); }
.crit .sev-high { color: var(--bad); }
.crit .sev-mid { color: var(--warn); }
.crit .sev-low { color: var(--slate); }
.crit .where { color: var(--slate); font-size: 14px; grid-column: 2; }
.crit .fix { grid-column: 2; color: var(--graphite); }
.crit .fix::before { content: "고침. "; color: var(--slate); }
.crit .accept { grid-column: 2; margin: 6px 0 0; font-size: 14px; color: var(--slate); }
.crit.on .accept { color: var(--graphite); font-weight: 600; }
.doc-edit { padding: 12px 16px 16px; border-top: 1px solid var(--silver); }
.doc-edit textarea { min-height: 340px; margin-top: 8px; }
.row-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.mail { font-size: 15px; line-height: 1.7; padding: 4px 0 8px; }
.mail pre { font: inherit; white-space: pre-wrap; margin: 6px 0 10px; padding: 12px 16px; border-left: 2px solid var(--silver); }
.mail .k { color: var(--slate); margin-right: 8px; }
.verdict { font-size: 18px; font-weight: 600; margin: 16px 0 0; line-height: 1.5; }

/* 빈 상태, 확인함 */
.empty { padding: 28px 0; text-align: left; color: var(--slate); font-size: 15px; display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid var(--silver); }
.empty b { display: block; font-size: 17px; color: var(--graphite); }
.tick { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding: 15px 0 6px; border-top: 1px solid var(--silver); font-size: 15px; cursor: pointer; color: var(--slate); }
.tick.on { color: var(--graphite); font-weight: 600; }

/* ---------- 검사기 화면 (index.html) ---------- */
.hero { padding: 48px 0 28px; }
h1 { font-size: 36px; font-weight: 600; line-height: 1.25; letter-spacing: -0.5px; margin: 0 0 12px; max-width: 820px; text-wrap: balance; }
.lede { font-size: 18px; line-height: 1.6; color: var(--slate); margin: 0; max-width: 720px; }
.editor { background: var(--white); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 24px; }
.editor-head { display: flex; justify-content: space-between; font-size: 14px; color: var(--slate); margin-bottom: 10px; }
.editor textarea { min-height: 340px; padding: 16px; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.kbd { margin-left: auto; font-size: 13px; color: var(--slate); }
.results { animation: rise 0.3s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pipeline { display: flex; align-items: center; flex-wrap: wrap; row-gap: 8px; margin: 36px 0 8px; }
.node { display: inline-flex; align-items: baseline; gap: 8px; padding: 9px 4px; font-size: 15px; background: transparent; white-space: nowrap; color: var(--graphite); border: 0; }
.node .k { font-size: 14px; color: var(--slate); }
.node .v { font-size: 17px; font-weight: 600; line-height: 1; }
.node[data-layer="ai"] { background: var(--ink); color: var(--on-ink); border-radius: var(--r-pill); padding: 9px 16px; cursor: pointer; transition: opacity 0.15s; }
.node[data-layer="ai"] .k { color: var(--on-ink); opacity: 0.8; }
.node[data-layer="ai"]:hover { opacity: 0.88; }
.node[data-layer="ai"]:disabled { cursor: wait; opacity: 0.7; }
.link { width: 24px; height: 1px; background: var(--silver); flex: none; margin: 0 4px; }
.pipe-note { font-size: 14px; color: var(--slate); margin: 0 0 20px; line-height: 1.55; }
.pipe-note .err { color: var(--bad); }
.pipe-note .mock, .pipe-note .usage { color: var(--graphite); }
.results-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.views { display: flex; gap: 6px; }
.rw-actions { display: inline-flex; gap: 6px; }
.chg-before { display: block; color: var(--slate); text-decoration: line-through; text-decoration-color: var(--silver); margin-bottom: 2px; }
.list { position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow: auto; display: flex; flex-direction: column; gap: 14px; min-width: 0; scrollbar-width: thin; scrollbar-color: var(--stone) transparent; }
.pass { background: var(--white); border-radius: var(--r-card); box-shadow: var(--shadow-card); padding: 20px; font-size: 21px; font-weight: 600; letter-spacing: -0.3px; }
.pass small { display: block; font-weight: 400; font-size: 14px; color: var(--slate); margin-top: 6px; }
.grp { background: var(--white); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
.grp h3 { margin: 0; padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--slate); display: flex; justify-content: space-between; border-bottom: 1px solid var(--silver); }
.grp .cnt { color: var(--graphite); }
.grp.ai h3, .grp.ai .cnt { color: var(--action-ink); }
.grp-note { margin: 0; padding: 8px 16px; font-size: 14px; color: var(--slate); border-bottom: 1px solid var(--silver); line-height: 1.5; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--silver); padding: 12px 16px; cursor: pointer; color: var(--graphite); transition: background 0.15s; }
.item:last-child { border-bottom: 0; }
.item:hover, .item.focus { background: var(--warn-wash-faint); }
.item-hit { font-size: 16px; overflow-wrap: anywhere; font-weight: 500; }
.item-why { grid-column: 1 / -1; font-size: 14px; color: var(--slate); line-height: 1.5; }
.item-why em { display: block; font-style: normal; color: var(--slate); }
.item-why em.fix { color: var(--graphite); margin-top: 4px; }
.item-ln { font-size: 13px; color: var(--slate); white-space: nowrap; }

/* 바닥 */
.foot { padding: 32px 0 48px; color: var(--slate); font-size: 15px; margin-top: 8px; line-height: 1.6; }
.foot p { margin: 0 0 8px; max-width: 760px; }

/* 대화상자 */
dialog { border: 0; border-radius: 16px; padding: 28px; background: var(--white); color: var(--graphite); max-width: 580px; width: calc(100% - 48px); font: inherit; box-shadow: var(--shadow-hover); }
dialog::backdrop { background: var(--scrim); }
dialog h2 { font-size: 22px; font-weight: 600; margin: 0 0 12px; letter-spacing: -0.3px; }
dialog p { margin: 0 0 10px; font-size: 15px; line-height: 1.6; color: var(--slate); }
dialog p b { color: var(--graphite); }
dialog .lbl { display: block; font-size: 14px; font-weight: 600; margin-top: 10px; }
dialog input, dialog select { margin: 6px 0 10px; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }

/* 좁은 화면. 세로 단계 목록이 위쪽 가로 띠로, 옆 패널은 아래로 */
@media (max-width: 1000px) {
  /* no-side 를 빠뜨렸더니 공고를 넣기 전 첫 화면만 세 칸짜리로 남아 폰에서 옆으로 밀렸다.
     no-side 는 두 낱말이라 이 규칙보다 세서, 여기 같이 안 적으면 안 눌린다 */
  .app, .app.wide, .app.no-side { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .rail { position: sticky; top: 62px; padding-left: 4px; z-index: 5; flex-direction: row; overflow-x: auto; gap: 6px; padding: 8px 28px 8px 0; background: var(--paper); scrollbar-width: none; mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 28px), transparent); }
  .rail::-webkit-scrollbar { display: none; }
  .step { flex: none; grid-template-columns: 26px auto; padding: 8px 14px 8px 8px; gap: 0 8px; background: var(--white); box-shadow: none; border: 1px solid var(--silver); }
  .step[aria-current="step"] { border-color: var(--ink); }
  .step { grid-template-columns: 26px auto auto; }
  .step .st .t { display: none; }
  .step .st { gap: 0; }
  .step .no { width: 26px; height: 26px; grid-row: auto; }
  .rail-foot, .rail-legend { display: none; }
  .side { position: static; }
  .stage-head { padding: 20px 20px 0; }
  .stage-body { padding: 16px 20px 8px; }
  .stage-body.two { grid-template-columns: 1fr; gap: 12px; }
  .stage-foot { padding: 14px 20px 16px; }
  .vrow, .crit, .fact { grid-template-columns: 96px 1fr; font-size: 15px; }
  .kv { grid-template-columns: 88px 1fr; font-size: 15px; }
  .req { grid-template-columns: 1fr; gap: 4px; }
  .req .ans { grid-row: auto; margin-top: 4px; }
  .brand-sub { display: none; }
  /* 좁은 폭에서 알약 버튼이 줄바꿈하면서 제목을 아래로 밀어냈다. 제목이 먼저 오고 버튼은 그 아래 한 줄로 */
  .top-row { flex-wrap: wrap; height: auto; padding: 10px 0; row-gap: 8px; }
  .brand { flex: 1 1 100%; }
  .top-nav { flex: 1 1 100%; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .top-nav::-webkit-scrollbar { display: none; }
  .top-nav .pill, .top-nav .tag { flex: none; }
  .rail { top: 0; }
  /* 판정 문장이 큰 글자 옆에 끼어 두 줄 다 좁아졌다. 좁은 폭에서는 위아래로 */
  .verdict-card { flex-direction: column; align-items: flex-start; gap: 6px; }
  .verdict-card .meta { flex: none; min-width: 0; }
  .hero { padding: 28px 0 20px; }
  h1 { font-size: 28px; }
  .lede { font-size: 16px; }
  .editor { padding: 16px; }
  .kbd { display: none; }
  .link { display: none; }
  .results-grid { grid-template-columns: 1fr; }
  .list { position: static; max-height: none; }
  .ln { grid-template-columns: 36px 1fr; padding-right: 12px; }
  .doc-head { gap: 8px; }
  .chips { flex: 1 1 100%; order: 3; }
  dialog { padding: 20px; }
  #src-text { min-height: 320px; }
}
@media (max-width: 420px) {
  .inline { grid-template-columns: 1fr; }
  /* 375px 화면에서 위 줄이 42px 넘쳐 사용법 단추가 옆으로 밀려 나 있었다.
     옆으로 밀어야 보이는 단추는 사실상 없는 단추다. 좁은 폭에서는 두 줄로 접는다 */
  .top-nav { flex-wrap: wrap; overflow-x: visible; row-gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .results { animation: none; }
  .pill, .chip, mark.hit, .item, textarea, .node, .step, .angle, input[type="checkbox"] { transition: none; }
}

/* 공고함. 하던 것을 마감 가까운 순으로 */
.works { margin-bottom: 18px; }
.works .work { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--silver); }
.works .work:last-child { border-bottom: 0; }
.work-open { flex: 1; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; background: none; border: 0; padding: 4px 0; cursor: pointer; color: inherit; font: inherit; }
.work-open:hover .work-title { text-decoration: underline; }
.work-title { font-weight: 600; }

/* 잘못 잡았다고 표시한 것. 브라우저 안에만 쌓인다 */
.item-wrap { position: relative; }
.item-wrap .no { position: absolute; right: 10px; bottom: 8px; font-size: 12px; opacity: .55; }
.item-wrap:hover .no, .item-wrap .no:focus { opacity: 1; }
.item-wrap .no[disabled] { opacity: .45; cursor: default; text-decoration: none; }
.fixes { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--silver); font-size: 13px; color: var(--slate); }
