/* Sentinel v7 — design.md (Mainframe) 구현: 페이퍼 + 잉크 + 필 + 헤어라인.
   문서와 어긋나면 문서를 고치고 여기를 맞춘다. 유채색 = 상태 팔레트뿐. */
:root {
  --paper: #EFEEEB;
  --surface: #FFFFFF;
  --border: rgba(10,10,10,.10);
  --border-strong: rgba(10,10,10,.22);
  --ink: #0B0B0A;
  --ink-2: #55534E;
  --ink-3: #8B8983;
  --primary: #0B0B0A;            /* v7: ink 별칭 (구 클래스 호환) */
  --ok-ink: #2F6B4A;   --ok-bg: #E3EEE6;
  --warn-ink: #8F5B00; --warn-bg: #F5ECD7;
  --crit-ink: #B03A34; --crit-bg: #F6E3E0;
  --neutral-ink: #6B6A64; --neutral-bg: #ECEBE8;
  --info-ink: #41576B; --info-bg: #E5E9EC;
  --radius-sheet: 18px;
  --radius-control: 12px;
  --font-heading: 'HelveticaNowDisplay-Medium', 'Pretendard Variable', Pretendard, 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'HelveticaNowDisplayW01-Rg', 'Pretendard Variable', Pretendard, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 88px; }   /* 앵커 이동 시 플로팅 내비에 가리지 않게 */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font-family: var(--font-body); font-size: 15px; line-height: 1.7; color: var(--ink); background: var(--paper); }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { opacity: .6; }
