/* ==========================================================================
   반출 판정 시연 — 연구안보컨트롤센터(RSCC)
   디자인 개념: "반출 창구" — 분류함(결과) · 검문 경로(판정 과정) · 도장(판정)
   외부 글꼴·라이브러리 없음. 색은 모두 아래 토큰에서만 가져온다.
   ========================================================================== */

:root {
  /* 종이와 잉크 */
  --paper: #EDF0ED;          /* 재생지 사무 양식 같은 바탕 */
  --sheet: #FFFFFF;          /* 문서 한 장 */
  --sheet-2: #F5F7F5;        /* 안쪽 칸 */
  --sheet-3: #E6EAE6;
  --ink: #14202B;            /* 청흑색 잉크 */
  --ink-2: #485564;
  --ink-3: #5F6B78;
  --rule: #D2D8D3;
  --rule-strong: #B7C0B9;
  --accent: #2C4BA0;         /* 볼펜 파랑: 링크·선택·포커스 */
  --accent-bg: #E4E9F7;
  --focus: #2C4BA0;

  /* 판정 의미색: 항상 글자·아이콘과 함께 쓴다 */
  --allow: #136B42;  --allow-bg: #E0F0E6;  --allow-line: #86C2A0;  --allow-fill: #2E8B5B;
  --review: #974705; --review-bg: #FBEAD5; --review-line: #E7AE6E; --review-fill: #D2720F;
  --hold: #AD2217;   --hold-bg: #F8E0DC;   --hold-line: #E39A91;   --hold-fill: #C8392C;
  --skip: #7C8792;   --skip-bg: #EEF1EF;

  /* 강조 표시(문서 하이라이트) */
  --hl-pii: #FFE2A8;
  --hl-mark: #F6C6C0;
  --hl-kw: #D7E2FA;

  --shadow-1: 0 1px 0 rgba(20, 32, 43, .06), 0 1px 3px rgba(20, 32, 43, .06);
  --shadow-2: 0 2px 0 rgba(20, 32, 43, .05), 0 8px 24px -10px rgba(20, 32, 43, .22);

  --font-sans: "Pretendard Variable", Pretendard, "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --font-mono: "D2Coding", Consolas, "SF Mono", Menlo, "Liberation Mono", ui-monospace, monospace;

  --t-xs: .8125rem;   /* 13 */
  --t-sm: .90625rem;  /* 14.5 */
  --t-base: 1.0625rem;/* 17 */
  --t-md: 1.1875rem;  /* 19 */
  --t-lg: 1.5rem;     /* 24 */
  --t-xl: 2rem;       /* 32 */
  --t-hero: clamp(2rem, 1.2rem + 3.1vw, 3.4rem);
  --t-num: clamp(3rem, 2rem + 4vw, 5.25rem);

  --r-1: 6px; --r-2: 10px; --r-3: 16px;
  --gut: clamp(16px, 3.2vw, 40px);
  --maxw: 1240px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1318; --sheet: #161D24; --sheet-2: #1B232B; --sheet-3: #232D36;
    --ink: #E5EAEE; --ink-2: #AEB8C2; --ink-3: #95A1AC;
    --rule: #2A343E; --rule-strong: #3A4651;
    --accent: #9DB2FF; --accent-bg: #1E2847; --focus: #9DB2FF;
    --allow: #67D198; --allow-bg: #13301F; --allow-line: #2E6E4B; --allow-fill: #3FAF73;
    --review: #F4AC64; --review-bg: #3A2510; --review-line: #7C5225; --review-fill: #E08A2E;
    --hold: #FF968B;   --hold-bg: #3C1714;   --hold-line: #7E3A33;   --hold-fill: #E5584A;
    --skip: #8E99A4;   --skip-bg: #1F272F;
    --hl-pii: #5A4413; --hl-mark: #5C2420; --hl-kw: #26335A;
    --shadow-1: 0 1px 0 rgba(0,0,0,.4); --shadow-2: 0 10px 30px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1318; --sheet: #161D24; --sheet-2: #1B232B; --sheet-3: #232D36;
  --ink: #E5EAEE; --ink-2: #AEB8C2; --ink-3: #95A1AC;
  --rule: #2A343E; --rule-strong: #3A4651;
  --accent: #9DB2FF; --accent-bg: #1E2847; --focus: #9DB2FF;
  --allow: #67D198; --allow-bg: #13301F; --allow-line: #2E6E4B; --allow-fill: #3FAF73;
  --review: #F4AC64; --review-bg: #3A2510; --review-line: #7C5225; --review-fill: #E08A2E;
  --hold: #FF968B;   --hold-bg: #3C1714;   --hold-line: #7E3A33;   --hold-fill: #E5584A;
  --skip: #8E99A4;   --skip-bg: #1F272F;
  --hl-pii: #5A4413; --hl-mark: #5C2420; --hl-kw: #26335A;
  --shadow-1: 0 1px 0 rgba(0,0,0,.4); --shadow-2: 0 10px 30px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: 1.62;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.28; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
code, .mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--ink); color: var(--sheet); padding: 10px 14px; border-radius: var(--r-1); }
.skip-link:focus { top: 12px; }
.noscript { padding: 24px; text-align: center; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }
.main { flex: 1; outline: none; }
.main > * { animation: viewIn .32s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ topbar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--rule); }
.topbar__inner { max-width: var(--maxw); margin: 0 auto; padding: 10px var(--gut); display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand__mark { color: var(--ink); }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-weight: 700; font-size: var(--t-base); letter-spacing: -0.01em; }
.brand__org { font-size: var(--t-xs); color: var(--ink-3); }
.mainnav { display: flex; gap: 4px; margin-left: auto; }
.mainnav__link { color: var(--ink-2); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: var(--t-sm); white-space: nowrap; }
.mainnav__link:hover { color: var(--ink); background: var(--sheet-3); }
.mainnav__link[aria-current="page"] { color: var(--sheet); background: var(--ink); }
.topbar__tools { display: flex; align-items: center; gap: 8px; }
.mockflag { font-size: var(--t-xs); font-weight: 700; color: var(--accent); background: var(--accent-bg); border: 1px dashed var(--accent); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.iconbtn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink-2); }
.iconbtn:hover { color: var(--ink); border-color: var(--rule-strong); }
.iconbtn .i-sun { display: none; }
:root[data-theme="dark"] .iconbtn .i-sun { display: block; }
:root[data-theme="dark"] .iconbtn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .iconbtn .i-sun { display: block; }
  :root:not([data-theme="light"]) .iconbtn .i-moon { display: none; }
}

@media (max-width: 760px) {
  .topbar__inner { flex-wrap: wrap; gap: 8px 12px; padding-top: 8px; padding-bottom: 8px; }
  .brand__org { display: none; }
  .mainnav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .mainnav__link { flex: 1; text-align: center; padding: 8px 6px; }
  .topbar__tools { margin-left: auto; }
  html { scroll-padding-top: 120px; }
}

.footer { border-top: 1px solid var(--rule); margin-top: 72px; color: var(--ink-3); font-size: var(--t-xs); }
.footer__inner { max-width: var(--maxw); margin: 0 auto; padding: 22px var(--gut) 34px; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; }
.footer__meta { font-family: var(--font-mono); }

.boot { padding: 120px var(--gut); text-align: center; color: var(--ink-3); }

/* ------------------------------------------------------------------ type helpers */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-xs); font-weight: 700; letter-spacing: .06em; color: var(--ink-3); }
.eyebrow--rule::before { content: ""; width: 22px; height: 2px; background: currentColor; }
.lede { font-size: var(--t-md); color: var(--ink-2); line-height: 1.6; max-width: 46em; }
.muted { color: var(--ink-3); }
.small { font-size: var(--t-sm); }
.xs { font-size: var(--t-xs); }
.num { font-variant-numeric: tabular-nums; }
.strong { font-weight: 700; }
.term { border-bottom: 1px dotted var(--ink-3); cursor: help; }

