/* 나만의 전세금 AI 비서 — 화면 스타일 (v4: 노선도와 민원 서식)
   - 하나의 강조: 5단계 회수 절차를 노선도처럼 잇는 선(.stage-strip, .route-list)
   - 나머지는 관공서 서식처럼: 흰 종이, 괘선, 각진 모서리, 그림자 없음
   - 색: 청색(주 행동·현재 위치) / 인주 빨강(놓치면 손해가 큰 경고) / 황색(확인 필요) / 녹색(확인됨)
   - 외부 글꼴·이미지 없음(CSP), 본문 16px 이상, 대비 4.5:1 이상 */
:root {
  /* 흰색·파랑·녹색 3계열(주택도시보증공사 로고 색). 빨강·황색은 놓치면 손해가 큰 경고와 확인 필요 표시에만 예외로 쓴다. */
  --ground: #e4f1f9;        /* Hug sky blue를 옅게 깐 바탕 */
  --paper: #ffffff;
  --sunk: #f2f8fc;
  --ink: #16243a;           /* 본문: 짙은 남색 */
  --ink-2: #364559;
  --muted: #586778;
  --line: #cfe0ec;
  --line-strong: #9fb8cb;

  --route: #1c75bc;         /* Hug blue(R28 G117 B188): 지금 할 일·버튼·현재 위치 */
  --route-deep: #155c94;    /* Hug blue 진하게: 글자 링크·누름 */
  --route-tint: #e6f1fa;
  --sky: #009edb;           /* Hug sky blue(R0 G158 B219): 노선·테두리 등 장식(글자에는 쓰지 않음) */
  --route-line: #9ccbea;
  --route-idle: #cddfeb;

  --green: #80c342;         /* Hug green(R128 G195 B66): 확인됨·끝난 단계(면·선) */
  --green-line: #bfe09f;

  --seal: #b3261e;
  --seal-deep: #8f1d17;
  --seal-tint: #fcedec;
  --seal-line: var(--seal-line);

  --amber: #855000;
  --amber-tint: #fff4dc;
  --amber-line: #e3c07a;

  --ok: #3a7d1e;            /* Hug green 진하게: 녹색 글자(대비 4.5:1 이상) */
  --ok-tint: #eef7e6;

  --focus: #f0b400;
  --r: 6px;
  --r-sm: 4px;

  /* 글꼴: Wanted Sans(SIL OFL 1.1, static/fonts/wanted-sans에 직접 둠 — 외부 글꼴 서버는 CSP·기관망에서 막힘) */
  /* 글자 크기 5단계 — 새 크기를 만들지 말고 이 중에서 고른다 */
  --fs-xs: 13px;    /* 표 라벨·작은 안내 */
  --fs-sm: 14px;    /* 보조 글·목록 부가정보 */
  --fs-base: 16px;  /* 본문·입력칸(iOS 확대 방지 위해 16 이상) */
  --fs-md: 17px;    /* 카드 제목·강조 문장 */
  --fs-lg: 20px;    /* 화면 소제목 */
  --sans: "Wanted Sans Variable", "Wanted Sans", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  --num: "Wanted Sans Variable", "Wanted Sans", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;

  /* 이전 이름 호환(JS·보조 클래스에서 참조) */
  --primary: var(--route);
  --primary-dark: var(--route-deep);
  --primary-soft: var(--route-tint);
  --teal-dark: var(--route-deep);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--ground);
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
  -webkit-font-smoothing: antialiased;
}
p, li, dd, label, legend { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--route-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1:focus, h2:focus, main:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  padding: 8px 14px; border-radius: var(--r-sm); background: var(--ink); color: #fff;
}
.skip:focus { top: 8px; color: #fff; }

/* ---------- 움직임: 사용자의 행동에 대한 반응 + 노선이 그려지는 한 장면만 ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dots { 0%, 20% { opacity: 0.25; } 50% { opacity: 1; } 100% { opacity: 0.25; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@keyframes lay { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes layY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes ringDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes flash { from { background-color: var(--route-tint); } to { background-color: var(--sunk); } }

.ripple { display: none; }
.shake { animation: shake 0.35s ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .spinner { animation: spin 2.4s linear infinite !important; }
}

/* ---------- 상단 ---------- */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner {
  max-width: 1440px; margin: 0 auto; padding: 12px clamp(12px, 2vw, 24px);
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; border-radius: var(--r-sm); }
a.brand:hover strong { color: var(--route-deep); }
a.brand:focus-visible { outline-offset: 4px; }
/* 로고: 노선 위의 역 하나 */
.brand-mark {
  position: relative; flex: none; width: 40px; height: 22px; font-size: 0;
}
.brand-mark::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 6px; border-radius: 3px; background: var(--route); }
.brand-mark::after {
  content: ""; position: absolute; left: 11px; top: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--paper); border: 5px solid var(--green);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-text strong { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -0.02em; }
.brand-text span { font-size: var(--fs-xs); color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; }
.user { font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; }

.ai-badge {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk);
  color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.ai-badge:hover { border-color: var(--line-strong); }
.ai-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--route); }
.ai-badge.off::before { background: var(--muted); }

/* ---------- 알림 띠 ---------- */
.notice {
  max-width: 1144px; width: calc(100% - 2 * clamp(16px, 3vw, 28px)); margin: 12px auto 0;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 50px; padding: 8px 8px 8px 16px; border: 1px solid var(--route-line);
  border-radius: var(--r-sm); background: var(--paper); color: var(--ink-2); font-size: var(--fs-base); line-height: 1.5;
  opacity: 0; transition: opacity 0.2s ease;
}
.notice > span { flex: 1; }
.notice.is-in { opacity: 1; }
.notice-warn { border-color: var(--amber-line); background: var(--amber-tint); color: var(--amber); }
.notice-error { border-color: var(--seal-line); background: var(--seal-tint); color: var(--seal-deep); }
.notice .btn-text { flex: none; color: var(--muted); }

/* ---------- 배치 ---------- */
.layout {
  flex: 1; width: 100%; max-width: 1200px; margin: 0 auto;
  padding: 28px clamp(16px, 3vw, 28px) 56px;
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px 36px; align-items: start;
}
.layout.single { grid-template-columns: minmax(0, 1fr); max-width: 940px; }
main { min-width: 0; }
.layout:not(.single) main { max-width: 820px; }

/* ---------- 사건 메뉴 ---------- */
.case-nav { position: sticky; top: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.menu-toggle { display: none; }
.menu-body-inner { padding: 6px 0 10px; }
.case-head { padding: 14px 16px 14px; border-bottom: 1px solid var(--line); }
.eyebrow-sm { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.case-title { margin: 2px 0 6px; font-weight: 800; font-size: var(--fs-md); line-height: 1.4; }
.case-meta { margin: 0; font-size: var(--fs-xs); color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.steps { list-style: none; margin: 6px 0 0; padding: 0; }
.step {
  width: 100%; min-height: 58px; display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--ink);
}
.step:hover { background: var(--sunk); }
.step-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--paper); color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; font-family: var(--num);
}
.step-text { display: flex; flex-direction: column; line-height: 1.35; }
.step-text strong { font-size: var(--fs-base); font-weight: 600; }
.step-sub { font-size: var(--fs-xs); color: var(--muted); }
.step.active { background: var(--route-tint); }
.step.active .step-num { background: var(--route); border-color: var(--route); color: #fff; }
.step.active .step-text strong { font-weight: 800; }
.steps-extra { margin: 8px 16px 0; padding-top: 10px; border-top: 1px solid var(--line); }
.steps-extra ul { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); color: var(--muted); }
.steps-extra li { padding: 3px 0; }
.steps-extra li::after { content: " (준비 중)"; font-size: var(--fs-xs); }

@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 14px; }
  .case-nav { position: static; }
  .menu-toggle {
    display: flex; width: 100%; min-height: 54px; align-items: center; justify-content: space-between; gap: 8px;
    padding: 0 16px; border: 0; background: none; cursor: pointer; text-align: left;
  }
  .menu-toggle-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
  .menu-toggle-text strong { font-size: var(--fs-base); }
  .menu-toggle-text span { font-size: var(--fs-xs); color: var(--ink-2); }
  .chev { width: 10px; height: 10px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg) translateY(-3px); transition: transform 0.25s ease; }
  .case-nav.open .chev { transform: rotate(225deg) translateY(-3px); }
  .menu-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s ease; }
  .menu-body > * { min-height: 0; overflow: hidden; }
  .case-nav.open .menu-body { grid-template-rows: 1fr; }
  .menu-body-inner { border-top: 1px solid var(--line); }
  .case-head { display: none; }
}