h1, h2, h3 { margin: 0; font-weight: 500; }
h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.1; letter-spacing: -0.02em; font-family: var(--font-heading); }
h2 { font-size: 22px; line-height: 1.35; letter-spacing: -0.01em; font-weight: 600; }
h3 { font-size: 17px; line-height: 1.45; font-weight: 600; }
p { margin: 0 0 8px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
::selection { background: rgba(11,11,10,.85); color: var(--paper); }

.muted { color: var(--ink-3); font-size: 13px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.small { font-size: 12px; }
.grad-text { color: var(--ink); }   /* v5 잔재 중화 — 그라디언트 금지 */

/* ── 내비 (Mainframe 문법) ── */
/* 플로팅 필 내비 — 반투명 + 블러 + 얇은 레이어드 섀도, 로고 맨 왼쪽 고정 */
.mfnav-wrap { position: sticky; top: 0; z-index: 50; padding: 12px 20px 8px; }
.mfnav {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 6px 8px 6px 20px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  box-shadow: 0 1px 1px 0 rgba(38,38,43,.10), 0 0 0 1px rgba(38,38,43,.04),
              0 2px 12px -4px rgba(38,38,43,.16);
}
.mfnav .mflogo { justify-self: start; }
.mfnav .mflinks { justify-self: center; }
.mfnav .mfnav-user { justify-self: end; display: flex; align-items: center; gap: 12px; }
.nav-nick { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; text-decoration: none; }
.nav-nick:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.nav-auth-link { font-size: 13px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.nav-auth-link:hover { color: var(--ink); opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.mflogo { display: inline-flex; align-items: center; }
.mflogo img { height: 20px; width: auto; display: block; }
.mflogo:hover { opacity: .6; }
.mfstar { font-size: 19px; user-select: none; }
.mflinks { display: flex; align-items: center; flex-wrap: wrap; }
.mflinks a {
  display: inline-block; padding: 4px 17px; border-radius: 10px;
  font-size: 18px; line-height: 24px; letter-spacing: -0.13px; font-weight: 500;
  color: var(--ink); text-decoration: none; transition: background 150ms ease;
}
.mflinks a:hover, .mflinks a.active { background: var(--neutral-bg); }
.mfcta {
  display: inline-block; padding: 6px 14px; border-radius: 10px;
  font-size: 13px; line-height: 24px; letter-spacing: -0.13px; font-weight: 500;
  background: var(--ink); color: var(--paper); text-decoration: none; white-space: nowrap;
  transition: opacity 150ms ease;
}
.mfcta:hover { opacity: .82; }
.mfcta.active { box-shadow: 0 0 0 3px var(--neutral-bg); }
.nav-burger { display: none; border: none; background: transparent; font-size: 18px;
              line-height: 1; cursor: pointer; color: var(--ink); padding: 6px 8px; }
/* 통합 검색 진입 — 데스크톱은 우측 아이콘, 모바일은 드롭다운 항목 */
.nav-search { display: inline-flex; align-items: center; justify-content: center;
              width: 30px; height: 30px; border-radius: 10px; color: var(--ink-2);
              text-decoration: none; transition: background 150ms ease, color 150ms ease; }
.nav-search:hover { background: var(--neutral-bg); color: var(--ink); opacity: 1; }
.nav-search svg { display: block; }
.nav-search-mobile { display: none !important; }
/* 알림 벨 — 로그인 시에만 노출, 미읽음이 있을 때만 배지 표시 */
.nav-bell { position: relative; display: inline-flex; align-items: center; justify-content: center;
            width: 30px; height: 30px; border-radius: 10px; color: var(--ink-2);
            text-decoration: none; transition: background 150ms ease, color 150ms ease; }
.nav-bell:hover { background: var(--neutral-bg); color: var(--ink); opacity: 1; }
.nav-bell svg { display: block; }
.nav-bell-badge { position: absolute; top: -1px; right: -3px; min-width: 15px; height: 15px;
                  border-radius: 999px; background: var(--crit-ink); color: #fff;
                  font-size: 10px; font-weight: 700; line-height: 15px; text-align: center;
                  padding: 0 4px; }

/* ── 워크스페이스 서브내비 (필 행) ── */
.subnav { background: var(--paper); border-bottom: 1px solid var(--border); }
.subnav-inner { max-width: 1200px; margin: 0 auto; padding: 12px 32px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── 컨테이너 ── */
.container { max-width: 1200px; margin: 0 auto; padding: 40px 32px 56px; }  /* 내비·서브내비·랜딩과 동일 폭 — 전 페이지 양옆 마진 통일 */
.landing { max-width: none; padding: 0; }
.page-foot { margin-top: 72px; padding: 16px 0; border-top: 1px solid var(--border); font-size: 12px; color: var(--ink-3); }
.landing .page-foot { max-width: 1200px; margin: 0 auto; padding: 16px 32px 40px; }

/* ── 페이지 헤더 (pageband) ── */
.pageband { padding: 40px 0 32px; border-bottom: 1px solid var(--border-strong); margin-bottom: 36px; }
.pageband h1 { margin: 10px 0 12px; }
.pageband-sub { font-size: 17px; color: var(--ink-2); margin: 0; }
.pageband.compact { padding: 28px 0 24px; }
.pageband.compact h1 { font-size: clamp(28px, 4vw, 38px); }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: 0.14em; color: var(--ink-3); text-transform: uppercase; }

/* ── 히어로 (/overview) ── */
.hero { max-width: 1200px; margin: 0 auto; padding: 88px 32px 56px; }
.hero-content { max-width: 760px; }
.hero-grid { display: grid; grid-template-columns: 1fr 400px; gap: 56px; align-items: center; }

/* ── 로그인·회원가입 카드 ── */
.auth-card { max-width: 400px; padding: 30px 32px; margin-bottom: 0; }
.auth-card h3 { font-size: 19px; margin-bottom: 16px; }
form.auth-card, .auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card label { display: block; font-size: 13px; color: var(--ink-2); }
.auth-card input[type=email], .auth-card input[type=password], .auth-card input[type=text] {
  width: 100%; margin-top: 4px;
}
.auth-card .btn { width: 100%; justify-content: center; text-align: center; margin-top: 10px; }
.auth-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-2); }
.auth-check input[type=checkbox] { margin-top: 3px; flex: 0 0 auto; }
.auth-alt { font-size: 13px; color: var(--ink-2); margin: 14px 0 0; }
.field-error { display: block; font-size: 12px; font-weight: 400; color: var(--crit-ink); margin-top: 4px; }
.auth-note { font-size: 12px; color: var(--ink-3); margin: 10px 0 0; line-height: 1.6; }
.auth-page { max-width: 460px; margin: 0 auto; }
.display { font-family: var(--font-heading); font-size: clamp(44px, 7vw, 76px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 500; margin: 16px 0 20px; }
.hero-sub { font-size: 19px; color: var(--ink-2); max-width: 560px; margin: 0 0 32px; }
.hero-cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stat-strip {
  display: flex; flex-wrap: wrap;
  max-width: 1200px; margin: 64px auto 0; padding: 24px 0 0;
  border-top: 1px solid var(--border-strong);
}
.stat { padding: 4px 48px 4px 0; }
.stat + .stat { border-left: 1px solid var(--border); padding-left: 48px; }
.stat-num { font-family: var(--font-heading); font-size: 40px; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-label { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* ── 섹션 (/overview) ── */
.section { max-width: 1200px; margin: 0 auto; padding: 72px 32px; }
.section.alt { max-width: none; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: rgba(255,255,255,.45); }
.section.alt > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.section-title { font-family: var(--font-heading); font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.02em; font-weight: 500; margin: 10px 0 12px; }
.section-sub { font-size: 16px; color: var(--ink-2); max-width: 620px; margin-bottom: 32px; }
.block-title { font-size: 24px; letter-spacing: -0.01em; font-weight: 600; margin: 44px 0 12px; }

/* ── 카드(시트) ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sheet);
  padding: 28px; margin-bottom: 16px;
  transition: border-color 200ms ease, transform 200ms ease;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.card.highlight { border-color: var(--ink); }
a.card { text-decoration: none; display: block; color: var(--ink); }
a.card:hover { opacity: 1; border-color: var(--border-strong); transform: translateY(-2px); }

/* ── 가이드 목차 — 도서 목차 스타일: 번호 · 섹션 · 하위 항목 ── */
.card.toc { padding: 18px 28px 8px; }
.card.toc .eyebrow { margin-bottom: 4px; }
.toc-list { display: flex; flex-direction: column; }
.toc-row {
  display: grid; grid-template-columns: 44px 260px 1fr; align-items: center; gap: 14px;
  padding: 15px 2px; text-decoration: none;
}
.toc-row + .toc-row { border-top: 1px solid var(--border); }
.toc-num { font-size: 12px; font-weight: 500; letter-spacing: 0.12em; color: var(--ink-3);
           font-variant-numeric: tabular-nums; }
.toc-title { font-weight: 600; font-size: 15.5px; color: var(--ink); text-decoration: none; }
a.toc-row:hover .toc-title, a.toc-title:hover { text-decoration: underline; text-underline-offset: 3px; }
a.toc-row:hover, a.toc-title:hover { opacity: 1; }
.toc-subs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
/* 순서가 있는 하위 항목(딜 단계) — 화살표로 흐름 표시 */
.toc-flow { align-items: center; gap: 5px; }
.toc-arrow { font-size: 11px; color: var(--ink-3); user-select: none; }
@media (max-width: 720px) {
  .toc-row { grid-template-columns: 40px 1fr; }
  .toc-subs { grid-column: 2; justify-content: flex-start; margin-top: 2px; }
}

/* ── 라인아트 ── */
.art { display: block; color: var(--ink); width: auto; max-width: 100%; }
.art-box { display: flex; align-items: center; justify-content: center; padding: 24px 0 20px; }
.art-img { height: 96px; width: auto; display: block; }

/* ── 피처/원칙 카드 ── */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.principle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card.feature, .card.principle, .card.statute { margin-bottom: 0; }
.card.feature p { color: var(--ink-2); font-size: 14px; margin: 8px 0 14px; }
.f-link { color: var(--ink); font-weight: 500; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.p-num { font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: 0.14em; margin-bottom: 12px; }
.card.principle p { color: var(--ink-2); font-size: 14px; margin-top: 8px; }
.cta-band { text-align: center; padding: 56px 32px; }
.cta-band h2 { font-family: var(--font-heading); font-size: 30px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 8px; }
.cta-band .section-sub { margin: 0 auto 28px; }

/* ── 지식 네트워크 맵 (라이트) ── */
.net-map { display: block; width: 100%; height: auto; }
.net-map .net-edge { stroke: rgba(10,10,10,.18); stroke-width: 1.2; fill: none; }
.net-map .net-flow {
  stroke: var(--ink); stroke-width: 1.4; fill: none; opacity: .55;
  stroke-dasharray: 3 16; stroke-linecap: round;
  animation: netflow 5.5s linear infinite;
}
@keyframes netflow { to { stroke-dashoffset: -190; } }
.net-map .net-node rect { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1; transition: stroke 150ms ease; }
.net-map .net-node text { fill: var(--ink); font-family: var(--font-body); font-size: 14px; font-weight: 600; }
.net-map .net-node .net-sub { fill: var(--ink-3); font-size: 11px; font-weight: 400; }
.net-map a:hover .net-node rect { stroke: var(--ink); }
.net-map .net-core rect { fill: var(--ink); }
.net-map .net-core text { fill: var(--paper); }
.net-map .net-core .net-sub { fill: rgba(239,238,235,.7); }
.net-legend { font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 12px; }

/* ── 스크롤 리빌 ── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── 칩 (아웃라인 필, 활성 = 블랙 반전) ── */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  display: inline-block; padding: 5px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); font-size: 13px; font-weight: 500; text-decoration: none;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
a.chip:hover { opacity: 1; background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip-primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.stage-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.flow-arrow { color: var(--ink-3); }

/* ── 가이드 duty ── */
.duty-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.duty { padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.duty h3 { font-size: 15px; margin-bottom: 5px; }
.duty p { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.duty-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.duty-links .chip { font-size: 12px; padding: 3px 12px; }
.point-list { margin: 0; padding-left: 18px; }
.point-list li { margin-bottom: 8px; }
.interp-list { margin: 0; padding-left: 18px; }
.interp-list li { margin-bottom: 10px; font-size: 15px; }

/* ── 법령 카드 ── */
.statute-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.statute-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.statute-meta .ref { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.card.statute p { color: var(--ink-2); font-size: 14px; margin: 8px 0 14px; }
.statute-foot { font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--border); padding-top: 12px; }
.law-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.law-grid .card { margin-bottom: 0; }
.law-grid + .card, .law-grid + .law-grid { margin-top: 16px; }

/* ── 케이스 ── */
.case-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card.case { margin-bottom: 0; }
.case-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.case-issue { color: var(--ink-2); font-size: 14px; }
.theme-block { margin-bottom: 48px; }

/* ── 체커 폼·결과 ── */
.checker-form { background: rgba(255,255,255,.55); }
.check-col { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.result-stack { margin-bottom: 28px; }
/* 판정 결과 카드 — Liquid Glass(반투명 굴절 유리 + 상단 스페큘러 광택 + 밝은 엣지 rim + 상태색 루미너스 테두리) */
.result-card {
  position: relative;
  --glass-inset: inset 0 1px 1px rgba(255,255,255,.92), inset 1px 0 1px rgba(255,255,255,.35),
                 inset 0 0 0 1px rgba(255,255,255,.14), inset 0 -16px 28px rgba(255,255,255,.10);
  background: rgba(255,255,255,.26);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 24px; padding: 22px 26px; margin-bottom: 14px;
  box-shadow: 0 10px 24px rgba(31,38,135,.10), var(--glass-inset);
}
/* 상단 스페큘러 광택 — 유리 윗면 곡률에 걸린 빛(깔끔한 대칭, 코너 얼룩 없음) */
.result-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0) 22%),
              radial-gradient(140% 100% at 50% -34%, rgba(255,255,255,.32), transparent 56%);
}
.result-card > * { position: relative; z-index: 1; }
/* 상태 = 루미너스 엣지(상태색 테두리 + 얇은 상태색 외곽 글로우). 본문은 맑은 유리 유지 */
.result-card.state-border-통과, .result-card.state-border-완료 {
  border-color: rgba(47,107,74,.55);
  box-shadow: 0 10px 24px rgba(47,107,74,.12), 0 0 0 .5px rgba(47,107,74,.22), var(--glass-inset); }
.result-card.state-border-경고 {
  border-color: rgba(143,91,0,.55);
  box-shadow: 0 10px 24px rgba(143,91,0,.13), 0 0 0 .5px rgba(143,91,0,.22), var(--glass-inset); }
.result-card.state-border-위반 {
  border-color: rgba(176,58,52,.6);
  box-shadow: 0 10px 24px rgba(176,58,52,.14), 0 0 0 .5px rgba(176,58,52,.24), var(--glass-inset); }
.result-card.state-border-미확인 {
  border-color: rgba(107,106,100,.5);
  box-shadow: 0 10px 24px rgba(31,38,135,.09), 0 0 0 .5px rgba(107,106,100,.20), var(--glass-inset); }
/* 헤더의 판정 배지는 진한 상태색으로 반전 — 시선이 판정으로 바로 간다 */
.result-card.state-border-통과 .result-head .badge, .result-card.state-border-완료 .result-head .badge {
  background: var(--ok-ink); color: #fff; }
.result-card.state-border-경고 .result-head .badge { background: var(--warn-ink); color: #fff; }
.result-card.state-border-위반 .result-head .badge { background: var(--crit-ink); color: #fff; }
.result-card.state-border-미확인 .result-head .badge { background: var(--neutral-ink); color: #fff; }
.result-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
/* ── 배지 ── */
.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.badge.state-통과, .badge.state-완료 { color: var(--ok-ink); background: var(--ok-bg); }
.badge.state-경고, .badge.state-임박 { color: var(--warn-ink); background: var(--warn-bg); }
.badge.state-위반, .badge.state-긴급 { color: var(--crit-ink); background: var(--crit-bg); }
.badge.state-지연 { color: #fff; background: var(--crit-ink); }
.badge.state-미확인, .badge.state-예정, .badge.neutral { color: var(--neutral-ink); background: var(--neutral-bg); }
.badge.info { color: var(--info-ink); background: var(--info-bg); }

/* ── 배너 ── */
.banner { border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; border: 1px solid; font-size: 14px; }
.banner.ok { background: var(--ok-bg); border-color: var(--ok-ink); color: var(--ok-ink); }
.banner.warn { background: var(--warn-bg); border-color: var(--warn-ink); color: var(--warn-ink); }
.banner.crit { background: var(--crit-bg); border-color: var(--crit-ink); color: var(--crit-ink); }
.banner.neutral { background: var(--neutral-bg); border-color: var(--neutral-ink); color: var(--neutral-ink); }
.banner a { color: inherit; }

/* ── 근거 푸터 (필수 컴포넌트) ── */
.evidence { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.evidence a { color: var(--ink-2); }

/* ── 버튼 (필) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.btn:hover { opacity: 1; }
.btn.lg { height: 48px; padding: 0 28px; font-size: 16px; }
.btn.sm { height: 30px; padding: 0 14px; font-size: 13px; }
.btn.primary { background: var(--ink); color: var(--surface); }
.btn.primary:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; padding: 0 8px; }
.btn.ghost:hover { opacity: .6; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn.secondary:hover { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.danger { background: var(--crit-ink); color: #fff; }
.btn.danger:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.actions-row { display: flex; gap: 10px; margin-bottom: 16px; }
details > summary.btn { list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }

/* ── 폼 ── */
.grid-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.grid-form label, form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.grid-form label.wide { grid-column: 1 / -1; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  height: 40px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-control);
  font-family: var(--font-body); font-size: 14px; color: var(--ink); background: var(--surface);
  transition: border-color 200ms ease;
}
textarea { height: auto; padding: 10px 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
.hint { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.label-row { display: inline-flex; align-items: center; gap: 5px; }
/* 호버 툴팁 — <span class="tip" data-tip="...">ⓘ</span> */
.tip {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--border-strong);
  font-size: 10px; line-height: 1; color: var(--ink-3); cursor: help; user-select: none;
}
.tip::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 7px); left: 50%;
  transform: translateX(-50%); white-space: nowrap;
  background: var(--ink); color: var(--paper); font-size: 12px; font-weight: 400;
  padding: 6px 11px; border-radius: 8px; box-shadow: 0 4px 14px rgba(10,10,10,.2);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 140ms ease; z-index: 10;
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; visibility: visible; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
.inline-form { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input[type=text] { min-width: 260px; }
.check { flex-direction: row !important; align-items: center; gap: 8px; font-weight: 400 !important; color: var(--ink) !important; font-size: 14px !important; }
.check input { width: 17px; height: 17px; accent-color: var(--ink); }
.check-row { display: flex; gap: 20px; flex-wrap: wrap; }
.subsection { margin-top: 12px; padding: 16px; background: var(--paper); border: 1px solid var(--border); border-radius: 14px; }
.subsection h3 { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.hidden { display: none; }

/* ── 테이블 (에디토리얼) ── */
table { width: 100%; border-collapse: collapse; }
thead th {
  background: transparent; color: var(--ink-3);
  font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--ink);
}
tbody td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 14px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(10,10,10,.025); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-blocked { background: var(--crit-bg); }
.row-blocked:hover { background: var(--crit-bg); }

/* ── 스탯 타일 (워크스페이스) ── */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sheet); padding: 22px; }
.tile-num { font-family: var(--font-heading); font-size: 40px; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tile-num.zero { color: var(--ink-3); }
.tile-num.crit-ink { color: var(--crit-ink); }
.tile-num.warn-ink { color: var(--warn-ink); }
.tile-label { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* ── 스테퍼 ── */
.stepper { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.step { display: flex; align-items: center; gap: 6px; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
  background: transparent; color: var(--ink-3); border: 1px solid var(--border-strong);
}
.step.done .step-dot { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.step.current .step-dot { color: var(--ink); border: 2px solid var(--ink); }
.step-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.step.current .step-label { color: var(--ink); }
.step-line { flex: 0 0 32px; height: 1px; background: var(--border-strong); }

/* ── 페이지 헤더(레거시)·키값 ── */
.page-title { font-family: var(--font-heading); font-size: 28px; letter-spacing: -0.02em; font-weight: 500; margin-bottom: 16px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.page-head .page-title { margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 24px; margin-bottom: 12px; font-size: 13px; }
.kv .k { color: var(--ink-3); margin-right: 8px; }
.value-preview { background: var(--paper); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0; color: var(--ink-2); }

/* ── 커뮤니티 피드 (토스형 단일 컬럼) ── */
.feed { max-width: 720px; margin: 0 auto; }          /* 상세 페이지 — 읽기 폭 */
.feed.feed-wide { max-width: none; }                 /* 목록 페이지 — 컨테이너 전체 폭 */
.feed-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.feed-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.feed-search input[type=text] { min-width: 300px; }
/* FAQ / 질문 게시판 전환 탭 — 두 칸 동일 폭 */
.board-tabs {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden;
}
.board-tabs a {
  padding: 8px 22px; font-size: 14px; font-weight: 500; text-decoration: none;
  text-align: center; white-space: nowrap;
  color: var(--ink-2); transition: background 150ms ease, color 150ms ease;
}
.board-tabs a:hover { color: var(--ink); opacity: 1; }
.board-tabs a.active { background: var(--ink); color: var(--paper); }
.sort-tabs { display: inline-flex; gap: 6px; align-items: center; }
.report-box { display: inline-block; }
.report-box .hint { margin-top: 6px; }
.feed-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.feed-grid > .card { margin-bottom: 0; }
a.card.feed-item { margin-bottom: 12px; padding: 20px 22px; }
.feed-item h3 { margin: 8px 0 6px; font-size: 16px; }
.feed-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.feed-preview {
  color: var(--ink-2); font-size: 14px; margin: 0; white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-title { font-family: var(--font-heading); font-size: 24px; letter-spacing: -0.01em; margin: 10px 0; }
.post-body { white-space: pre-line; font-size: 15px; margin: 0; }
/* 해설 내 법령·조문 링크 — 점선 밑줄로 본문과 구분 */
.law-link { color: var(--ink); text-decoration: underline; text-decoration-style: dotted;
            text-underline-offset: 3px; text-decoration-thickness: 1px; }
.law-link:hover { opacity: 1; text-decoration-style: solid; }
.card.comment { padding: 16px 20px; margin-bottom: 10px; }
.card.comment.accepted { box-shadow: 0 0 0 1.5px var(--ok-ink); }   /* 채택된 답변 — 최상단 강조 */
.comment-actions { margin-left: auto; display: inline-flex; gap: 10px; align-items: center; }
/* 통합 검색 페이지 — 검색바는 넓게, 섹션 사이 여백 */
.search-page-form { margin-bottom: 20px; }
.search-page-form input[type=text] { flex: 1; max-width: 560px; }
.link-btn { border: none; background: transparent; padding: 0; cursor: pointer;
            font-family: var(--font-body); font-size: 12px; color: var(--ink-3);
            text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.link-btn:hover { color: var(--ink); }
.link-btn.danger { color: var(--crit-ink); }
details > summary.link-btn { display: inline-block; }
/* 내 활동(마이페이지) 항목별 바로 관리 링크 */
.inline-actions { display: inline-flex; gap: 10px; align-items: center; margin-left: 6px; }
.inline-actions form { display: inline; margin: 0; }
/* ── 알림 목록 (/notifications) ── */
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.notif-head form { margin: 0; }
.notif-list { list-style: none; margin: 12px 0 0; padding: 0; }
.notif-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
              padding: 12px 10px; border-top: 1px solid var(--border); }
.notif-item:first-child { border-top: none; }
.notif-item.notif-unread { background: var(--neutral-bg); border-radius: 10px; }
.notif-item.notif-unread a, .notif-item.notif-unread > span:not(.badge):not(.muted) { font-weight: 600; }
.notif-item .muted { margin-left: auto; font-size: 13px; white-space: nowrap; }
.manage-box { margin-bottom: 16px; }
.manage-box .inline-form { margin-top: 10px; }
.feed-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.feed-tags .tag { font-size: 12px; color: var(--ink-3); text-decoration: none; }

/* ── 최근 본 항목 · 즐겨찾기 (localStorage) ── */
.rl-strip { margin-bottom: 22px; }
.rl-title { font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 0 0 10px; }
.rl-strip .chip-row { margin-bottom: 0; }
.rl-actions { display: flex; gap: 10px; align-items: center; margin: 0 0 22px; }
.fav-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 6px 16px; font-size: 13px; font-weight: 500;
  font-family: var(--font-body);
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.fav-btn:hover { border-color: var(--ink); }
.fav-btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.fav-btn .fav-star { font-size: 14px; line-height: 1; }

/* ── 댓글 공감(추천) ── */
.comment-foot { margin-top: 12px; }
.like-form { display: inline-block; margin: 0; }
.like-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 4px 14px; font-size: 12px; font-weight: 500;
  font-family: var(--font-body);
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.like-btn:hover { border-color: var(--ink); color: var(--ink); }
.like-btn.liked { background: var(--ink); color: var(--surface); border-color: var(--ink); cursor: default; }
.like-count { font-variant-numeric: tabular-nums; }
a.tag:hover { color: var(--ink); text-decoration: underline; }

/* ── 맨 위로 버튼 — 한 화면 이상 스크롤 시 우하단 표시 ── */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 80;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--ink); color: var(--paper); font-size: 18px; line-height: 1;
  box-shadow: 0 6px 20px rgba(10,10,10,.25);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 200ms ease, transform 200ms ease, visibility 200ms;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { opacity: .8; }
@media print { .to-top { display: none !important; } }

/* ── 실무 라운지 채팅 위젯 ── */
/* 우측상단 모서리 고정 — 최소화 동그라미와 채팅창이 같은 지점을 공유, 채팅창은 우→좌·아래로 펼쳐짐 */
.chat-widget { position: fixed; right: 24px; top: 120px; z-index: 90; display: flex; flex-direction: column; align-items: flex-end; }
.chat-bubble {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--ink); color: var(--paper); border: none; cursor: pointer;
  position: relative; display: none; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(10,10,10,.28);
  transition: transform 200ms ease; touch-action: none;
}
.chat-bubble:hover { transform: translateY(-2px); }
.chat-mark { width: 26px; height: 26px; display: block; transition: transform 300ms ease; }
.chat-bubble:hover .chat-mark { transform: rotate(90deg); }
.chat-title-mark { height: 13px; width: auto; display: inline-block; vertical-align: -1px; }
.chat-dot { position: absolute; right: 4px; bottom: 5px; width: 11px; height: 11px; border-radius: 50%; background: #3BA55D; border: 2px solid var(--paper); }
.chat-unread {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px;
  border-radius: 999px; background: var(--crit-ink); color: #fff;
  font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.chat-widget.chat-min .chat-bubble { display: flex; }
.chat-widget.chat-min .chat-panel { display: none; }
.chat-panel {
  position: relative;
  width: 330px; height: 430px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 16px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 12px 40px rgba(10,10,10,.18);
}
.chat-resize-top { position: absolute; top: 0; left: 0; right: 0; height: 8px; cursor: ns-resize; z-index: 2; touch-action: none; }
.chat-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  cursor: grab; user-select: none; background: var(--paper); touch-action: none;
}
.chat-head:active { cursor: grabbing; }
.chat-title { font-weight: 600; font-size: 14px; }
.chat-retention { font-size: 10px; font-weight: 500; color: var(--ink-3); border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 6px; vertical-align: 2px; }
.chat-count { margin-left: auto; margin-right: 8px; font-size: 11px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.chat-count:not(:empty)::before { content: "● "; color: #3BA55D; font-size: 8px; vertical-align: 1px; }
.chat-minbtn { border: none; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink-2); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { font-size: 13px; line-height: 1.5; word-break: break-word; max-width: 82%; align-self: flex-start; padding: 6px 10px; border-radius: 12px 12px 12px 4px; background: var(--paper); border: 1px solid var(--border); }
.chat-msg-mine { align-self: flex-end; text-align: right; background: var(--info-bg); border-color: var(--info-bg); border-radius: 12px 12px 4px 12px; }
.chat-msg .who { font-weight: 600; margin-right: 6px; }
.chat-msg .when { color: var(--ink-3); font-size: 11px; margin-left: 6px; }
/* 채팅 역할 배지 — 게이미피케이션 확장 지점 (chat-badge-{role}) */
.chat-badge { display: inline-block; font-size: 9px; font-weight: 600; line-height: 1;
              padding: 2px 6px; border-radius: 999px; margin-left: 5px; vertical-align: 1px; }
.chat-badge-master { background: var(--ink); color: var(--paper); }
/* 마스터 전용 메시지 삭제 버튼 — 부적절 채팅 정리 */
.chat-del { border: none; background: transparent; color: var(--ink-3); cursor: pointer;
            font-size: 15px; line-height: 1; padding: 0 2px; margin-left: 6px; vertical-align: 1px; opacity: .55; }
.chat-del:hover { opacity: 1; color: var(--crit-ink); }
.chat-inputrow { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--border); }
.chat-inputrow .chat-nick { width: 78px; height: 32px; font-size: 12px; padding: 0 8px; }
.chat-inputrow .chat-text { flex: 1; height: 32px; font-size: 13px; padding: 0 10px; }
.chat-inputrow .btn { height: 32px; }
.chat-resize { position: relative; height: 12px; flex: 0 0 auto; cursor: ns-resize; touch-action: none; }
.chat-resize::before { content: ""; position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%); width: 34px; height: 3px; border-radius: 2px; background: var(--border-strong); opacity: .55; }
.chat-resize:hover::before { opacity: 1; }
.hidden { display: none !important; }
@media print { .chat-widget { display: none !important; } }

/* ── 인쇄 점검표 ── */
.print-page { background: #fff; }
.print-sheet { max-width: 900px; margin: 0 auto; padding: 40px 32px; }
.print-sheet h1 { font-size: 20px; margin-bottom: 16px; }
.sign-row { display: flex; gap: 24px; margin: 32px 0 16px; }
.sign-box { flex: 1; border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px; min-height: 90px; font-size: 13px; color: var(--ink-2); text-align: center; }
@media print {
  .no-print, .mfnav-wrap, .mfnav, .subnav { display: none !important; }
  body { background: #fff; }
  .print-sheet { padding: 0; }
}

/* ── 반응형 ── */
@media (max-width: 960px) {
  .feature-grid, .principle-grid { grid-template-columns: 1fr 1fr; }
  .feed-grid { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-grid .auth-card { max-width: none; }
  /* 모바일 내비 — 탭은 햄버거 토글 시 필 아래 드롭다운으로 */
  .mfnav { position: relative; }
  .mflinks { display: none; }
  .nav-burger { display: block; }
  .mfnav.nav-open .mflinks {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
    background: rgba(255,255,255,.97); backdrop-filter: blur(8px);
    border-radius: 14px; padding: 8px;
    box-shadow: 0 1px 1px 0 rgba(38,38,43,.10), 0 0 0 1px rgba(38,38,43,.04),
                0 10px 30px -8px rgba(38,38,43,.25);
  }
  .mfnav.nav-open .mflinks a { text-align: center; padding: 10px; }
  .mfnav.nav-open .mflinks .nav-search-mobile { display: block !important; }
  .mfnav-user .nav-search { display: none; }
}
@media (max-width: 720px) {
  .feature-grid, .principle-grid, .statute-grid, .case-grid, .duty-grid, .law-grid, .grid-form { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .stat { padding-right: 24px; }
  .stat + .stat { padding-left: 24px; }
}