.section { margin-top: 64px; }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 24px; margin-bottom: 20px; }
.section__title { font-size: var(--t-xl); }
.section__desc { color: var(--ink-2); max-width: 44em; margin-top: 6px; }

.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-3); box-shadow: var(--shadow-1); }
.sheet--pad { padding: clamp(18px, 2.6vw, 30px); }

/* ------------------------------------------------------------------ buttons & chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--sheet); color: var(--ink); font-weight: 700; font-size: var(--t-sm); text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn--primary { background: var(--ink); color: var(--sheet); border-color: var(--ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--accent)); }
.btn--primary:disabled { background: var(--sheet-3); color: var(--ink-3); border-color: var(--rule); cursor: not-allowed; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--accent); padding-left: 8px; padding-right: 8px; }
.btn--lg { min-height: 54px; padding: 12px 26px; font-size: var(--t-base); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: var(--t-xs); font-weight: 700; background: var(--sheet-2); border: 1px solid var(--rule); color: var(--ink-2); white-space: nowrap; }
.chip--mono { font-family: var(--font-mono); font-weight: 600; }

/* 판정 배지 — 색 + 아이콘 + 글자 */
.verdict { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 8px; border-radius: 999px; font-weight: 700; font-size: var(--t-sm); border: 1.5px solid; white-space: nowrap; line-height: 1.3; }
.verdict svg { flex-shrink: 0; }
.verdict--ALLOW { color: var(--allow); background: var(--allow-bg); border-color: var(--allow-line); }
.verdict--REVIEW { color: var(--review); background: var(--review-bg); border-color: var(--review-line); }
.verdict--HOLD { color: var(--hold); background: var(--hold-bg); border-color: var(--hold-line); }
.verdict--sm { font-size: var(--t-xs); padding: 2px 8px 2px 6px; }
.tone-ALLOW { color: var(--allow); }
.tone-REVIEW { color: var(--review); }
.tone-HOLD { color: var(--hold); }

/* 도장 — 판정 결과의 상징 */
.stamp {
  --c: var(--ink);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--c); border: 5px double var(--c); border-radius: 14px;
  padding: 12px 22px 10px; transform: rotate(-4deg);
  font-weight: 800; letter-spacing: .08em; line-height: 1.1; text-align: center;
  background: color-mix(in srgb, var(--c) 6%, transparent);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.6 1.45'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.6 1.45'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}
.stamp__word { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.3rem); white-space: nowrap; }
.stamp__sub { font-size: var(--t-xs); letter-spacing: .02em; font-weight: 700; opacity: .92; }
.stamp--ALLOW { --c: var(--allow); }
.stamp--REVIEW { --c: var(--review); }
.stamp--HOLD { --c: var(--hold); }
.stamp--sm { border-width: 4px; padding: 6px 12px 5px; border-radius: 10px; }
.stamp--sm .stamp__word { font-size: var(--t-md); }
.stamp.is-pressing { animation: stampPress .5s var(--ease) both; }
@keyframes stampPress {
  0% { opacity: 0; transform: rotate(-4deg) scale(1.6); }
  60% { opacity: 1; transform: rotate(-4deg) scale(.96); }
  100% { opacity: 1; transform: rotate(-4deg) scale(1); }
}

/* ------------------------------------------------------------------ alerts */
.notice { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r-2); border: 1px solid var(--rule-strong); background: var(--sheet); }
.notice__icon { flex-shrink: 0; margin-top: 2px; color: var(--ink); }
.notice__title { font-weight: 700; }
.notice--warn { border: 2px solid var(--ink); background: var(--sheet); }
.notice--mock { border: 1px dashed var(--accent); background: var(--accent-bg); color: var(--ink); }
.notice--error { border: 2px solid var(--hold-line); background: var(--hold-bg); }
.notice--error .notice__icon { color: var(--hold); }
.notice code { background: var(--sheet-2); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--rule); }

/* ==================================================================
   홈 — 판정 결과 한눈에
   ================================================================== */
.hero { padding-top: clamp(32px, 6vw, 72px); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px 56px; align-items: end; }
.hero__title { font-size: var(--t-hero); line-height: 1.18; letter-spacing: -0.035em; margin-top: 14px; }
.hero__title em { font-style: normal; color: var(--accent); }
.hero__lede { margin-top: 18px; }
.hero__side { display: flex; flex-direction: column; gap: 10px; }
.hero__sidelabel { font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }

/* 데이터셋 고르기 */
.dsswitch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dsopt { position: relative; text-align: left; border: 1.5px solid var(--rule); background: var(--sheet); border-radius: var(--r-2); padding: 11px 14px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.dsopt:hover { border-color: var(--rule-strong); }
.dsopt[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.dsopt__name { font-weight: 700; font-size: var(--t-sm); line-height: 1.35; }
.dsopt__meta { font-size: var(--t-xs); color: var(--ink-3); }
.dsopt__tag { position: absolute; top: -9px; right: 10px; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--ink); color: var(--sheet); }
.dsopt__tag--warn { background: var(--hold); }
@media (max-width: 420px) { .dsswitch { grid-template-columns: 1fr; } }

/* 분류함 3개 */
.trays { margin-top: 36px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tray { --c: var(--ink); --bg: var(--sheet); --line: var(--rule); position: relative; background: var(--sheet); border: 1px solid var(--rule); border-top: 6px solid var(--c); border-radius: var(--r-3); padding: 20px 20px 18px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; min-width: 0; }
.tray--ALLOW { --c: var(--allow-fill); --t: var(--allow); --bg: var(--allow-bg); --line: var(--allow-line); }
.tray--REVIEW { --c: var(--review-fill); --t: var(--review); --bg: var(--review-bg); --line: var(--review-line); }
.tray--HOLD { --c: var(--hold-fill); --t: var(--hold); --bg: var(--hold-bg); --line: var(--hold-line); }
.tray__head { display: flex; align-items: center; gap: 8px; color: var(--t); font-weight: 800; font-size: var(--t-md); }
.tray__sub { font-size: var(--t-sm); font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.tray__count { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.tray__num { font-size: var(--t-num); font-weight: 800; letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.tray__unit { font-size: var(--t-lg); font-weight: 700; color: var(--ink-2); }
.tray__truth { margin-top: 8px; font-size: var(--t-sm); color: var(--ink-2); }
.tray__truth b { font-variant-numeric: tabular-nums; }
.tiles { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, 20px); gap: 5px; align-content: start; min-height: 30px; }
.tile { width: 20px; height: 26px; border-radius: 3px; background: var(--bg); border: 1.5px solid var(--line); position: relative; display: block; transition: transform .15s var(--ease); }
.tile::before { content: ""; position: absolute; left: 4px; right: 5px; top: 6px; height: 1.5px; background: var(--line); box-shadow: 0 4px 0 var(--line), 0 8px 0 var(--line); opacity: .9; }
.tile:hover { transform: translateY(-2px); }
.tile--wrong { background: var(--sheet); border: 2px solid var(--ink); }
.tile--wrong::before { display: none; }
.tile--wrong::after { content: ""; position: absolute; inset: 4px 3px; background:
  linear-gradient(45deg, transparent 43%, var(--ink) 43%, var(--ink) 57%, transparent 57%),
  linear-gradient(-45deg, transparent 43%, var(--ink) 43%, var(--ink) 57%, transparent 57%); }
.tile--critical { border-color: var(--hold); background: var(--hold-bg); }
.tile--critical::after { background:
  linear-gradient(45deg, transparent 40%, var(--hold) 40%, var(--hold) 60%, transparent 60%),
  linear-gradient(-45deg, transparent 40%, var(--hold) 40%, var(--hold) 60%, transparent 60%); }
.tiles.is-entering .tile { animation: tileIn .4s var(--ease) both; animation-delay: calc(var(--i) * 9ms); }
@keyframes tileIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tray__legend { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--t-xs); color: var(--ink-3); }
.legend-tile { display: inline-flex; align-items: center; gap: 6px; }
.legend-tile .tile { width: 12px; height: 16px; border-width: 1.5px; }
.legend-tile .tile::before { display: none; }
.legend-tile .tile--wrong::after, .legend-tile .tile--critical::after { inset: 2px; }
@media (max-width: 900px) { .trays { grid-template-columns: 1fr; } }

.scoreline { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 18px 22px; border-radius: var(--r-3); background: var(--ink); color: var(--sheet); }
.scoreline__big { font-size: var(--t-xl); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scoreline__big small { font-size: var(--t-md); font-weight: 600; opacity: .75; margin-left: 4px; }
.scoreline__label { font-size: var(--t-sm); opacity: .78; font-weight: 600; display: block; letter-spacing: .02em; }
.scoreline__text { flex: 1; min-width: 240px; font-size: var(--t-base); line-height: 1.55; }
.scoreline__text b { font-weight: 800; }
.scoreline__bar { flex-basis: 100%; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--sheet) 22%, transparent); overflow: hidden; display: flex; }
.scoreline__bar span { display: block; height: 100%; }

/* 정답 대 AI 판정 3x3 */
.twocol { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 980px) { .twocol { grid-template-columns: 1fr; } }
.panel-title { font-size: var(--t-lg); }
.panel-desc { color: var(--ink-2); margin-top: 6px; font-size: var(--t-sm); }

.matrix { width: 100%; border-collapse: separate; border-spacing: 6px; margin-top: 14px; table-layout: fixed; }
.matrix caption { text-align: left; }
.matrix th { font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); padding: 4px; }
.matrix thead th { text-align: center; }
.matrix tbody th { text-align: right; width: 22%; }
.matrix__axis { font-size: var(--t-xs); color: var(--ink-3); font-weight: 700; letter-spacing: .03em; }
.mcell { width: 100%; min-height: 86px; border-radius: var(--r-2); border: 1.5px solid var(--rule); background: var(--sheet-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; color: var(--ink); }
.mcell__n { font-size: var(--t-xl); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.mcell__k { font-size: 12px; font-weight: 700; line-height: 1.25; text-align: center; }
.mcell--zero { color: var(--ink-3); background: transparent; border-style: dashed; }
.mcell--zero .mcell__n { font-weight: 600; }
.mcell--ok-ALLOW { background: var(--allow-bg); border-color: var(--allow-line); }
.mcell--ok-REVIEW { background: var(--review-bg); border-color: var(--review-line); }
.mcell--ok-HOLD { background: var(--hold-bg); border-color: var(--hold-line); }
.mcell--ok-ALLOW .mcell__k { color: var(--allow); } .mcell--ok-REVIEW .mcell__k { color: var(--review); } .mcell--ok-HOLD .mcell__k { color: var(--hold); }
.mcell--critical { border: 2.5px solid var(--hold); background: repeating-linear-gradient(-45deg, var(--hold-bg) 0 7px, var(--sheet) 7px 13px); }
.mcell--critical .mcell__k { color: var(--hold); }
.mcell--over, .mcell--mitigated { border: 1.5px dashed var(--ink-3); background: repeating-linear-gradient(-45deg, var(--sheet-2) 0 7px, var(--sheet) 7px 13px); }
button.mcell:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
button.mcell[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 1px; }
.matrix-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: var(--t-xs); color: var(--ink-2); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; border: 1.5px solid var(--rule-strong); }
.swatch--ok { background: var(--sheet-3); }
.swatch--critical { border: 2px solid var(--hold); background: repeating-linear-gradient(-45deg, var(--hold-bg) 0 3px, var(--sheet) 3px 6px); }
.swatch--over { border: 1.5px dashed var(--ink-3); background: repeating-linear-gradient(-45deg, var(--sheet-2) 0 3px, var(--sheet) 3px 6px); }

/* AI 없이 키워드만 쓰면 */
.compare { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.cmprow { display: grid; grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr); gap: 6px 16px; align-items: center; padding: 14px 14px; border-radius: var(--r-2); border: 1.5px solid var(--rule); background: var(--sheet-2); text-align: left; color: var(--ink); width: 100%; }
.cmprow:hover { border-color: var(--rule-strong); }
.cmprow[aria-current="true"] { border-color: var(--ink); background: var(--sheet); }
.cmprow__name { font-weight: 800; font-size: var(--t-sm); line-height: 1.35; }
.cmprow__name small { display: block; font-weight: 600; color: var(--ink-3); font-size: var(--t-xs); }
.cmprow__bars { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mbar { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) 3.4em; align-items: center; gap: 10px; font-size: var(--t-xs); color: var(--ink-2); }
.mbar__track { height: 10px; border-radius: 999px; background: var(--sheet-3); overflow: hidden; }
.mbar__fill { height: 100%; border-radius: 999px; background: var(--ink); transition: width .5s var(--ease); }
.mbar__val { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.missdots { display: flex; flex-wrap: wrap; gap: 3px; min-height: 12px; align-items: center; }
.missdot { width: 11px; height: 11px; border-radius: 50%; background: var(--hold-fill); box-shadow: inset 0 0 0 1.5px var(--hold); }
.missdots__none { font-size: var(--t-xs); color: var(--allow); font-weight: 700; }
.cmp-note { margin-top: 14px; font-size: var(--t-sm); color: var(--ink-2); }
@media (max-width: 520px) { .cmprow { grid-template-columns: 1fr; } .mbar { grid-template-columns: 5.6em minmax(0, 1fr) 3em; } }

/* 솔직한 안내 */
.honest { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .honest { grid-template-columns: 1fr; } }
.misscard { border: 2px solid var(--hold-line); border-left: 8px solid var(--hold); border-radius: var(--r-3); background: var(--sheet); padding: 20px 22px; }
.misscard__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.misscard__title { font-size: var(--t-md); margin-top: 10px; }
.misscard__why { margin-top: 8px; color: var(--ink-2); }
.misscard__arrow { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); }
.misscard__list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.misscard__list li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-1); background: var(--sheet-2); }
.goodcard { border-radius: var(--r-3); background: var(--sheet); border: 1px solid var(--rule); padding: 20px 22px; }
.idchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.idchip { font-family: var(--font-mono); font-size: var(--t-xs); font-weight: 600; padding: 4px 9px; border-radius: 6px; border: 1px solid var(--rule-strong); color: var(--ink); text-decoration: none; background: var(--sheet-2); }
.idchip:hover { border-color: var(--accent); color: var(--accent); }