/* ---------- 제목·문단 ---------- */
.eyebrow { display: inline-block; font-size: var(--fs-sm); font-weight: 700; color: var(--route-deep); }
h1, .h1 { margin: 6px 0 8px; font-size: clamp(26px, 3.6vw, 32px); font-weight: 800; line-height: 1.3; letter-spacing: -0.03em; }
h2 { margin: 0 0 8px; font-size: var(--fs-lg); font-weight: 800; line-height: 1.4; letter-spacing: -0.02em; }
h3 { margin: 0 0 6px; font-size: var(--fs-base); font-weight: 700; }
.lead { margin: 0 0 22px; color: var(--ink-2); font-size: var(--fs-md); }
.meta { margin: 0 0 18px; font-size: var(--fs-sm); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.page-head { margin-bottom: 10px; }

/* ---------- 서식 종이 ---------- */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  padding: clamp(18px, 3.5vw, 26px); margin-bottom: 16px; min-width: 0;
}
/* 서식의 칸 제목: 아래 괘선 */
.card > h2:first-child, .card > .card-head:first-child, .card > legend + h2 { padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.card > .card-head:first-child h2 { margin: 0; }
.card-accent { border-color: var(--route-line); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; align-items: start; }
.grid-2 > .card { margin: 0; }

/* 상태 표시: 도장처럼 테두리 있는 작은 글자 */
.tag {
  display: inline-block; font-size: var(--fs-xs); font-weight: 700; padding: 0 7px; border-radius: 3px; line-height: 1.75;
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink-2); white-space: nowrap;
}
.tag.ok { border-color: var(--green-line); background: var(--ok-tint); color: var(--ok); }
.tag.warn, .tag.conflict { border-color: var(--amber-line); background: var(--amber-tint); color: var(--amber); }
.tag.bad { border-color: var(--seal-line); background: var(--seal-tint); color: var(--seal-deep); }
.tag.info, .tag.document { border-color: var(--route-line); background: var(--route-tint); color: var(--route-deep); }
.tag.statement { border-color: var(--line-strong); background: var(--sunk); color: var(--ink-2); }
.tag.unknown, .tag.unsure { border-style: dashed; color: var(--muted); }
.tag.solid { background: var(--route); border-color: var(--route); color: #fff; }

.callout { display: flex; gap: 10px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--r-sm); margin-bottom: 16px; border: 1px solid; }
.callout.warn { background: var(--amber-tint); border-color: var(--amber-line); color: var(--amber); }
.callout.info { background: var(--route-tint); border-color: var(--route-line); color: var(--route-deep); }
.callout.soft { background: var(--sunk); border-color: var(--line); color: var(--ink-2); }
p.callout { display: block; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: var(--r); border: 1px solid transparent;
  font-weight: 700; font-size: var(--fs-base); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:disabled { cursor: not-allowed; opacity: 0.6; }
.btn-primary { background: var(--route); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--route-deep); }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: var(--fs-md); }
.btn-block { width: 100%; min-height: 52px; }
.btn-secondary, .btn-quiet, .btn-outline { background: var(--paper); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary { min-height: 42px; padding: 0 16px; font-weight: 600; }
.btn-secondary:hover:not(:disabled), .btn-quiet:hover, .btn-outline:hover:not(:disabled) { border-color: var(--ink); }
.btn-outline { border-color: var(--ink); }
.btn-danger { background: var(--seal); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--seal-deep); }
.btn-danger-outline { background: var(--paper); border-color: var(--seal); color: var(--seal-deep); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: var(--fs-sm); }
.btn-text {
  min-height: 36px; padding: 0 4px; border: 0; background: none; color: var(--route-deep);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: var(--fs-sm); white-space: nowrap;
}
.btn-text:hover { color: var(--ink); }
.btn-text.danger { color: var(--seal-deep); }
.btn-text.quiet { color: var(--ink-2); }
.btn .spinner-sm { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; animation: spin 0.8s linear infinite; }
.actions { display: flex; gap: 8px 12px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin: 8px 0 24px; }
.actions.left { justify-content: flex-start; margin: 12px 0 0; }
.actions .hint { font-size: var(--fs-sm); color: var(--ink-2); }

/* ---------- 입력 ---------- */
.field { display: flex; flex-direction: column; }
.field-label { display: block; font-weight: 700; font-size: var(--fs-base); margin-bottom: 6px; }
.field-label .opt { font-weight: 400; color: var(--muted); }
.field-hint { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.field-caps { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--amber); }
.field-error { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--seal-deep); display: flex; gap: 6px; align-items: flex-start; animation: drop 0.2s ease; }
.err-ico { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--seal); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.field-ok { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--ok); }
input[type="text"], input[type="password"], input[type="tel"], input[type="email"], input[type="date"], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--paper); font-size: var(--fs-base); transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { padding: 12px 14px; line-height: 1.7; resize: vertical; min-height: 0; }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--route); box-shadow: 0 0 0 3px rgba(28, 117, 188, 0.25); }
input:disabled, textarea:disabled, select:disabled { background: var(--sunk); color: var(--muted); cursor: not-allowed; }
textarea[readonly] { background: var(--sunk); }
input::placeholder, textarea::placeholder { color: #7b8592; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--seal); }
.has-error input:focus { box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.18); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 80px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 36px; padding: 0 12px;
  border: 0; border-radius: var(--r-sm); background: var(--sunk); color: var(--route-deep); font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
}
.pw-toggle:hover { background: var(--route-tint); }
.pw-rules { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-xs); }
.pw-rules li { color: var(--muted); }
.pw-rules li::before { content: "○ "; }
.pw-rules li.met { color: var(--ok); font-weight: 600; }
.pw-rules li.met::before { content: "✓ "; }

.check-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--sunk); }
.check-row:hover { border-color: var(--line-strong); }
.check-row input, .check input { flex: none; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--route); cursor: pointer; }

/* ---------- 로그인·회원가입 ---------- */
.auth-hero { max-width: 480px; margin: 12px auto 22px; }
.auth-hero h1 { font-size: clamp(28px, 5vw, 36px); line-height: 1.25; margin: 0 0 10px; }
.auth-hero p { margin: 0; color: var(--ink-2); font-size: var(--fs-md); }
.auth-card { width: 100%; max-width: 480px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.tab {
  position: relative; z-index: 1; height: 54px; border: 0; background: transparent;
  color: var(--muted); font-size: var(--fs-base); font-weight: 700; cursor: pointer;
}
.tab:hover:not([aria-selected="true"]):not(:disabled) { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab:disabled { cursor: not-allowed; }
.tab-indicator { position: absolute; left: 0; bottom: -1px; width: 50%; height: 3px; background: var(--ink); transition: transform 0.3s ease; }
.tabs[data-active="register"] .tab-indicator { transform: translateX(100%); }
.auth-panel { padding: 24px clamp(18px, 5vw, 32px) 30px; display: flex; flex-direction: column; gap: 18px; }
.auth-note { padding: 14px 16px; border-radius: var(--r-sm); background: var(--sunk); border: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-base); display: flex; flex-direction: column; gap: 6px; }
.form-alert { padding: 12px 16px; border-radius: var(--r-sm); font-size: var(--fs-base); border: 1px solid; animation: drop 0.2s ease; }
.form-alert strong { display: block; }
.form-alert.error { background: var(--seal-tint); border-color: var(--seal-line); color: var(--seal-deep); }
.form-alert.network { background: var(--amber-tint); border-color: var(--amber-line); color: var(--amber); }
.auth-help { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); text-align: center; }
.consent { border: 1px solid var(--line); border-radius: var(--r-sm); margin: 0; padding: 16px; min-width: 0; }
.consent.has-error { border-color: var(--seal); }
.consent legend { padding: 0 6px; font-weight: 700; font-size: var(--fs-base); }
.facts-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; margin: 4px 0 12px; font-size: var(--fs-sm); border-top: 1px solid var(--line); }
.facts-dl dt, .facts-dl dd { padding: 7px 0; border-bottom: 1px solid var(--line); }
.facts-dl dt { color: var(--muted); font-weight: 600; padding-right: 16px; }
.facts-dl dd { margin: 0; }
.more summary { cursor: pointer; color: var(--route-deep); font-weight: 600; padding: 6px 0; font-size: var(--fs-sm); }
.more-body { display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-sm); color: var(--ink-2); padding-top: 6px; }
.more-body strong { color: var(--ink); }
.more-body p { margin: 2px 0 0; }
.auth-back { max-width: 480px; margin: 0 auto 10px; }
.auth-back .btn-text { padding: 0; }

/* ---------- 첫 화면 ---------- */
body.is-landing #model-status { display: none !important; }
.layout.landing-mode { max-width: 1200px; display: block; padding: clamp(28px, 6vw, 72px) clamp(16px, 3vw, 28px) 72px; }
.layout.landing-mode main { max-width: none; }
.landing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.landing-copy { display: flex; flex-direction: column; align-items: flex-start; padding-top: 12px; }
.landing-title { margin: 0 0 20px; font-size: clamp(36px, 5.4vw, 58px); font-weight: 800; line-height: 1.2; letter-spacing: -0.04em; }
.landing-sub { margin: 0 0 32px; max-width: 30em; font-size: clamp(17px, 2vw, 19px); line-height: 1.7; color: var(--ink-2); }
.landing-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.landing-actions .btn { min-width: 150px; }
.landing-ghost { background: var(--paper); border-color: var(--ink); color: var(--ink); }
.landing-ghost:hover { background: var(--sunk); }
.landing-note { margin: 22px 0 0; font-size: var(--fs-sm); color: var(--muted); }