/* 목록: 필터 + 카드 */
.filters { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; padding: 16px 18px; border-radius: var(--r-3); background: var(--sheet); border: 1px solid var(--rule); }
.fgroup { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fgroup__label { font-size: var(--t-xs); font-weight: 700; color: var(--ink-3); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 999px; background: var(--sheet-2); border: 1px solid var(--rule); }
.seg__btn { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; min-height: 34px; }
.seg__btn:hover { color: var(--ink); }
.seg__btn[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }
.field { min-height: 42px; border-radius: var(--r-2); border: 1.5px solid var(--rule-strong); background: var(--sheet); padding: 8px 12px; font-size: var(--t-sm); color: var(--ink); }
.field:focus-visible { outline-offset: 0; }
.field--search { min-width: 220px; padding-left: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18' fill='none' stroke='%235F6B78' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m20 20-4.2-4.2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 11px 50%; }
.fgroup--grow { flex: 1; min-width: 200px; }
.fgroup--grow .field { width: 100%; }
.activefilter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: var(--t-sm); }
.resultcount { margin: 16px 0 10px; color: var(--ink-2); font-size: var(--t-sm); }
.resultcount b { color: var(--ink); font-variant-numeric: tabular-nums; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.card { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 16px 18px; border-radius: var(--r-3); background: var(--sheet); border: 1px solid var(--rule); color: var(--ink); text-decoration: none; position: relative; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
.card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.card__top { display: flex; align-items: flex-start; gap: 12px; }
.card__icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; background: var(--sheet-2); border: 1px solid var(--rule); display: grid; place-items: center; color: var(--ink-2); }
.card__meta { font-size: var(--t-xs); color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.card__id { font-family: var(--font-mono); font-weight: 700; color: var(--ink-2); }
.card__title { font-size: var(--t-base); font-weight: 700; line-height: 1.4; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__to { display: flex; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--ink-2); }
.card__to svg { flex-shrink: 0; color: var(--ink-3); }
.card__foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--rule); }
.match { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-xs); font-weight: 700; }
.match--ok { color: var(--allow); }
.match--bad { color: var(--hold); }
.match--over { color: var(--ink-2); }
.card--critical { border: 2px solid var(--hold-line); }
.cards-more { display: flex; justify-content: center; margin-top: 18px; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-2); border: 1.5px dashed var(--rule-strong); border-radius: var(--r-3); }

/* ==================================================================
   상세 — 판정 과정 보기
   ================================================================== */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding-top: 24px; font-size: var(--t-sm); color: var(--ink-3); }
.crumbs a { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }

.banner { margin-top: 16px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 40px; align-items: center; padding: clamp(22px, 3.5vw, 40px); border-radius: var(--r-3); background: var(--sheet); border: 1px solid var(--rule); box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.banner::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; background: var(--c, var(--ink)); }
.banner--ALLOW { --c: var(--allow-fill); } .banner--REVIEW { --c: var(--review-fill); } .banner--HOLD { --c: var(--hold-fill); }
.banner__stampwrap { padding: 6px 10px 6px 14px; }
.banner__title { font-size: clamp(1.4rem, 1.05rem + 1.3vw, 2.1rem); line-height: 1.35; letter-spacing: -0.025em; margin-top: 6px; }
.banner__docid { font-family: var(--font-mono); font-size: var(--t-sm); color: var(--ink-3); font-weight: 600; }
.verdictcmp { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; border-radius: var(--r-2); background: var(--sheet-2); border: 1px solid var(--rule); font-size: var(--t-sm); }
.verdictcmp--ok { border-color: var(--allow-line); }
.verdictcmp--bad { border: 2px solid var(--hold); background: var(--hold-bg); }
.verdictcmp--over { border: 1.5px dashed var(--ink-3); }
.verdictcmp__lead { font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.verdictcmp__explain { flex-basis: 100%; color: var(--ink); line-height: 1.6; }
@media (max-width: 640px) {
  .banner { grid-template-columns: 1fr; }
  .banner__stampwrap { justify-self: start; }
}

/* 누가 무엇을 어디로 왜 */
.route4 { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1.25fr) 40px minmax(0, 1.15fr); align-items: stretch; }
.route4__node { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-3); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.route4__k { display: flex; align-items: center; gap: 8px; font-size: var(--t-xs); font-weight: 800; color: var(--ink-3); letter-spacing: .04em; }
.route4__k svg { color: var(--ink-2); }
.route4__main { font-weight: 700; line-height: 1.4; }
.route4__sub { font-size: var(--t-sm); color: var(--ink-2); }
.route4__arrow { display: grid; place-items: center; color: var(--ink-3); }
.route4__why { grid-column: 1 / -1; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; padding: 12px 18px; border-radius: var(--r-2); background: var(--sheet-2); border: 1px dashed var(--rule-strong); font-size: var(--t-sm); }
.route4__why b { color: var(--ink-3); font-weight: 800; margin-right: 6px; }
@media (max-width: 860px) {
  .route4 { grid-template-columns: 1fr; }
  .route4__arrow { height: 28px; transform: rotate(90deg); }
}

/* 검문 경로 — 판정 흐름도 */
.flow { margin-top: 44px; }
.flow__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; }
.flow__title { font-size: var(--t-xl); }
.flow__desc { color: var(--ink-2); margin-top: 6px; max-width: 46em; }
.flow__legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: var(--t-xs); color: var(--ink-2); }
.flow__legend span { display: inline-flex; align-items: center; gap: 5px; }

.checkpoint { margin-top: 18px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-3); padding: 54px 18px 18px; position: relative; box-shadow: var(--shadow-1); }
.gatesbox { position: relative; }
.gates { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); position: relative; }
.gates__line { position: absolute; top: 25px; left: 5%; right: 5%; height: 4px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--rule-strong) 0 10px, transparent 10px 16px); }
.gates__progress { position: absolute; top: 25px; left: 5%; height: 4px; border-radius: 2px; background: var(--ink); width: 0; transition: width .45s var(--ease); pointer-events: none; }
.gate { position: relative; display: flex; justify-content: center; }
.gate__btn { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; background: transparent; padding: 0 2px 6px; color: var(--ink-2); width: 100%; border-radius: var(--r-2); }
.gate__btn:hover .gate__dot { transform: translateY(-2px); }
.gate__dot { position: relative; z-index: 1; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--sheet); border: 2.5px solid var(--st, var(--rule-strong)); color: var(--st-ink, var(--ink-2)); transition: transform .2s var(--ease), box-shadow .2s; }
.gate__badge { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--st-fill, var(--skip)); color: #fff; border: 2px solid var(--sheet); }
.gate__num { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; }
.gate__title { font-size: var(--t-xs); font-weight: 700; line-height: 1.3; text-align: center; color: var(--ink); min-height: 2.6em; }
.gate--pass { --st: var(--allow-line); --st-ink: var(--allow); --st-fill: var(--allow-fill); }
.gate--warn { --st: var(--review-line); --st-ink: var(--review); --st-fill: var(--review-fill); }
.gate--stop { --st: var(--hold); --st-ink: var(--hold); --st-fill: var(--hold-fill); }
.gate--info { --st: var(--rule-strong); --st-ink: var(--ink-2); --st-fill: var(--ink-3); }
.gate--skip { --st: var(--rule); --st-ink: var(--skip); --st-fill: var(--skip); }
.gate--skip .gate__dot { border-style: dashed; }
.gate--stop .gate__dot { background: var(--hold-bg); border-width: 3px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--hold) 14%, transparent); }
.gate--final-ALLOW { --st: var(--allow-fill); --st-ink: var(--allow); --st-fill: var(--allow-fill); }
.gate--final-REVIEW { --st: var(--review-fill); --st-ink: var(--review); --st-fill: var(--review-fill); }
.gate--final-HOLD { --st: var(--hold-fill); --st-ink: var(--hold); --st-fill: var(--hold-fill); }
.gate__btn[aria-selected="true"] .gate__dot { box-shadow: 0 0 0 4px var(--sheet), 0 0 0 7px var(--ink); }
.gate__btn[aria-selected="true"] .gate__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.gate.is-after .gate__dot { opacity: .55; }
.gate.is-after .gate__title { color: var(--ink-3); }
.gate.is-dim .gate__dot { opacity: .35; }
.gate.is-dim .gate__title { opacity: .5; }
.gate.is-lit .gate__dot { opacity: 1; animation: gatePulse .5s var(--ease); }
@keyframes gatePulse { 0% { transform: scale(.82); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
.gate.is-working .gate__dot { animation: working 1.1s ease-in-out infinite; border-color: var(--accent); color: var(--accent); }
@keyframes working { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 35%, transparent); } 50% { box-shadow: 0 0 0 10px transparent; } }