/* 첫 화면의 노선도: 다섯 정거장 */
.landing-route { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 28px 10px; }
.landing-route h2 { font-size: var(--fs-md); margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.route-list { list-style: none; margin: 0; padding: 0; counter-reset: stop; }
.route-list li { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 16px; padding: 0 0 22px; counter-increment: stop; }
.route-list li::before {
  content: counter(stop); position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%;
  border: 4px solid var(--route); background: var(--paper); color: var(--route-deep);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; font-family: var(--num);
}
.route-list li:not(:last-child)::after {
  content: ""; position: absolute; left: 14px; top: 30px; bottom: -4px; width: 6px; background: var(--route);
  transform-origin: top; animation: layY 0.5s ease both; animation-delay: calc(var(--i, 0) * 0.12s + 0.2s);
}
.route-list li:last-child::before { background: var(--green); border-color: var(--green); color: #fff; }
.route-list strong { display: block; font-size: var(--fs-md); line-height: 1.3; margin-top: 4px; }
.route-list span { display: block; margin-top: 2px; font-size: var(--fs-base); color: var(--ink-2); }

@media (max-width: 860px) {
  .landing { grid-template-columns: minmax(0, 1fr); }
  .landing-route { padding: 22px 20px 6px; }
}
@media (max-width: 480px) { .landing-actions { width: 100%; } .landing-actions .btn { flex: 1 1 140px; min-width: 0; } }

/* ---------- 내 사건: 사건 대장 ---------- */
.ledger-card { margin-bottom: 16px; }
.ledger-card > .card-head:first-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 12px; }
.ledger { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.ledger-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 28px; align-items: center; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.ledger-row.demo { grid-template-columns: minmax(0, 1fr) auto; }
.ledger-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ledger-title { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.ledger-title strong { font-size: var(--fs-md); font-weight: 800; }
.ledger-status { font-size: var(--fs-sm); font-weight: 700; color: var(--route-deep); }
.ledger-desc { font-size: var(--fs-base); color: var(--ink-2); }
.ledger-meta { display: grid; grid-template-columns: auto auto; gap: 0 10px; margin: 0; font-size: var(--fs-sm); }
.ledger-meta dt { color: var(--muted); }
.ledger-meta dd { margin: 0; font-variant-numeric: tabular-nums; }
.ledger-actions { display: flex; gap: 6px 12px; align-items: center; }
.ledger-empty { padding: 18px 2px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.ledger-new { margin-top: 22px; max-width: 560px; }
.expire-soon { white-space: nowrap; color: var(--seal-deep); font-weight: 700; }
.account-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; padding: 14px 2px 0; border-top: 1px solid var(--line-strong); }
@media (max-width: 700px) {
  .ledger-row, .ledger-row.demo { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ledger-meta { justify-content: start; }
}
.empty { text-align: center; padding: 32px; background: transparent; border-style: dashed; }
.skeleton { height: 150px; border-radius: var(--r); border: 1px solid var(--line); background: var(--sunk); }
.demo-btn { width: 100%; text-align: left; padding: 14px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--sunk); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }

/* ---------- 상황과 자료 ---------- */
.demo-strip { margin: 0 0 18px; padding: 9px 14px; border-radius: var(--r-sm); background: var(--paper); border: 1px dashed var(--line-strong); color: var(--ink-2); font-size: var(--fs-sm); }
.hint-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.hint-chips > span { font-size: var(--fs-sm); color: var(--muted); }
.chip-btn { min-height: 36px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--paper); font-size: var(--fs-sm); cursor: pointer; color: var(--ink-2); }
.chip-btn:hover { border-color: var(--route); color: var(--route-deep); }
.save-row { display: flex; justify-content: flex-end; align-items: center; margin-top: 10px; gap: 8px 12px; flex-wrap: wrap; }
.save-status { font-size: var(--fs-sm); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-status.saving::after { content: "●●●"; font-size: 8px; letter-spacing: 2px; animation: dots 1s linear infinite; }
.save-status.saved { color: var(--ok); }
.save-status.error { color: var(--seal-deep); }

.doc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.doc { border-bottom: 1px solid var(--line); min-width: 0; }
.doc.pending { background: var(--amber-tint); }
.doc-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 12px 6px; }
.doc-head strong { flex: 1 1 200px; min-width: 0; }
.doc-src { font-size: var(--fs-xs); color: var(--ink-2); }
.doc-toggle { display: inline-flex; align-items: center; gap: 6px; }
.doc-toggle .chev-sm { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 0.25s ease; }
.doc.open .doc-toggle .chev-sm { transform: rotate(225deg) translateY(-2px); }
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s ease; }
.collapse > .collapse-inner { min-height: 0; overflow: hidden; }
.open > .collapse, .collapse.open { grid-template-rows: 1fr; }
.doc-body { padding: 0 6px 16px; }
.doc-body label { display: block; margin: 0 0 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.doc-body textarea { font-size: var(--fs-base); }

.add-panel { margin-top: 18px; border: 1px solid var(--line); background: var(--sunk); border-radius: var(--r-sm); padding: 18px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 0 0 0 10px; border: 1px solid var(--route-line); border-radius: var(--r-sm); background: var(--route-tint); color: var(--route-deep); font-size: var(--fs-sm); font-weight: 600; }
.chip button { width: 32px; height: 32px; border: 0; background: none; cursor: pointer; color: inherit; font-size: var(--fs-base); }
.chip button:hover { color: var(--ink); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 200px; width: auto; min-width: 0; }

.mode-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px; margin-top: 6px; }
.mode { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); cursor: pointer; background: var(--paper); }
.mode:hover { border-color: var(--ink-2); }
.mode:has(input:checked) { border: 2px solid var(--route); padding: 15px; background: var(--route-tint); }
.mode input { flex: none; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--route); }
.mode span { display: flex; flex-direction: column; }
.mode small { font-size: var(--fs-sm); color: var(--ink-2); }
fieldset.card legend { padding: 0 6px; font-weight: 800; font-size: var(--fs-md); }

/* ---------- 정리된 사실 ---------- */
.error-card { border-color: var(--seal-line); background: var(--seal-tint); }
.error-card h2 { color: var(--seal-deep); border-bottom-color: var(--seal-line) !important; }
.summary-text { margin: 0; font-size: var(--fs-md); line-height: 1.8; color: var(--ink-2); }
.conflict-card { border-color: var(--amber-line); }
.conflict-card ul { margin: 6px 0 0; padding-left: 20px; }
.summary-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-base); line-height: 1.7; color: var(--ink-2); }
.summary-list li::marker { color: var(--route-deep); font-weight: 700; font-family: var(--num); }

.q-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.q-progress-text { font-size: var(--fs-sm); font-weight: 700; color: var(--route-deep); font-variant-numeric: tabular-nums; }
.progress { height: 6px; border-radius: 3px; background: var(--route-idle); margin: 8px 0 12px; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--route); transition: width 0.4s ease; }
.question { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 20px 0 10px; min-width: 0; }
.question legend { padding: 0; font-weight: 700; font-size: var(--fs-md); float: left; width: 100%; }
.question .reason { clear: both; margin: 0; padding-top: 2px; font-size: var(--fs-sm); color: var(--muted); }
.question .q-main { clear: both; }  /* 설명 문구(.reason)가 없는 질문에서 선택지가 떠 있는 제목 옆 좁은 틈으로 밀려 들어가던 문제 */
.conflict-note { margin: 10px 0 0; padding: 10px 14px; border: 1px solid var(--amber-line); border-radius: var(--r-sm); background: var(--amber-tint); color: var(--amber); font-size: var(--fs-sm); }
.q-inputs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.q-inputs input[type="date"], .q-inputs input[type="text"] { width: auto; min-width: 220px; flex: 0 1 280px; }
.q-inputs textarea { flex: 1 1 100%; }

/* 선택지: 서식의 체크 칸처럼 동그라미 표시를 함께 둔다(색만으로 구분하지 않기) */
.pill { position: relative; display: inline-flex; cursor: pointer; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill span {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 16px 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--paper); transition: border-color 0.15s ease, background-color 0.15s ease;
}
.pill span::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--paper); }
.pill:hover span { border-color: var(--ink-2); }
.pill input:checked + span { border: 2px solid var(--route); padding: 0 15px 0 11px; background: var(--route-tint); color: var(--route-deep); font-weight: 700; }
.pill input:checked + span::before { border-color: var(--route); background: var(--route); box-shadow: inset 0 0 0 3px var(--paper); }
.pill input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.pill.unsure span { border-style: dashed; color: var(--ink-2); }
.pill.unsure input:checked + span { border-style: solid; border-color: var(--ink); background: var(--sunk); color: var(--ink); }
.pill.unsure input:checked + span::before { border-color: var(--ink); background: var(--ink); }
.question.is-unsure .q-main { opacity: 0.4; pointer-events: none; }
.how-box { margin: 10px 0 0; padding: 12px 14px; border: 1px solid var(--route-line); border-radius: var(--r-sm); background: var(--route-tint); color: var(--ink-2); font-size: var(--fs-sm); }