.stopflag { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap; background: var(--hold); color: #fff; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 6px; pointer-events: none; }
.stopflag::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--hold); }
.stopflag--pass { background: var(--allow-fill); }
.stopflag--pass::after { border-top-color: var(--allow-fill); }
:root[data-theme="dark"] .stopflag, :root[data-theme="dark"] .stopflag--pass { color: #10161c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stopflag { color: #10161c; } }

.token { position: absolute; top: 0; left: 0; z-index: 3; width: 30px; height: 38px; margin-left: -15px; margin-top: -4px; pointer-events: none; transition: left .55s var(--ease), opacity .2s; opacity: 0; color: var(--ink); filter: drop-shadow(0 3px 4px rgba(0,0,0,.18)); }
.token.is-on { opacity: 1; }

.flow__controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.playstate { font-size: var(--t-sm); color: var(--ink-2); min-height: 1.6em; }

/* 단계 상세 판 */
.stagepanel { margin-top: 14px; border-radius: var(--r-3); background: var(--sheet); border: 1px solid var(--rule); box-shadow: var(--shadow-1); overflow: hidden; }
.stagepanel__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px 18px; align-items: center; padding: 20px clamp(18px, 2.6vw, 30px); border-bottom: 1px solid var(--rule); background: var(--sheet-2); }
.stagepanel__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--sheet); border: 2px solid var(--st, var(--rule-strong)); color: var(--st-ink, var(--ink)); }
.stagepanel__step { font-family: var(--font-mono); font-size: var(--t-xs); font-weight: 700; color: var(--ink-3); letter-spacing: .05em; }
.stagepanel__title { font-size: var(--t-lg); }
.stagepanel__q { color: var(--ink-2); font-size: var(--t-sm); margin-top: 2px; }
.stagepanel__body { padding: clamp(18px, 2.6vw, 30px); }
.stagepanel__summary { font-size: var(--t-md); font-weight: 600; line-height: 1.55; max-width: 52em; }
.stagepanel__viz { margin-top: 22px; }
.stagepanel__nav { display: flex; justify-content: space-between; gap: 10px; padding: 12px clamp(18px, 2.6vw, 30px) 18px; border-top: 1px dashed var(--rule); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 800; padding: 4px 10px; border-radius: 999px; border: 1.5px solid; white-space: nowrap; }
.status--pass { color: var(--allow); background: var(--allow-bg); border-color: var(--allow-line); }
.status--warn { color: var(--review); background: var(--review-bg); border-color: var(--review-line); }
.status--stop { color: var(--hold); background: var(--hold-bg); border-color: var(--hold); }
.status--info { color: var(--ink-2); background: var(--sheet); border-color: var(--rule-strong); }
.status--skip { color: var(--skip); background: var(--skip-bg); border-color: var(--rule); border-style: dashed; }
@media (max-width: 640px) {
  .stagepanel__head { grid-template-columns: auto minmax(0, 1fr); }
  .stagepanel__head .status { grid-column: 1 / -1; justify-self: start; }
}

/* 세로 흐름(좁은 화면) */
.vflow { list-style: none; margin: 18px 0 0; padding: 0; display: none; position: relative; }
.vstage { position: relative; padding-left: 64px; padding-bottom: 12px; }
.vstage::before { content: ""; position: absolute; left: 25px; top: 52px; bottom: -4px; width: 4px; border-radius: 2px; background: var(--rule-strong); }
.vstage:last-child::before { display: none; }
.vstage.is-before::before { background: var(--ink); }
.vstage__btn { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; text-align: left; border: 1px solid var(--rule); background: var(--sheet); border-radius: var(--r-2); padding: 10px 14px; color: var(--ink); }
.vstage__btn[aria-expanded="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.vstage__dot { position: absolute; left: 0; top: 2px; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--sheet); border: 2.5px solid var(--st, var(--rule-strong)); color: var(--st-ink, var(--ink-2)); }
.vstage .stopflag { position: static; transform: none; display: inline-block; margin-left: auto; }
.vstage .stopflag::after { display: none; }
.vstage__text { display: flex; flex-direction: column; min-width: 0; }
.vstage__num { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--ink-3); }
.vstage__title { font-weight: 700; line-height: 1.3; }
.vstage__panel { border: 1px solid var(--ink); border-top: 0; border-radius: 0 0 var(--r-2) var(--r-2); background: var(--sheet); padding: 16px; box-shadow: inset 0 0 0 0 transparent; }
.vstage__panel .stagepanel__summary { font-size: var(--t-base); }
.vstage--pass { --st: var(--allow-line); --st-ink: var(--allow); }
.vstage--warn { --st: var(--review-line); --st-ink: var(--review); }
.vstage--stop { --st: var(--hold); --st-ink: var(--hold); }
.vstage--stop .vstage__dot { background: var(--hold-bg); }
.vstage--skip .vstage__dot { border-style: dashed; color: var(--skip); }
.vstage--final-ALLOW { --st: var(--allow-fill); --st-ink: var(--allow); }
.vstage--final-REVIEW { --st: var(--review-fill); --st-ink: var(--review); }
.vstage--final-HOLD { --st: var(--hold-fill); --st-ink: var(--hold); }
@media (max-width: 860px) {
  .checkpoint, .stagepanel--wide { display: none; }
  .vflow { display: block; }
}

/* ---- 단계별 시각화 ---- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.fact { padding: 12px 14px; border-radius: var(--r-2); background: var(--sheet-2); border: 1px solid var(--rule); min-width: 0; }
.fact__k { font-size: var(--t-xs); color: var(--ink-3); font-weight: 700; }
.fact__v { font-size: var(--t-md); font-weight: 800; margin-top: 2px; line-height: 1.35; }
.fact__v--sm { font-size: var(--t-base); }

.chunks { display: flex; gap: 4px; margin-top: 14px; align-items: stretch; height: 56px; max-width: 520px; }
.chunks__part { flex: 1; border-radius: 6px; border: 1.5px solid var(--rule-strong); background: repeating-linear-gradient(180deg, var(--sheet-2) 0 9px, var(--rule) 9px 10.5px); display: grid; place-items: center; font-family: var(--font-mono); font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); }
.chunks__part span { background: var(--sheet); padding: 0 6px; border-radius: 4px; }

.redact { display: inline-flex; align-items: center; gap: 4px; background: var(--ink); color: var(--sheet); border-radius: 4px; padding: 0 7px; font-size: .78em; font-weight: 700; line-height: 1.6; vertical-align: 1px; white-space: nowrap; letter-spacing: 0; font-family: var(--font-sans); }
.maskrow { display: flex; flex-wrap: wrap; gap: 10px; }
.maskitem { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-2); background: var(--sheet-2); border: 1px solid var(--rule); }
.maskitem__n { font-size: var(--t-lg); font-weight: 800; font-variant-numeric: tabular-nums; }

.signals { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 8px; }
.signal { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-2); border: 1px solid var(--rule); background: var(--sheet-2); font-size: var(--t-sm); }
.signal__mark { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sheet); border: 1.5px solid var(--rule-strong); color: var(--ink-3); }
.signal--hit { background: var(--sheet); border-color: var(--rule-strong); }
.signal--hit .signal__mark { background: var(--ink); color: var(--sheet); border-color: var(--ink); }
.signal--decisive { border: 2px solid var(--review-line); background: var(--review-bg); }
.signal--decisive .signal__mark { background: var(--review-fill); border-color: var(--review-fill); color: #fff; }
.signal__label { flex: 1; min-width: 0; font-weight: 600; }
.signal__count { font-family: var(--font-mono); font-weight: 700; color: var(--ink-2); white-space: nowrap; }

/* AI 질문 확률 막대 */
.qlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.qaxis { display: grid; grid-template-columns: minmax(0, 15.5rem) minmax(0, 1fr) 6.4rem; gap: 16px; align-items: end; font-size: var(--t-xs); color: var(--ink-3); padding: 0 12px 4px; }
.qaxis__scale { position: relative; height: 34px; }
.qaxis__tick { position: absolute; bottom: 0; transform: translateX(-50%); font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.qaxis__band { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; font-weight: 700; color: var(--ink-2); font-size: 11.5px; }
.q { display: grid; grid-template-columns: minmax(0, 15.5rem) minmax(0, 1fr) 6.4rem; gap: 16px; align-items: center; padding: 10px 12px; border-radius: var(--r-2); border: 1px solid transparent; }
.q:nth-child(odd) { background: var(--sheet-2); }
.q--unc { border: 1.5px dashed var(--review-line); background: var(--sheet) !important; }
.q__label { font-weight: 700; font-size: var(--t-sm); line-height: 1.35; }
.q__question { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.45; margin-top: 2px; font-weight: 500; }
.q__src { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 800; padding: 0 6px; border-radius: 4px; background: var(--ink); color: var(--sheet); vertical-align: 1px; }
.pbar { position: relative; height: 26px; }
.pbar__track { position: absolute; left: 0; right: 0; top: 10px; height: 6px; border-radius: 3px; background: var(--sheet-3); }
.pbar__band { position: absolute; top: 2px; height: 22px; border-radius: 4px; background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--review-fill) 22%, transparent) 0 5px, color-mix(in srgb, var(--review-fill) 9%, transparent) 5px 10px); border: 1px dashed var(--review-line); }
.pbar__half { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed var(--ink-3); }
.pbar__fill { position: absolute; left: 0; top: 10px; height: 6px; border-radius: 3px; background: var(--ink-2); }
.pbar__dot { position: absolute; top: 4px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--ink); border: 3px solid var(--sheet); box-shadow: 0 0 0 1.5px var(--ink); }
.pbar__chunk { position: absolute; top: 19px; width: 2px; height: 7px; margin-left: -1px; background: var(--ink-3); border-radius: 1px; }
.pbar__val { position: absolute; top: -15px; margin-left: -18px; width: 36px; text-align: center; font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: var(--ink); }
.answer { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 5.6em; padding: 4px 10px; border-radius: 999px; font-size: var(--t-xs); font-weight: 800; border: 1.5px solid; }
.answer--yes { color: var(--sheet); background: var(--ink); border-color: var(--ink); }
.answer--no { color: var(--ink-2); background: var(--sheet); border-color: var(--rule-strong); }
.answer--unc { color: var(--review); background: var(--review-bg); border-color: var(--review-line); }
.doctype { margin-top: 18px; padding: 14px 16px; border-radius: var(--r-2); border: 1px solid var(--rule); background: var(--sheet-2); }
.doctype__bars { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.dbar { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr) 3.4rem; gap: 12px; align-items: center; font-size: var(--t-sm); }
.dbar__track { height: 10px; border-radius: 999px; background: var(--sheet-3); overflow: hidden; }
.dbar__fill { height: 100%; background: var(--ink); border-radius: 999px; }
.dbar__val { font-family: var(--font-mono); font-size: var(--t-xs); font-weight: 700; text-align: right; }
.aimeta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--t-xs); color: var(--ink-3); }
@media (max-width: 760px) {
  .qaxis { grid-template-columns: minmax(0, 1fr) 5.8rem; }
  .qaxis__spacer { display: none; }
  .q { grid-template-columns: minmax(0, 1fr) 5.8rem; gap: 6px 10px; }
  .q__head { grid-column: 1 / -1; }
  .dbar { grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr) 3rem; }
}

/* 민감도 사다리 */
.ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-width: 760px; }
.rung { display: grid; grid-template-columns: 4.6em minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 14px; border-radius: var(--r-2); border: 1px solid var(--rule); background: var(--sheet-2); font-size: var(--t-sm); }
.rung__lv { font-family: var(--font-mono); font-weight: 800; font-size: var(--t-base); text-align: center; padding: 2px 0; border-radius: 6px; background: var(--sheet); border: 1px solid var(--rule-strong); }
.rung__state { font-size: var(--t-xs); font-weight: 700; color: var(--ink-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.rung--checked { opacity: .82; }
.rung--matched { border: 2.5px solid var(--ink); background: var(--sheet); font-weight: 700; box-shadow: var(--shadow-2); }
.rung--matched .rung__lv { background: var(--ink); color: var(--sheet); border-color: var(--ink); }
.rung--matched .rung__state { color: var(--ink); }
.rung--below { opacity: .45; border-style: dashed; }
.rung--also { opacity: .7; border-style: dashed; }
.rung--also .rung__state { color: var(--ink-2); }
.because { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; align-items: center; font-size: var(--t-sm); }

/* 받는 곳 등급 눈금 */
.destscale { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.destscale__step { padding: 10px 6px 9px; text-align: center; font-size: var(--t-xs); font-weight: 700; color: var(--ink-3); background: var(--sheet-2); border: 1px solid var(--rule); line-height: 1.3; position: relative; }
.destscale__step:first-child { border-radius: 8px 0 0 8px; }
.destscale__step:last-child { border-radius: 0 8px 8px 0; }
.destscale__step.is-here { background: var(--ink); color: var(--sheet); border-color: var(--ink); }
.destscale__step.is-here.is-risk { background: var(--hold-fill); border-color: var(--hold); color: #fff; }
.destscale__step.is-here::after { content: "여기"; position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--ink); }
.destscale__ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); margin-top: 6px; font-weight: 600; }
@media (max-width: 560px) { .destscale { grid-template-columns: repeat(3, minmax(0, 1fr)); } .destscale__step { border-radius: 6px !important; } }

/* 판정표 4x6 */
.dtable-wrap { max-width: 100%; }
.dtable { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.dtable th { font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); padding: 6px 4px; line-height: 1.3; vertical-align: bottom; }
.dtable thead th { text-align: center; }
.dtable tbody th { text-align: left; white-space: nowrap; width: 6.8em; }
.dtable__corner { font-size: 11px !important; color: var(--ink-3) !important; text-align: left !important; }
.dcell { height: 48px; border-radius: 8px; text-align: center; font-size: var(--t-xs); font-weight: 800; border: 1.5px solid transparent; position: relative; padding: 4px; }
.dcell__in { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.dcell--ALLOW { background: var(--allow-bg); color: var(--allow); }
.dcell--REVIEW { background: var(--review-bg); color: var(--review); }
.dcell--HOLD { background: var(--hold-bg); color: var(--hold); }
.dtable.is-focused .dcell { opacity: .38; }
.dtable.is-focused .dcell.is-row, .dtable.is-focused .dcell.is-col { opacity: .8; }
.dtable.is-focused .dcell.is-hit { opacity: 1; border: 3px solid currentColor; box-shadow: 0 0 0 4px var(--sheet), 0 0 0 6px currentColor; z-index: 1; }
.dtable th.is-row, .dtable th.is-col { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.dtable__note { margin-top: 10px; font-size: var(--t-sm); color: var(--ink-2); }
.dcell__txt { display: inline; }
@media (max-width: 640px) {
  .dcell__txt { display: none; }
  .dtable tbody th { width: 3.6em; white-space: normal; }
  .dtable th { font-size: 11px; }
  .dtable .lvl-long { display: none; }
  .dtable__corner { font-size: 0 !important; }
}
.dtable .dest-short { display: none; }
@media (max-width: 640px) { .dtable .dest-long { display: none; } .dtable .dest-short { display: inline; } }

/* 승인대장 체크리스트 */
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-width: 700px; counter-reset: chk; }
.check { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: var(--r-2); background: var(--sheet-2); border: 1px solid var(--rule); font-size: var(--t-sm); }
.check__mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--rule-strong); color: var(--ink-3); background: var(--sheet); }
.check--ok .check__mark { background: var(--allow-fill); border-color: var(--allow-fill); color: #fff; }
.check--fail { border: 2px solid var(--hold); background: var(--hold-bg); font-weight: 700; }
.check--fail .check__mark { background: var(--hold-fill); border-color: var(--hold-fill); color: #fff; }
.check--na { opacity: .55; border-style: dashed; }
.check__state { font-size: var(--t-xs); font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.check--ok .check__state { color: var(--allow); }
.check--fail .check__state { color: var(--hold); }
.effect { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-2); border-left: 5px solid var(--ink); background: var(--sheet-2); font-size: var(--t-sm); }

/* 애매한 판단 재확인 */
.strict { display: grid; grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr); gap: 10px; align-items: stretch; max-width: 780px; }
.strict__col { padding: 16px; border-radius: var(--r-2); border: 1px solid var(--rule); background: var(--sheet-2); display: flex; flex-direction: column; gap: 8px; }
.strict__col--alt { border: 1.5px dashed var(--review-line); background: var(--sheet); }
.strict__k { font-size: var(--t-xs); font-weight: 800; color: var(--ink-3); }
.strict__arrow { display: grid; place-items: center; color: var(--ink-3); }
.strict__row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: var(--t-sm); }
.handoff { margin-top: 14px; display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-2); background: var(--review-bg); border: 2px solid var(--review-line); color: var(--ink); font-weight: 600; max-width: 780px; }
.handoff svg { color: var(--review); flex-shrink: 0; }
@media (max-width: 640px) { .strict { grid-template-columns: 1fr; } .strict__arrow { transform: rotate(90deg); height: 36px; } }