.fact-group { margin: 24px 0 8px; font-size: var(--fs-base); display: flex; align-items: center; gap: 8px; }
.fact-group.need { color: var(--amber); }
.fact-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.fact { padding: 12px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.fact.conflict, .fact.unknown { background: linear-gradient(90deg, var(--amber-tint), transparent 60%); padding-left: 10px; }
.fact-main { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.fact-label { flex: 1 1 150px; color: var(--ink-2); }
.fact-value { flex: 3 1 220px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; min-width: 0; font-variant-numeric: tabular-nums; }
.fact-value .missing-val { color: var(--amber); font-weight: 700; }
.fact .evidence { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--ink-2); }
.fact .how { margin: 6px 0 0; font-size: var(--fs-sm); color: var(--route-deep); }
.fact-edit { display: flex; flex-direction: column; gap: 10px; }
.fact-edit input, .fact-edit select { max-width: 320px; }
.fact.flash { animation: flash 1.2s ease; }

/* ---------- 회수계획 ---------- */
.assessment {
  position: relative; border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: clamp(18px, 3.5vw, 26px); margin-bottom: 16px; background: var(--paper); color: var(--ink-2);
}
.assessment.ok { border-color: var(--green-line); }
.assessment.warn { border-color: var(--amber-line); }
.assessment .label { display: inline-block; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.assessment.ok .label { color: var(--ok); }
.assessment.warn .label { color: var(--amber); }
.assessment .headline { margin: 6px 0 14px; font-size: clamp(19px, 2.6vw, 22px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.lines { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 8px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.lines dt, .lines dd { padding: 8px 0; border-bottom: 1px solid var(--line); }
.lines dt { color: var(--muted); padding-right: 24px; }
.lines dd { margin: 0; font-weight: 700; color: var(--ink); }
.assessment .missing { margin: 10px 0 0; font-weight: 700; }
.assessment .caveats { margin: 12px 0 0; padding-left: 18px; font-size: var(--fs-sm); color: var(--muted); }

.plan-items { list-style: none; margin: 0; padding: 0; }
.plan-items li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.plan-items li:last-child { border-bottom: 0; padding-bottom: 4px; }
.plan-num { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--route); color: var(--route-deep); font-weight: 800; font-size: 14px; font-family: var(--num); display: flex; align-items: center; justify-content: center; }
.plan-items strong { font-size: var(--fs-md); line-height: 1.45; }
.plan-items p { margin: 6px 0 0; color: var(--ink-2); }
.basis summary { cursor: pointer; color: var(--route-deep); font-size: var(--fs-sm); padding: 6px 0 0; display: inline-block; }
.basis p { font-size: var(--fs-sm); color: var(--muted); }

/* 이사 전 확인사항: 인주 빨간 두 줄 테두리 — 놓치면 권리를 잃는 경고 */
.plan-section.before_move { border: 3px double var(--seal); background: var(--paper); }
.plan-section.before_move > h2:first-child { color: var(--seal-deep); border-bottom-color: var(--seal-line); display: flex; align-items: center; gap: 12px; }
.plan-section.before_move > h2:first-child::before {
  content: "주의"; flex: none; padding: 1px 7px; border: 2px solid var(--seal); border-radius: 3px;
  color: var(--seal); font-size: var(--fs-sm); font-weight: 800; letter-spacing: 0.08em; transform: rotate(-4deg);
}
.plan-section.before_move .plan-num { border-color: var(--seal); background: var(--seal); color: #fff; }

.checks-card { border-color: var(--amber-line); }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.check-list li:last-child { border-bottom: 0; }
.check-list p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--ink-2); }
.docs-list { list-style: none; margin: 0; padding: 0; }
.docs-list li { display: flex; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.docs-list li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }  /* 체크할 수 없는 목록이라 체크박스 모양을 쓰지 않음 */
.refs-list { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.refs-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.refs-list li:last-child { border-bottom: 0; }
.refs-list li p { margin-top: 2px; }
/* 법령·판례 원문: 서식 사본처럼 옅은 바탕의 상자에 그대로 싣는다 */
.ref-text summary { cursor: pointer; color: var(--route-deep); font-size: var(--fs-sm); padding: 6px 0 0; display: inline-block; }
.ref-text[open] summary { margin-bottom: 8px; }
.ref-doc { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk); font-size: var(--fs-base); line-height: 1.75; color: var(--ink); }
.refs-list .ref-doc p { margin: 0; }
.ref-doc h3 { font-size: var(--fs-sm); margin: 14px 0 4px; }
.ref-body { white-space: pre-line; overflow-wrap: anywhere; }
.ref-article + .ref-article { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ref-article strong { display: block; margin-bottom: 2px; }
.refs-list .ref-doc .ref-source { margin-bottom: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
.refs-list .ref-doc .ref-body + .ref-source { margin: 14px 0 0; }
.refs-list .ref-doc .ref-source + .ref-source { margin: 4px 0 0; }
.ref-doc > h3:first-child { margin-top: 0; }
.ref-id { display: inline-block; min-width: 28px; padding: 0 6px; margin-right: 6px; border: 1px solid var(--line-strong); border-radius: 3px; color: var(--ink-2); font-size: var(--fs-xs); font-weight: 700; text-align: center; font-family: var(--num); }
.tag.ref-kind.law { border-color: var(--route-line); background: var(--route-tint); color: var(--route-deep); }
.tag.ref-kind.precedent { border-color: var(--amber-line); background: var(--amber-tint); color: var(--amber); }
.plan-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 18px; border-top: 1px solid var(--line-strong); margin-bottom: 24px; }

/* ---------- 대화상자·처리 중·저장 알림 ---------- */
.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(22, 36, 58, 0); transition: background-color 0.2s ease; }
.modal.is-open { background: rgba(22, 36, 58, 0.5); }
.modal-box {
  background: var(--paper); border-radius: var(--r); padding: clamp(20px, 4vw, 30px);
  width: min(640px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 24px 60px rgba(22, 36, 58, 0.3);
  opacity: 0; transform: translateY(8px); transition: opacity 0.2s ease, transform 0.25s ease;
}
.modal.is-open .modal-box { opacity: 1; transform: none; }
#modal-body { display: flex; flex-direction: column; gap: 12px; }
#modal-body h2 { margin: 0; font-size: var(--fs-lg); }
#modal-body p { margin: 0; }
.modal-box pre { margin: 0; max-height: 240px; overflow: auto; white-space: pre-wrap; font-family: inherit; font-size: var(--fs-sm); background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; }
.modal-box .actions { margin: 6px 0 0; }

.busy { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(22, 36, 58, 0); transition: background-color 0.2s ease; }
.busy.is-open { background: rgba(22, 36, 58, 0.4); }
.busy-box {
  background: var(--paper); border-radius: var(--r); padding: 28px 32px; max-width: 420px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px; outline: none;
  opacity: 0; transition: opacity 0.2s ease;
}
.busy.is-open .busy-box { opacity: 1; }
.busy-box p { margin: 0; color: var(--ink-2); }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--route-idle); border-top-color: var(--route); animation: spin 0.9s linear infinite; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 45; display: inline-flex; align-items: center; gap: 10px;
  max-width: calc(100% - 32px); padding: 12px 18px 12px 14px; border-radius: var(--r);
  background: var(--ink); color: #fff; font-size: var(--fs-base); font-weight: 600;
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity 0.2s ease, transform 0.25s ease;
}
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.toast-ico { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ok); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.toast-error .toast-ico { background: var(--seal); }

/* ---------- 하단 ---------- */
.footer { border-top: 1px solid var(--line); background: var(--paper); }
.footer-inner { max-width: 1440px; margin: 0 auto; padding: 22px clamp(16px, 3vw, 28px) 30px; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-xs); color: var(--ink-2); }
.footer p { margin: 0; max-width: 72em; }
.footer .btn-text { font-size: var(--fs-xs); padding: 0; min-height: 0; }

.card-head + .add-panel, .card-head ~ .callout, .card-head ~ .doc-list { margin-top: 16px; }

/* ---- 보조 클래스: 보안 정책(CSP)상 인라인 style 속성을 쓸 수 없어 클래스로 옮김 ---- */
.u-m-0 { margin: 0 !important; }
.u-mt-8 { margin-top: 8px !important; }
.u-mt-12 { margin-top: 12px !important; }
.u-mt-16 { margin-top: 16px !important; }
.u-mt-28 { margin-top: 28px !important; }
.u-mb-0 { margin-bottom: 0 !important; }
.u-mb-12 { margin-bottom: 12px !important; }
.u-mb-16 { margin-bottom: 16px !important; }
.u-mr-6 { margin-right: 6px !important; }
.u-p-0 { padding: 0 !important; }
.u-fs-15 { font-size: var(--fs-base) !important; }
.u-fs-17 { font-size: var(--fs-md) !important; }
.u-fw-500 { font-weight: 500 !important; }
.u-h-160 { height: 160px; }
.u-h-220 { height: 220px; }
.u-stack-8 { display: flex; flex-direction: column; gap: 8px; }
.u-stack-12 { display: flex; flex-direction: column; gap: 12px; }
.masked-count { color: var(--route-deep); font-weight: 700; }

/* ---------- 교차 검토 ---------- */
.mode-cross { border-color: var(--route); }
.cross-card { border-color: var(--route-line); }
.cross-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cross-head h2 { margin: 0; }
.cross-flow { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.cross-flow li + li::before { content: "›"; margin: 0 10px; color: var(--muted); }
.cross-flow .blue strong { color: var(--route-deep); }
.cross-flow .red strong { color: var(--seal-deep); }
.cross-flow .merge strong { color: var(--ok); }
.cross-overall { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk); }
.cross-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.cross-col { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; }
.cross-col.ok { border-color: var(--green-line); }
.cross-col.need { border-color: var(--amber-line); background: var(--amber-tint); }
.cross-col h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: var(--fs-base); }
.cross-col .count { font-size: var(--fs-xs); padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 3px; font-family: var(--num); }
.cross-col ul { list-style: none; margin: 0; padding: 0; }
.cross-col li { padding: 8px 0; border-top: 1px solid var(--line); }
.cross-col li:first-child { border-top: 0; }
.cross-col .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.cross-col .lbl { color: var(--ink-2); }
.cross-col .meta { display: flex; gap: 6px; align-items: baseline; margin: 4px 0 0; font-size: var(--fs-xs); color: var(--muted); }
.cross-col .meta .tag { flex: none; }