/* 최종 판정 */
.final { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 32px; align-items: start; }
.reasons { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; counter-reset: rs; }
.reasons li { counter-increment: rs; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: baseline; font-size: var(--t-sm); padding: 8px 12px; border-radius: var(--r-1); background: var(--sheet-2); }
.reasons li::before { content: counter(rs); font-family: var(--font-mono); font-weight: 700; color: var(--ink-3); font-size: var(--t-xs); }
@media (max-width: 640px) { .final { grid-template-columns: 1fr; } }

/* 문서 보기 */
.docview { margin-top: 44px; }
.docpanel { margin-top: 16px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-3); box-shadow: var(--shadow-1); overflow: hidden; }
.docpanel__bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--rule); background: var(--sheet-2); }
.docpanel__name { font-family: var(--font-mono); font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--t-xs); color: var(--ink-2); align-items: center; }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__sw { width: 18px; height: 12px; border-radius: 3px; }
.doctext { margin: 0; padding: 20px clamp(16px, 2.4vw, 28px); max-height: 560px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-family: var(--font-sans); font-size: var(--t-sm); line-height: 1.75; color: var(--ink); tab-size: 2; }
.hl { border-radius: 3px; padding: 0 2px; color: inherit; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hl--pii { background: var(--hl-pii); box-shadow: inset 0 -2px 0 var(--review-fill); }
.hl--mark { background: var(--hl-mark); box-shadow: inset 0 -2px 0 var(--hold-fill); font-weight: 700; }
.hl--kw { background: var(--hl-kw); box-shadow: inset 0 -2px 0 var(--accent); }
.legend__sw.hl--pii { background: var(--hl-pii); box-shadow: inset 0 -2px 0 var(--review-fill); }
.legend__sw.hl--mark { background: var(--hl-mark); box-shadow: inset 0 -2px 0 var(--hold-fill); }
.legend__sw.hl--kw { background: var(--hl-kw); box-shadow: inset 0 -2px 0 var(--accent); }

.sent { margin-top: 14px; border-radius: var(--r-3); border: 1.5px solid var(--ink); background: var(--sheet); overflow: hidden; }
.sent > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px 20px; font-weight: 700; }
.sent > summary::-webkit-details-marker { display: none; }
.sent > summary .chev { margin-left: auto; transition: transform .2s; }
.sent[open] > summary .chev { transform: rotate(180deg); }
.sent__sub { font-weight: 500; color: var(--ink-2); font-size: var(--t-sm); }
.sent__body { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.chunk { border: 1px solid var(--rule); border-radius: var(--r-2); overflow: hidden; }
.chunk__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 8px 14px; background: var(--sheet-2); font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); border-bottom: 1px solid var(--rule); }
.chunk__text { margin: 0; padding: 14px; white-space: pre-wrap; word-break: break-word; font-family: var(--font-sans); font-size: var(--t-sm); line-height: 1.75; max-height: 340px; overflow: auto; }
.chunk__header { padding: 10px 14px; font-size: var(--t-xs); color: var(--ink-2); background: var(--accent-bg); border-bottom: 1px solid var(--rule); }
.chunk__header summary { cursor: pointer; font-weight: 700; }
.chunk__header pre { margin: 8px 0 0; white-space: pre-wrap; font-family: var(--font-sans); }

/* ==================================================================
   새 파일 판독
   ================================================================== */