/* ---------- 휴대폰 알림 ---------- */
.notify-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.switch { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 700; }
.switch input { width: 20px; height: 20px; accent-color: var(--route); }
.notify-terms { margin: 4px 0 10px; padding-left: 18px; color: var(--ink-2); }
.notify-terms li { margin: 2px 0; }
.notify-code { margin-top: 12px; }
.notify-code input { max-width: 160px; letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }
.notify-msg { margin: 10px 0 0; }
.notify-msg.error { color: var(--seal-deep); }
.notify-msg.ok { color: var(--ok); }
/* 휴대폰 인증·아이디/비밀번호 찾기·내 정보(추가개발 6·7) */
.phone-verify .notify-msg { margin-top: 6px; }
.phone-verify input[readonly] { background: var(--sunk); color: var(--ink-2); }
.auth-find { display: flex; justify-content: center; gap: 20px; margin: 14px 0 0; font-size: var(--fs-sm); }
.recover-result { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.recover-result p { margin: 0; }
.id-list { list-style: none; margin: 0; padding: 0; }
.id-list li { font-size: var(--fs-lg); color: var(--ink); }
.id-list li + li { margin-top: 4px; }
.account-form { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.notify-history { list-style: none; margin: 8px 0 0; padding: 0; }
.notify-history li { padding: 8px 0; border-top: 1px solid var(--line); }
.notify-lead { margin-top: 0; }

/* ===================== 진행 현황: 왼쪽 사건 정보 + 오른쪽 대화 ===================== */
.layout.single.journey-mode { max-width: 1440px; padding: 16px clamp(12px, 2vw, 24px) 24px; }
.journey-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
.journey-grid.collapsed { grid-template-columns: minmax(0, 1fr); }
.journey-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.journey-side > .card { margin: 0; padding: 18px 20px; }
.journey-side > .card > h2:first-child { font-size: var(--fs-md); padding-bottom: 8px; margin-bottom: 12px; }
.journey-side .demo-strip { margin: 0; }
.journey-main { position: relative; min-width: 0; }

/* 사건 이름(다른 사건으로 바꾸기) */
.case-switch { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.case-switch-mark { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 5px solid var(--route); }
.case-switch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.case-switch-text h1 { margin: 0; font-size: var(--fs-lg); letter-spacing: -0.02em; }
.case-switch-text span { font-size: var(--fs-xs); color: var(--muted); }

/* 계약 정보 */
.contract { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 6px 12px; margin: 0; align-items: baseline; }
.contract dt { color: var(--muted); font-size: var(--fs-sm); }
.contract dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.contract-money { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.contract-money span { color: var(--muted); font-size: var(--fs-sm); }
.contract-money strong { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.dday { display: inline-block; padding: 0 8px; border: 2px solid var(--ink-2); border-radius: var(--r-sm); color: var(--ink-2); font-weight: 800; font-size: var(--fs-base); font-family: var(--num); }
.dday.soon { border-color: var(--seal); color: var(--seal); }
.contract-more { margin-top: 12px; }
.contract-more > summary { cursor: pointer; color: var(--route-deep); font-weight: 700; font-size: var(--fs-base); padding: 4px 0; }
.contract-more-body { padding-top: 10px; }

/* 지금 할 일: 맨 앞 하나를 크게 */
.todo-card.urgent { border-color: var(--seal-line); }
.todo-main { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.todo-main-title { margin: 0; font-size: var(--fs-md); font-weight: 800; line-height: 1.45; }
.todo-card.urgent .todo-main-title { color: var(--seal-deep); }
.todo-main-detail { margin: 0; font-size: var(--fs-base); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.todo-cta { margin-top: 6px; min-height: 46px; }
.todo-rest { margin-top: 16px; }
.todo-rest h3 { font-size: var(--fs-sm); color: var(--muted); font-weight: 700; margin: 0 0 4px; }
.todo-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.todo { border-bottom: 1px solid var(--line); }
.todo-btn { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 11px 2px; border: 0; background: none; text-align: left; cursor: pointer; font-size: var(--fs-base); color: var(--ink); }
.todo-btn:hover { background: var(--sunk); }
.todo-mark { flex: none; width: 18px; height: 18px; margin-top: 3px; border: 2px solid var(--line-strong); border-radius: 3px; }
.todo.urgent .todo-mark { border-color: var(--seal); background: var(--seal-tint); }
.todo-text { flex: 1; line-height: 1.5; }
.chev-r { color: var(--muted); font-size: 20px; line-height: 1.2; }

/* 진행 현황: 세로 노선 — 정거장, 이름, 오른쪽에 상태 */
.stage-strip { list-style: none; margin: 0; padding: 0; }
.stage { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 0 0 14px; min-width: 0; }
.stage:last-child { padding-bottom: 0; }
.stage::before { content: ""; position: absolute; z-index: 0; left: 15px; top: 0; bottom: 0; width: 6px; background: var(--route-idle); }
.stage:first-child::before { top: 18px; }
.stage:last-child::before { bottom: auto; height: 18px; }
.stage:only-child::before { display: none; }
.stage.done::before { background: var(--green); }
.stage.active::before, .stage.attention::before { background: linear-gradient(180deg, var(--green) 0 18px, var(--route-idle) 18px); }
.stage:first-child.active::before, .stage:first-child.attention::before { background: var(--route-idle); }
.stage.enter::before { transform-origin: top; animation: layY 0.4s ease both; animation-delay: calc(var(--i, 0) * 0.12s); }
.stage-ring, .stage-status { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; background: var(--paper); }
.stage-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; min-height: 36px; min-width: 0; }
.stage-body strong { font-size: var(--fs-base); line-height: 1.35; }
.stage-label {
  grid-column: 2; grid-row: 1; justify-self: end; padding: 1px 8px; border: 1px solid var(--line-strong); border-radius: 3px;
  font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); line-height: 1.6; text-align: center; max-width: 150px;
}
.stage-next, .stage-needs { grid-column: 1 / -1; }
.stage-next { font-size: var(--fs-xs); color: var(--muted); }
.stage.done .stage-label { border-color: var(--green-line); background: var(--ok-tint); color: var(--ok); }
.stage.active .stage-label { border-color: var(--route-line); background: var(--route-tint); color: var(--route-deep); }
.stage.active .stage-body strong { color: var(--route-deep); }
.stage.attention .stage-label { border-color: var(--amber-line); background: var(--amber-tint); color: var(--amber); }
.stage.idle .stage-body strong, .stage.waiting .stage-body strong { color: var(--ink-2); font-weight: 600; }
.stage-needs {
  justify-self: start; margin-top: 2px; padding: 0; border: 0; background: none; color: var(--amber);
  font-size: var(--fs-xs); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.stage-needs:hover { color: var(--ink); }

.ring-seg { fill: none; stroke: var(--route-idle); stroke-width: 6; transition: stroke 0.3s ease; }
.ring-seg.filled { stroke: var(--green); }
.ring-seg.current { stroke: var(--route-line); }
.stage.attention .ring-seg.current { stroke: var(--amber-line); }
.ring-text { font-size: var(--fs-xs); font-weight: 800; fill: var(--ink); font-family: var(--num); }
.ring-check { fill: none; stroke: var(--green); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.ring-seg.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ringDraw 0.5s ease forwards; animation-delay: var(--d, 0ms); }
.ring-check.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ringDraw 0.35s ease forwards; animation-delay: var(--d, 0ms); }
.st-bg { fill: var(--paper); stroke: var(--route-idle); stroke-width: 3; }
.st-line { fill: none; stroke: currentColor; stroke-width: 2.5; }
.st-line.dashed { stroke-dasharray: 3 3.5; }
.st-fill { fill: currentColor; }
.st-mark { fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.st-dot { fill: currentColor; }
.stage-status { color: var(--muted); }
.stage-status.done { color: #fff; }
.stage-status.done .st-bg { fill: var(--green); stroke: var(--green); }
.stage-status.active { color: var(--route); }
.stage-status.active .st-bg { stroke: var(--route); }
.stage-status.attention { color: var(--amber); }
.stage-status.attention .st-bg { fill: var(--amber-tint); stroke: var(--amber-line); }
.stage-status.waiting { color: var(--ink-2); }

.side-links { display: flex; flex-wrap: wrap; gap: 2px 16px; padding: 2px 4px 8px; }

/* 왼쪽 접기 */
.side-toggle {
  position: absolute; z-index: 2; left: -17px; top: 50%; transform: translateY(-50%); width: 24px; height: 60px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--paper); color: var(--ink-2);
  font-size: var(--fs-lg); line-height: 1; cursor: pointer; padding: 0;
}
.side-toggle:hover { border-color: var(--ink); color: var(--ink); }
.collapsed .side-toggle { left: -12px; }

/* 대화 */
.chat-card { display: flex; flex-direction: column; margin: 0; padding: 0; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; font-size: var(--fs-lg); }
.chat-log { list-style: none; margin: 0; padding: 20px 88px 20px 20px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; flex: 1; }
.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg.me { justify-content: flex-end; padding-left: 72px; }
.msg-avatar { flex: none; width: 32px; height: 32px; margin-top: 4px; border-radius: 50%; border: 5px solid var(--route); background: var(--paper); font-size: 0; }
.msg-body { position: relative; max-width: min(100%, 640px); padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--paper); }
.msg.me .msg-body { background: var(--route-tint); border-color: var(--route-line); }
.msg-text { margin: 0; white-space: pre-wrap; line-height: 1.7; font-size: var(--fs-base); }
.msg-quote { margin: 0 0 6px; font-size: var(--fs-xs); color: var(--muted); }
/* 보낸 시각은 말풍선 바깥 아래쪽 */
.msg-time { position: absolute; bottom: 2px; white-space: nowrap; font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.msg.bot .msg-time { left: calc(100% + 10px); }
.msg.me .msg-time { right: calc(100% + 10px); }
.msg.question .msg-body { border-color: var(--route-line); }
.msg.question .q-title { font-weight: 800; font-size: var(--fs-md); }
.msg.update .msg-text { color: var(--ink-2); }
.msg.stale .msg-body, .msg.doc-check .msg-body { border-color: var(--amber-line); background: var(--amber-tint); }
.msg.doc-check textarea { width: 100%; margin: 10px 0 0; font-size: var(--fs-sm); }
.msg.new { animation: fade 0.25s ease both; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quick.secondary { margin-top: 8px; align-items: center; }
.btn-choice { min-height: 46px; padding: 8px 16px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font-weight: 600; cursor: pointer; text-align: left; white-space: normal; transition: border-color 0.15s ease, background-color 0.15s ease; }
.btn-choice:hover { border-color: var(--route); color: var(--route-deep); }
.btn-choice.ghost { border-style: dashed; color: var(--ink-2); }
.btn-choice.chosen { background: var(--route); border-color: var(--route); color: #fff; }
.q-form { margin-top: 12px; }
.q-how { margin: 8px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk); color: var(--ink-2); }

/* 입력창: 위는 글, 아래는 서류 첨부와 보내기 */
.composer {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 8px; margin: 0 20px 20px; padding: 8px 8px 8px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--paper);
}
.composer:focus-within { border-color: var(--route); box-shadow: 0 0 0 3px rgba(28, 117, 188, 0.25); }
.composer textarea { grid-column: 1 / -1; grid-row: 1; min-height: 48px; max-height: 160px; border: 0; box-shadow: none; resize: none; padding: 8px 2px; }
.composer textarea:focus { box-shadow: none; }
.composer-attach { grid-column: 1; grid-row: 2; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk); color: var(--ink-2); font-weight: 600; cursor: pointer; }
.composer-send { grid-column: 3; grid-row: 2; min-height: 40px; padding: 0 20px; border: 0; border-radius: var(--r-sm); background: var(--route); color: #fff; font-weight: 700; cursor: pointer; }
.composer-send:hover:not(:disabled) { background: var(--route-deep); }
.composer-send:disabled, .composer-attach:disabled { opacity: 0.5; cursor: default; }
.warn-ink { color: var(--amber); font-weight: 700; }
.notice-legal { color: var(--ink-2); }

.basics { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 0 0 16px; align-items: center; border-top: 1px solid var(--line); }
.basics dt, .basics dd { padding: 7px 0; border-bottom: 1px solid var(--line); min-height: 42px; }
.basics dt { color: var(--muted); font-size: var(--fs-sm); padding-right: 14px; display: flex; align-items: center; }
.basics dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.basic-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.basic-edit { flex-wrap: wrap; gap: 6px; width: 100%; }
.basic-edit input, .basic-edit textarea { flex: 1 1 140px; min-height: 40px; }
.docs-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 6px; }
.docs-head h3 { margin: 0; font-size: var(--fs-base); }
.docs-box { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.doc-item { padding: 10px 2px; border-bottom: 1px solid var(--line); }
.doc-item-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.doc-item-actions { display: flex; gap: 12px; margin-top: 4px; }
.docs-keep { margin: 10px 0 0; }
.doc-first { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--route-line); border-radius: var(--r-sm); background: var(--route-tint); color: var(--route-deep); }
.doc-first .quick { margin-top: 8px; }
.date-input { letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }

/* 넓은 화면: 대화는 화면 높이에 맞추고 안에서만 스크롤, 왼쪽은 따로 스크롤 */
@media (min-width: 1001px) {
  .journey-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding-right: 4px; }
  .chat-card { height: calc(100vh - 100px); min-height: 560px; }
}
@media (max-width: 1000px) {
  .journey-grid, .journey-grid.collapsed { grid-template-columns: minmax(0, 1fr); }
  .journey-side[hidden] { display: flex !important; }
  .side-toggle { display: none; }
  .chat-log { padding: 16px; }
  .msg.me { padding-left: 24px; }
  .msg-time { position: static; display: block; margin-top: 4px; }
  .composer { margin: 0 12px 12px; }
}
.journey-head + .error-card, .error-card + .stage-strip { margin-top: 12px; }

/* ---------- 마무리 보정 ---------- */
html { background: var(--paper); }
/* 칸 제목 괘선 바로 아래 목록 괘선이 겹치지 않게 */
.card > h2:first-child + .todo-list,
.card > h2:first-child + .basics { border-top: 0; }
/* 질문 칸: 제목 → 진행 막대 → 첫 질문 사이 줄을 하나로 */
.card > .card-head:first-child:has(+ .progress) { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
@media (max-width: 600px) {
  .brand-text span { display: none; }
  .topbar-actions { gap: 6px 10px; }
  .user { display: none; }
}
.card > .card-head:first-child ~ .doc-list { border-top: 0; }
@media (max-width: 760px) {
  /* 접힌 메뉴에 여백·괘선이 남지 않게 */
  .menu-body-inner { padding: 0; border-top: 0; }
  .case-nav.open .menu-body-inner { padding: 6px 0 10px; border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  /* 좁은 화면: 항목명 위, 값 아래(날짜가 중간에서 끊기지 않게) */
  .lines, .facts-dl { grid-template-columns: minmax(0, 1fr); }
  .lines dt, .facts-dl dt { padding: 8px 0 0; border-bottom: 0; }
  .lines dd, .facts-dl dd { padding: 0 0 8px; }
}

/* ---------- 캐릭터 허부기 ---------- */
.hugi { display: block; height: auto; user-select: none; -webkit-user-drag: none; }
/* 대화 얼굴: 흰 원 안에 머리 */
.msg-avatar { flex: none; width: 44px; height: 44px; margin-top: 2px; border: 2px solid var(--route-line); border-radius: 50%; background: var(--route-tint); overflow: hidden; }
.msg-avatar .hugi { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
/* 처음 대화: 인사하는 허부기 */
.chat-hello { display: flex; justify-content: flex-start; padding-left: 4px; }
.chat-hello .hugi { width: 96px; }
/* 첫 화면: 노선도 카드 위로 고개를 내민 허부기 */
/* 할 일이 없을 때·사건이 없을 때 */
.todo-none { display: flex; align-items: center; gap: 12px; }
.todo-none .hugi { width: 64px; }
.ledger-empty { display: flex; align-items: center; gap: 14px; }
.ledger-empty .hugi { width: 72px; }
/* 처리 중 */
.busy-hugi { width: 84px; }

/* ---------- 공사 색: 상단 막대는 Hug blue ---------- */
.topbar { background: var(--route); border-bottom: 0; }
.topbar .brand-text strong { color: #fff; }
.topbar .brand-text span { color: #d6e9f7; }
a.brand:hover strong { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.brand-mark::before { background: #fff; }
.brand-mark::after { background: var(--route); border-color: var(--green); }
.topbar .user { color: #e8f3fb; }
.topbar .ai-badge { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.topbar .ai-badge:hover { background: rgba(255, 255, 255, 0.2); }
.topbar .ai-badge::before { background: var(--green); }
.topbar .ai-badge.off::before { background: #d6e9f7; }
.topbar #btn-cases.btn { background: #fff; border-color: #fff; color: var(--route-deep); }
.topbar #btn-cases.btn:hover { background: #e6f1fa; }
.topbar .btn-text.quiet { color: #fff; }
.topbar :focus-visible { outline-color: #fff; }
/* 하단 */
.footer { background: #d3e7f4; border-top: 0; }
/* 노선: 지나온 길은 Hug green, 앞으로 갈 길은 sky blue 옅게 */
.route-list li:not(:last-child)::after { background: var(--sky); }
.route-list li::before { border-color: var(--sky); color: var(--route-deep); }
.case-switch-mark { border-color: var(--sky); }
.msg-avatar { border-color: var(--sky); }
.progress > span { background: var(--sky); }
.ring-seg.current { stroke: var(--sky); }
.stage-status.active { color: var(--sky); }
.stage-status.active .st-bg { stroke: var(--sky); }

/* ---------- 녹색 늘리기(공사 CI: 파랑+녹색) ---------- */
.topbar { box-shadow: inset 0 -5px 0 var(--green); }
.footer { box-shadow: inset 0 4px 0 var(--green); }
/* 카드 제목 밑줄 앞부분을 녹색으로 */
.card > h2:first-child, .card > .card-head:first-child, .landing-route h2 { position: relative; }
.card > h2:first-child::after, .card > .card-head:first-child::after, .landing-route h2::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 44px; height: 3px; background: var(--green);
}
.ledger-card > .card-head:first-child::after, .chat-head h2::after { display: none; }
.chat-head { box-shadow: inset 0 -3px 0 var(--green-line); }
/* 녹색 버튼: 바로 하는 일(지금 할 일 바로가기) — 글자는 짙은 남색(대비 확보) */
.btn-green, .todo-cta { background: var(--green); border-color: var(--green); color: var(--ink); font-weight: 800; }
.btn-green:hover:not(:disabled), .todo-cta:hover:not(:disabled) { background: #6fb033; border-color: #6fb033; color: var(--ink); }
/* 내가 보낸 말풍선·고른 답 */
.msg.me .msg-body { background: #e3f2d6; border-color: var(--green-line); }
.btn-choice.chosen { background: var(--green); border-color: var(--green); color: var(--ink); }
.pill input:checked + span { border-color: #5a9a2a; background: var(--ok-tint); color: var(--ok); }
.pill input:checked + span::before { border-color: #5a9a2a; background: #5a9a2a; }
/* 보증금 금액 */
.contract-money strong { color: var(--ok); }
/* 허부기 얼굴·사건 표시 */
.msg-avatar { border-color: var(--green); background: #eef7e6; }
.case-switch-mark { border-color: var(--green); }
.chat-hello .hugi { filter: none; }
/* 진행률 막대: 채워진 만큼 녹색 */
.progress > span { background: var(--green); }

/* ---------- 첫 화면 v2: 큰 허부기 + 가로 노선 ---------- */
.landing { display: block; }
.landing-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 24px; align-items: center; }
.landing-copy { padding: 0; }
.landing-figure { display: flex; justify-content: center; align-items: flex-end; padding-bottom: 20px; }
.landing-hugi { width: min(100%, 420px); height: auto; }
.landing-hugi.fallback { width: min(70%, 260px); }
.landing-route { position: relative; z-index: 1; padding: 30px 32px 26px; }
.landing-route h2 { padding-right: 0; }
/* 넓은 화면: 정거장을 가로로 잇는다 */
@media (min-width: 861px) {
  .route-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
  .route-list li { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 0 16px 0 0; }
  .route-list li::before { width: 40px; height: 40px; font-size: var(--fs-base); }
  .route-list li:not(:last-child)::after {
    left: 38px; right: 0; top: 17px; bottom: auto; width: auto; height: 6px;
    transform-origin: left; animation-name: lay;
  }
  .route-list strong { margin-top: 0; }
}
@media (max-width: 860px) {
  .landing-hero { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .landing-copy { padding-bottom: 8px; }
  .landing-figure { order: -1; margin-bottom: 0; }
  .landing-hugi { width: min(72%, 300px); }
  .landing-route { margin-top: 20px; }
}
/* 첫 화면 등장: 위치는 그대로 두고 투명도만 바꾼다(떠오르는 움직임 없음).
   제목 → 설명 → 버튼, 허부기는 그사이 천천히, 마지막에 노선이 정거장 순서대로.
   '움직임 줄이기' 설정이면 맨 위 규칙에 따라 바로 다 보인다. */
.landing-title, .landing-sub, .landing-actions, .landing-figure, .landing-route, .route-list li {
  animation: fade 0.7s ease-out both;
}
.landing-title { animation-delay: 0.1s; }
.landing-sub { animation-delay: 0.3s; }
.landing-actions { animation-delay: 0.5s; }
.landing-figure { animation-duration: 1s; animation-delay: 0.3s; }
.landing-route { animation-duration: 0.6s; animation-delay: 0.7s; }
.route-list li { animation-duration: 0.5s; animation-delay: calc(var(--i, 0) * 0.12s + 0.85s); }
/* 정거장 사이 선은 그 정거장이 보인 뒤에 그려지게 늦춘다 */
.landing .route-list li:not(:last-child)::after { animation-delay: calc(var(--i, 0) * 0.12s + 1s); }

/* ---------- 상태 표시는 '스티커'가 아니라 글자로 ----------
   테두리·바탕을 두른 작은 배지를 쓰지 않는다. 서식에 적듯 색 글씨로만 적는다. */
.tag, .tag.ok, .tag.document, .tag.warn, .tag.conflict, .tag.bad, .tag.info, .tag.statement, .tag.unknown, .tag.unsure, .tag.solid,
.tag.ref-kind.law, .tag.ref-kind.precedent {
  display: inline; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  font-size: var(--fs-xs); font-weight: 700; line-height: inherit; white-space: nowrap; color: var(--muted);
}
.tag.ok, .tag.document { color: var(--ok); }
.tag.warn, .tag.conflict, .tag.ref-kind.precedent { color: var(--amber); }
.tag.bad { color: var(--seal-deep); }
.tag.info, .tag.solid, .tag.ref-kind.law { color: var(--route-deep); }
.tag.statement, .tag.unknown, .tag.unsure { color: var(--muted); font-weight: 600; }

/* 기본정보 표: 항목 | 값과 출처 | 수정 — 줄이 어긋나지 않게 칸 높이를 맞춘다 */
.basics { align-items: stretch; }
.basics dt { align-items: center; }
.basics dd { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
.basics dd > form { grid-column: 1 / -1; }
.basics dd .tag { font-size: var(--fs-xs); }
.basics dd .btn-text { justify-self: end; min-height: 32px; }
.basics-hint { margin: 0 0 10px; }

/* 진행 현황 상태: 칩 대신 오른쪽 정렬 글자 */
.stage-label, .stage.done .stage-label, .stage.active .stage-label, .stage.attention .stage-label {
  padding: 0; border: 0; background: none; border-radius: 0; font-size: var(--fs-xs); max-width: 140px; text-align: right; line-height: 1.4;
}

/* 날짜·숫자 표시도 테두리 없이 */
.dday, .dday.soon { padding: 0; border: 0; border-radius: 0; font-size: var(--fs-base); }
.ref-id { padding: 0; border: 0; min-width: 0; color: var(--muted); }
.ref-id::before { content: "["; } .ref-id::after { content: "]"; }
.cross-col .count { padding: 0; border: 0; color: var(--muted); }

/* 이사 전 경고: 기울어진 도장 대신 빨간 제목만 */
.plan-section.before_move > h2:first-child::before { content: none; }
.plan-section.before_move > h2:first-child::after { background: var(--seal); }

/* ---------- 회색 설명 문구 줄이기: 필요한 정보는 본문 색으로 ---------- */
.msg-conflict { margin: 0 0 8px; font-size: var(--fs-base); font-weight: 700; color: var(--amber); }
.todo-rest h3 { color: var(--ink-2); }
.doc-item-main .muted, .doc-item-main .small { color: var(--ink-2); }
.case-meta, .ledger-meta dt { color: var(--ink-2); }

/* 이어서 할 일: 체크칸(누르면 완료되는 것처럼 보임) 대신 급한 순서 번호 — 노선 정거장과 같은 모양 */
.todo-num {
  flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--sky);
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; font-family: var(--num); color: var(--route-deep);
}
.todo.urgent .todo-num { border-color: var(--seal); background: var(--seal); color: #fff; }

/* 휴대폰: 한 줄로 쌓이는 카드끼리 제목 크기를 맞춘다(옆 칸 카드 17px · 본문 카드 20px가 섞여 보이던 문제) */
@media (max-width: 760px) {
  .card > h2:first-child, .card > .card-head:first-child h2, .chat-head h2, .landing-route h2 { font-size: var(--fs-md); }
}

/* ---------- 서류 핵심 항목 확인(항목마다 값 + 원문 문구) ---------- */
.ditems { margin-top: 10px; }
.ditem-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ditem { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); }
.ditem.confirmed { border-color: var(--green-line); }
.ditem.rejected { background: var(--sunk); }
.ditem-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ditem-label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
.ditem-value { margin: 2px 0 0; font-size: var(--fs-md); font-weight: 800; font-family: var(--num); font-variant-numeric: tabular-nums; color: var(--ink); }
.ditem-value.struck { text-decoration: line-through; color: var(--muted); }
.ditem-note { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--ink-2); }
/* 원문 문구: 사방 같은 굵기의 얇은 테두리(한쪽 색 막대 없음) */
.ditem-quote { margin: 8px 0 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk);
  font-size: var(--fs-sm); line-height: 1.6; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.ditem-quote::before { content: "“"; }
.ditem-quote::after { content: "”"; }
.ditem-warn { margin: 6px 0 0; font-size: var(--fs-sm); font-weight: 600; color: var(--amber); }
.ditem-actions { margin-top: 10px; }
.ditem-edit { margin-top: 10px; }
.ditem-edit select { min-width: 200px; }
.ditem-full { margin-top: 12px; font-size: var(--fs-sm); }
.ditem-full summary { cursor: pointer; color: var(--route-deep); font-weight: 600; }
.ditem-full textarea { width: 100%; margin-top: 8px; font-size: var(--fs-sm); }
.msg.doc-check .ditem { background: var(--paper); }
.doc-item-items { margin-top: 8px; font-size: var(--fs-sm); }
.doc-item-items summary { cursor: pointer; color: var(--route-deep); font-weight: 600; }

/* 서류끼리 다른 값: 서류별로 나란히(휴대폰은 위아래) */
.side-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.side { padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--paper); display: flex; flex-direction: column; }
.side-title { margin: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
.side-value { margin: 2px 0 0; font-size: var(--fs-md); font-weight: 800; font-family: var(--num); }
.side .btn { margin-top: 10px; align-self: flex-start; }

/* '지금 할 일' 안내 팝업 */
.guide-block + .guide-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.guide-block h3 { margin: 0 0 6px; font-size: var(--fs-base); }
.guide-block p { margin: 0; font-size: var(--fs-sm); line-height: 1.7; }
.guide-docs-h { margin-top: 10px !important; font-weight: 700; }

/* ---------- 그라데이션 v5 (2026-11-09 사용자 요청): 색 구분 요소에만 공사 색 그라데이션 ----------
   카드 바탕·본문 글자는 단색 유지(가독성). 흰 글자 위 그라데이션은 Hug blue 진하게→Hug blue 범위로만(대비 4.5:1 이상). */
:root {
  --grad-blue: linear-gradient(100deg, #155c94 0%, #1c75bc 55%, #0a8fcf 100%);   /* 상단 막대 */
  --grad-btn: linear-gradient(100deg, #155c94 0%, #1c75bc 100%);                 /* 흰 글자 버튼 */
  --grad-btn-hover: linear-gradient(100deg, #124f80 0%, #155c94 100%);
  --grad-green: linear-gradient(90deg, #80c342 0%, #4fb28a 55%, #009edb 100%);  /* 녹색→하늘색 띠 */
  --grad-green-btn: linear-gradient(100deg, #93cf55 0%, #80c342 50%, #6fb033 100%);
  --grad-green-btn-hover: linear-gradient(100deg, #80c342 0%, #6fb033 100%);
}
.topbar { position: relative; background: var(--grad-blue); box-shadow: none; }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--grad-green); pointer-events: none; }
.footer { position: relative; box-shadow: none; }
.footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--grad-green); }
.card > h2:first-child::after, .card > .card-head:first-child::after, .landing-route h2::after { width: 64px; background: var(--grad-green); }
.chat-head { box-shadow: none; position: relative; }
.chat-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--grad-green); opacity: 0.45; }
.btn-primary, .composer-send { background: var(--grad-btn); border-color: transparent; }
.btn-primary:hover:not(:disabled), .composer-send:hover:not(:disabled) { background: var(--grad-btn-hover); }
.btn-green, .todo-cta { background: var(--grad-green-btn); border-color: transparent; }
.btn-green:hover:not(:disabled), .todo-cta:hover:not(:disabled) { background: var(--grad-green-btn-hover); border-color: transparent; }
.progress > span { background: var(--grad-green); }
.route-list li:not(:last-child)::after { background: linear-gradient(180deg, var(--sky), var(--green)); }
@media (min-width: 861px) {  /* 가로 노선은 왼쪽→오른쪽으로 */
  .route-list li:not(:last-child)::after { background: linear-gradient(90deg, var(--sky), var(--green)); }
}

/* ---------- 로고: 허부기 얼굴(공식 캐릭터 원본) + 서비스 이름 (2026-11-09) ---------- */
.brand-mark, .topbar .brand-mark {
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%;
  background: #fff; border: 3px solid var(--green); overflow: hidden; font-size: 0;
}
.brand-mark::before, .brand-mark::after, .topbar .brand-mark::before, .topbar .brand-mark::after { content: none; display: none; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) { .brand-mark, .topbar .brand-mark { width: 36px; height: 36px; border-width: 2px; } }

/* 기본정보 표: 값이 길면(예: '확정일자를 받지 않았어요') 값 칸에서 줄을 바꾸고, 출처·수정 칸은 겹치지 않게 고정 */
.basics dd { grid-template-columns: minmax(0, 1fr) auto auto; }
.basics dd .basic-val { overflow-wrap: anywhere; }
.basics dd .tag { white-space: nowrap; }

/* ---------- 로그인·회원가입 카드 (2026-11-09: 가운데 카드 하나, 이메일 → 또는 → 소셜 로그인) ---------- */
.auth-card { max-width: 440px; margin: 0 auto; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); }
.auth-card .auth-panel { padding: 32px clamp(20px, 6vw, 36px) 28px; gap: 16px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 4px; text-align: center; }
.auth-logo { width: 60px; height: 60px; border-radius: 50%; border: 3px solid var(--green); background: #fff; overflow: hidden; }
.auth-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.auth-service { margin: 4px 0 0; font-size: var(--fs-md); font-weight: 800; letter-spacing: -0.02em; color: var(--route-deep); }
.auth-title { margin: 0; font-size: var(--fs-lg); font-weight: 800; color: var(--ink); }
.auth-lead { margin: 0; text-align: center; font-size: var(--fs-sm); color: var(--ink-2); }
.remember-row { margin-top: -4px; font-size: var(--fs-sm); }
.or-line { display: flex; align-items: center; gap: 12px; margin: 2px 0; font-size: var(--fs-sm); color: var(--ink-2); }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.social-row { display: flex; justify-content: center; gap: 18px; }
.social-btn { width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; cursor: pointer; padding: 0; transition: transform 0.12s ease, filter 0.12s ease; }
.social-btn svg { width: 24px; height: 24px; }
.social-btn.google { background: #fff; border-color: var(--line-strong); }
.social-btn.kakao { background: #FEE500; }
.social-btn.naver { background: #03C75A; }
.social-btn.naver svg { width: 20px; height: 20px; }
.social-btn:hover:not(:disabled) { filter: brightness(0.96); }
.social-btn:disabled { cursor: not-allowed; opacity: 0.4; }
.auth-switch { margin: 0; text-align: center; font-size: var(--fs-sm); color: var(--ink); }
.auth-switch .btn-text { font-size: var(--fs-sm); font-weight: 700; }
.auth-below { max-width: 440px; margin: 14px auto 0; text-align: center; font-size: var(--fs-sm); color: var(--ink-2); }
.auth-below .btn-text { font-size: var(--fs-sm); }
.email-verify .inline-form input[type="email"] { flex: 1 1 200px; min-width: 0; }
@media (max-width: 480px) { .auth-card { border-radius: 10px; } .social-row { gap: 14px; } }
.remember-row { background: none; border: 0; padding: 0; min-height: 0; }

/* 누를 수 없는 확인 목록: 체크 칸 모양이 아니라 점 목록(기능과 맞는 모양) */
.plain-list { margin: 6px 0 12px; padding-left: 1.2em; font-size: var(--fs-sm); line-height: 1.8; }
.plain-list li { list-style: disc; }
.evidence-status { margin: 0 0 6px; font-size: var(--fs-sm); }
.evidence-status strong { color: var(--amber); }

/* E02 통지문·미리보기 */
.notice-text { margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sunk);
  white-space: pre-wrap; font-family: var(--sans); font-size: var(--fs-sm); line-height: 1.8; color: var(--ink); }
.notice-sent { display: grid; gap: 10px; margin: 8px 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.preview-list { list-style: none; margin: 0; padding: 0; }
.preview-list li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.preview-list summary { cursor: pointer; }
.preview-list p { margin: 6px 0 0; }

/* 3단계: 할 일 패널 아래 '새 안내 등록' 입구 */
.todo-request { display: block; margin-top: 12px; font-size: var(--fs-sm); }
/* 4단계: 피해지원 제안(거절하면 다시 보이지 않음) */
.support-offer { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; }
.support-offer p { margin: 0 0 8px; font-size: var(--fs-sm); }
.support-offer .actions { margin: 0; justify-content: flex-start; }