.uphead { padding-top: clamp(28px, 5vw, 56px); }
.uphead__title { font-size: var(--t-hero); letter-spacing: -0.035em; margin-top: 12px; }
.upgrid { margin-top: 26px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 24px; align-items: start; }
@media (max-width: 1040px) { .upgrid { grid-template-columns: minmax(0, 1fr); } }
.upstep { margin-top: 18px; }
.upstep__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.upstep__n { font-family: var(--font-mono); font-weight: 800; font-size: var(--t-sm); color: var(--sheet); background: var(--ink); width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0; transform: translateY(4px); }
.upstep__title { font-size: var(--t-lg); }
.upstep__desc { color: var(--ink-2); font-size: var(--t-sm); margin-top: 2px; }
.srctabs { display: flex; gap: 4px; padding: 4px; background: var(--sheet-2); border: 1px solid var(--rule); border-radius: 999px; width: max-content; max-width: 100%; flex-wrap: wrap; }
.srctab { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: var(--t-sm); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.srctab[aria-selected="true"] { background: var(--ink); color: var(--sheet); }
.srcpanel { margin-top: 12px; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 38px 20px; border-radius: var(--r-3); border: 2px dashed var(--rule-strong); background: var(--sheet); color: var(--ink-2); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-bg); color: var(--ink); }
.drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.drop__title { font-weight: 800; color: var(--ink); font-size: var(--t-md); }
.drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.picked { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-2); border: 2px solid var(--ink); background: var(--sheet); }
.picked__name { font-weight: 700; word-break: break-all; }
.picked__meta { font-size: var(--t-xs); color: var(--ink-3); }
.picked .btn { margin-left: auto; }
.paste { width: 100%; min-height: 220px; resize: vertical; border-radius: var(--r-2); border: 1.5px solid var(--rule-strong); background: var(--sheet); padding: 14px; line-height: 1.7; font-size: var(--t-sm); }
.samples { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px; }
.sample { width: 100%; height: 100%; text-align: left; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-2); border: 1.5px solid var(--rule); background: var(--sheet); color: var(--ink); }
.sample:hover { border-color: var(--rule-strong); }
.sample[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sample__title { font-weight: 700; font-size: var(--t-sm); line-height: 1.4; }
.sample__meta { font-size: var(--t-xs); color: var(--ink-3); margin-top: 2px; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px; border: 0; padding: 0; margin: 0; }
.preset { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-2); border: 1.5px solid var(--rule); background: var(--sheet); cursor: pointer; min-height: 88px; }
.preset:hover { border-color: var(--rule-strong); }
.preset input { position: absolute; opacity: 0; pointer-events: none; }
.preset:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--sheet); }
.preset:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.preset__icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--sheet-2); border: 1px solid var(--rule); color: var(--ink-2); }
.preset:has(input:checked) .preset__icon { background: var(--ink); color: var(--sheet); border-color: var(--ink); }
.preset__label { font-weight: 700; font-size: var(--t-sm); line-height: 1.35; }
.preset__hint { font-size: var(--t-xs); color: var(--ink-3); margin-top: 2px; line-height: 1.45; }
.formrow { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 640px) { .formrow { grid-template-columns: 1fr; } }
.label { display: block; font-weight: 700; font-size: var(--t-sm); margin-bottom: 6px; }
.label small { font-weight: 500; color: var(--ink-3); margin-left: 4px; }
.input { width: 100%; min-height: 46px; border-radius: var(--r-2); border: 1.5px solid var(--rule-strong); background: var(--sheet); padding: 10px 12px; font-size: var(--t-sm); }
textarea.input { min-height: 80px; resize: vertical; line-height: 1.6; }
.submitbar { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 18px 20px; border-radius: var(--r-3); background: var(--sheet); border: 1.5px solid var(--ink); }
.submitbar__msg { font-size: var(--t-sm); color: var(--ink-2); flex: 1; min-width: 200px; }
.aside { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 90px; }
@media (max-width: 1040px) { .aside { position: static; } }
.recent { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.recent__item { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--r-2); background: var(--sheet-2); border: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.recent__item:hover { border-color: var(--rule-strong); }
.recent__title { font-weight: 700; font-size: var(--t-sm); line-height: 1.35; }
.recent__meta { font-size: var(--t-xs); color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.processing { margin-top: 26px; padding: clamp(20px, 3vw, 34px); border-radius: var(--r-3); background: var(--sheet); border: 1.5px solid var(--ink); }
.processing__title { font-size: var(--t-xl); }
.processing__msg { margin-top: 6px; color: var(--ink-2); min-height: 1.6em; }
.processing .checkpoint { box-shadow: none; border: 0; padding: 30px 0 0; display: block; }
.processing .vflow { display: none; }
@media (max-width: 860px) {
  .processing .checkpoint { display: block; padding-top: 10px; }
  .processing .gates { grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 18px; }
  .processing .gates__line, .processing .gates__progress { display: none; }
}

/* ==================================================================
   작동 원리
   ================================================================== */
.howhead { padding-top: clamp(28px, 5vw, 56px); }
.howhead__title { font-size: var(--t-hero); letter-spacing: -0.035em; margin-top: 12px; max-width: 18em; }
.steps5 { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; position: relative; counter-reset: s5; }
.steps5__item { position: relative; padding: 0 12px; display: flex; flex-direction: column; gap: 10px; }
.steps5__art { height: 132px; border-radius: var(--r-3); background: var(--sheet); border: 1px solid var(--rule); display: grid; place-items: center; color: var(--ink); position: relative; box-shadow: var(--shadow-1); }
.steps5__item:not(:last-child) .steps5__art::after { content: ""; position: absolute; right: -19px; top: 50%; width: 14px; height: 14px; border-top: 3px solid var(--ink-3); border-right: 3px solid var(--ink-3); transform: translateY(-50%) rotate(45deg); }
.steps5__n { font-family: var(--font-mono); font-size: var(--t-xs); font-weight: 800; color: var(--ink-3); letter-spacing: .05em; }
.steps5__title { font-size: var(--t-md); }
.steps5__text { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.6; }
.steps5__who { display: inline-flex; align-self: flex-start; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 6px; border: 1.5px solid var(--ink); }
.steps5__who--ai { border-style: dashed; color: var(--accent); border-color: var(--accent); }
.steps5__who--person { background: var(--ink); color: var(--sheet); }
@media (max-width: 1040px) {
  .steps5 { grid-template-columns: 1fr; gap: 18px; }
  .steps5__item { display: grid; grid-template-columns: 132px minmax(0, 1fr); column-gap: 18px; padding: 0; }
  .steps5__art { grid-row: 1 / span 4; height: 112px; }
  .steps5__item:not(:last-child) .steps5__art::after { right: auto; left: 50%; top: auto; bottom: -15px; transform: translateX(-50%) rotate(135deg); }
}
@media (max-width: 460px) {
  .steps5__item { grid-template-columns: 88px minmax(0, 1fr); column-gap: 14px; }
  .steps5__art { height: 88px; }
  .steps5__art svg { width: 64px; height: 64px; }
}
.gloss { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.gloss__card { padding: 20px 22px; border-radius: var(--r-3); background: var(--sheet); border: 1px solid var(--rule); }
.gloss__card h3 { font-size: var(--t-md); }
.gloss__card p { color: var(--ink-2); font-size: var(--t-sm); margin-top: 6px; }
.deflist { margin: 12px 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; font-size: var(--t-sm); }
.deflist dt { font-weight: 800; white-space: nowrap; }
.deflist dt .mono { font-weight: 800; }
.deflist dd { margin: 0; color: var(--ink-2); }
.bandfig { margin-top: 14px; }
.faq { display: flex; flex-direction: column; gap: 8px; max-width: 900px; }
.faq details { border-radius: var(--r-2); background: var(--sheet); border: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; list-style: none; display: flex; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { margin-left: auto; flex-shrink: 0; transition: transform .2s; }
.faq details[open] summary .chev { transform: rotate(180deg); }
.faq__a { padding: 0 18px 18px; color: var(--ink-2); line-height: 1.7; }
.faq__q { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--sheet); font-size: var(--t-xs); flex-shrink: 0; }
.limits { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.limits li { padding: 18px 20px; border-radius: var(--r-3); border: 1.5px dashed var(--rule-strong); background: var(--sheet); font-size: var(--t-sm); color: var(--ink-2); }
.limits b { display: block; color: var(--ink); font-size: var(--t-base); margin-bottom: 4px; }

/* 오류·백엔드 없음 */
.errorview { padding-top: 56px; max-width: 780px; }
.errorview h1 { font-size: var(--t-xl); }
.errorview p { margin-top: 10px; color: var(--ink-2); }
.errorview pre { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-2); background: var(--ink); color: var(--sheet); font-family: var(--font-mono); font-size: var(--t-sm); overflow-x: auto; }
.errorview .btnrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* ------------------------------------------------------------------ motion 줄이기 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .tiles.is-entering .tile { animation: none; }
}

@media print {
  .topbar, .footer, .flow__controls, .filters { display: none; }
  body { background: #fff; }
}

/* 업로드: 고급(승인번호) */
.advanced { margin-top: 14px; border: 1px dashed var(--rule-strong); border-radius: var(--r-2); background: var(--sheet); }
.advanced > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; font-size: var(--t-sm); color: var(--ink-2); }
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary svg { transition: transform .2s; }
.advanced[open] > summary svg { transform: rotate(180deg); }
.advanced__body { padding: 0 14px 14px; }

/* 통합 보정 */
.preset__label, .preset__hint, .sample__title, .sample__meta { display: block; }
.cmpflow { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.misscard__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 6px; }
.misscard__list li { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; font-size: var(--t-sm); }
.misscard__list li > span:nth-child(2) { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.destscale { margin-top: 30px; }
.stopflag--miss { background: var(--sheet); color: var(--hold); border: 2px dashed var(--hold); padding: 2px 8px; }
.stopflag--miss::after { border-top-color: var(--hold); }
.vstage .stopflag--miss { padding: 2px 8px; }
.q--wrong { border: 2px solid var(--hold) !important; background: var(--hold-bg) !important; }
.q__ans { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.q__truth { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; color: var(--hold); white-space: nowrap; }
:root[data-theme="dark"] .stopflag--miss { color: var(--hold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stopflag--miss { color: var(--hold); } }
.faq summary > svg:last-child, .sent > summary > svg:last-child { margin-left: auto; flex-shrink: 0; transition: transform .2s; }
.faq details[open] summary > svg:last-child, .sent[open] > summary > svg:last-child { transform: rotate(180deg); }
.gate.is-dim .stopflag { opacity: 0; }
.gate .stopflag { transition: opacity .3s; }
.rawreasons { margin-top: 14px; }
.rawreasons .reasons li { font-family: var(--font-mono); font-size: var(--t-xs); }
