/* 집장부 — 시안 C "벤토 살림": 밝고 둥근 타일 · 신뢰의 틸 · 따뜻한 모래색

   토큰은 세 층이다. 컴포넌트는 ②·③만 쓰고, 원색 hex는 이 블록(과 지도 색 램프)에만 둔다.
   ① 면·글자·선: --bg --tile(-2,-3) --ink(-2,-3) --line(-2)
   ② 역할: 강조(--accent*) · 판정(--ok-* --bad* --warn*) · 가격 방향(--up --down) · 계열(--series-*) · 기준선(--ref) · 관심(--fav)
      "살 수 있다/없다"는 판정색이 맡고, 가격이 오르내린 건 차분한 --up/--down이 맡는다.
      *-text는 글자용(AA 4.5:1 이상), 이름만 있는 값은 막대·점·띠 같은 채움용이다.
   ③ 스케일: 글자(--fs-*) · 굵기(--fw-*) · 간격(--s-*) · 둥글기(--r-*) · 높이(--shadow-*) · 쌓임(--z-*) · 시간(--t-*) */
:root {
  color-scheme: light;
  --bg: #f6f2ea; --tile: #fffdf9; --tile-2: #f1ece2; --tile-3: #e9e2d5;
  --ink: #1f2a2a; --ink-2: #4b5757; --ink-3: #5f6a68;
  --line: #e6dfd1; --line-2: #d6ccba;
  /* 조작 요소의 경계(입력칸 테두리·꺼진 토글·체크 상자) — 타일·바탕·파인 면 모두에서 3:1 이상 (WCAG 1.4.11). 나누는 선은 --line*이 맡는다 */
  --control-line: #8c8474;

  --accent: #0f766e; --accent-2: #14b8a6; --accent-soft: #d6efe9; --on-accent: #fff; --on-accent-2: #06302c; --accent-inverse: #5ee6d2;
  --ok-2: #14b8a6; --ok-soft: #d6efe9; --ok-text: #0f766e;
  --bad: #d9573f; --bad-soft: #fbe3dc; --bad-text: #b23a24;
  --warn: #c98a1c; --warn-soft: #f6e7c8; --warn-text: #8a5a00;
  --up: #a8435a; --down: #2b67a6;
  --series-59: #3b82c4; --series-74: #8b6cc2; --series-84: #3f5250;
  --ref: #a8641a; /* 기준선 — KB시세 (차트 점선·띠, 가격 비교 표시) */
  --fav: #c98a1c; --fav-on-accent: #ffe08a;
  --flash: #14b8a633;
  /* 키보드 포커스 링 — 타일·바탕·파인 면에서 3:1 이상. 어두운 면(토스트)과 히어로 위에서는 따로 */
  --focus: var(--accent); --focus-inverse: var(--accent-inverse); --focus-hero: var(--on-hero);
  --scrim: #1f2a2a59;
  --map-bg: #f4efe5;
  --knob: #fff;

  /* 히어로 — 테마와 무관한 브랜드 면 */
  --hero-a: #0f766e; --hero-b: #0b5a54; --on-hero: #effaf7; --on-hero-2: #d8f1eb;
  --hero-glow: #14b8a680; --hero-range: #9ff0e2; --hero-cta: #fff;
  --veil-1: #ffffff17; --veil-2: #ffffff1f; --veil-3: #ffffff2e;

  --font: "Asta Sans", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 32px;
  --fs-h1: clamp(28px, 3.6vw, 42px); --fs-display: clamp(52px, 7vw, 92px);
  /* 800은 금액·숫자·제목에만. 이름표·버튼·알약은 700 */
  --fw-regular: 400; --fw-medium: 600; --fw-bold: 700; --fw-heavy: 800;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px;
  --gutter: 14px; /* 타일 사이 */

  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-2xl: 28px; --r-pill: 999px;
  --r: var(--r-xl);

  --shadow-1: 0 1px 0 #1f2a2a08, 0 16px 36px -26px #1f2a2a55;   /* 타일 */
  --shadow-2: 0 24px 42px -24px #1f2a2a70;                      /* 들어 올린 카드 */
  --shadow-3: 0 1px 0 #1f2a2a08, 0 28px 56px -24px #1f2a2a70;   /* 떠 있는 목록·말풍선 */
  --shadow-4: 0 40px 80px -30px #0009;                          /* 모달 */
  --shadow-float: 0 8px 18px -8px #1f2a2a88;                    /* 지도 핀·떠 있는 버튼 */
  --shadow-press: 0 1px 4px #0002;                              /* 세그먼트 선택 */
  --seg-on: var(--tile);                                        /* 세그먼트 선택 면: 트랙(--tile-2)보다 한 톤 떠 보이게 */

  --z-nav: 30; --z-fab: 31; --z-dropdown: 35; --z-scrim: 40; --z-modal: 41; --z-pop: 90; --z-toast: 99; --z-map-ui: 10; --z-skip: 32;

  --t-fast: .18s; --t-base: .28s; --t-slow: .45s;
  --spring: linear(0, .006, .025 2.8%, .101 6.1%, .539 18.9%, .721 25.3%, .849 31.5%, .937 38.1%, .968 41.8%, .991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.7%, 1);
  --out: cubic-bezier(.16, 1, .3, 1);
  --in: cubic-bezier(.4, 0, 1, 1);

  /* 입력칸은 타일보다 한 톤 깊은 '파인 면' */
  --field: var(--tile-2); --field-hover: var(--tile-3); --field-ph: color-mix(in srgb, var(--ink-2) 72%, var(--ink-3));
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  --xcirc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%23000'/%3E%3Cpath d='M8.5 8.5l7 7M15.5 8.5l-7 7' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  --glass: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f8a88' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M20 20l-4.2-4.2'/%3E%3C/svg%3E");
  --chev-gray: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f8a88' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  --chev-on-accent: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 16.9l-5.2 2.7 1-5.8-4.3-4.1 5.9-.9z'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111615; --tile: #192020; --tile-2: #212a29; --tile-3: #2a3433;
    --ink: #eef3f1; --ink-2: #b9c6c3; --ink-3: #94a19e;
    --line: #28312f; --line-2: #36413f;
    --control-line: #6b7a77;
    --focus: var(--accent-2);
    --accent: #3fd1bd; --accent-2: #5ee6d2; --accent-soft: #1b3834; --on-accent: #07211e; --on-accent-2: #07211e; --accent-inverse: #0b5a54;
    --ok-2: #5ee6d2; --ok-soft: #1b3834; --ok-text: #3fd1bd;
    --bad: #ff8a72; --bad-soft: #3d2520; --bad-text: #ff8a72;
    --warn: #f0b44c; --warn-soft: #3a2f18; --warn-text: #f0b44c;
    --up: #f4a3b5; --down: #7fb3e6;
    --series-59: #74b0e8; --series-74: #b59be6; --series-84: #c9d4d1;
    --ref: #e8a94a;
    --fav: #f0b44c; --fav-on-accent: #8a5a00;
    --map-bg: #141a19;
    --chev-on-accent: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2307211e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
    --shadow-1: 0 16px 36px -26px #000c;
    --shadow-2: 0 24px 42px -24px #000e;
    --shadow-3: 0 1px 0 #0003, 0 28px 56px -24px #000e;
    --shadow-float: 0 8px 18px -8px #000c;
    --seg-on: var(--tile-3);
  }
}

/* ── 바탕 ── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--fs-md)/1.55 var(--font); font-feature-settings: "tnum"; overflow-x: hidden; min-height: 100vh; }
body.modal-open { overflow: hidden; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.hero :focus-visible { outline-color: var(--focus-hero); }
.toast :focus-visible { outline-color: var(--focus-inverse); }
::selection { background: color-mix(in srgb, var(--accent-2) 30%, transparent); }
input, textarea { caret-color: var(--accent); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { background: var(--tile-2); padding: 1px 6px; border-radius: var(--r-sm); font-size: .92em; }

/* ── 상단 유리 내비 / 모바일 하단 탭 ── */
#app { min-height: 100vh; }
.topnav {
  position: sticky; top: var(--s-3); z-index: var(--z-nav); max-width: 1280px; margin: var(--s-3) auto 0; width: calc(100% - var(--s-8));
  display: flex; align-items: center; gap: var(--gutter); padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4); border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--tile) 72%, transparent); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--line); box-shadow: var(--shadow-1); view-transition-name: nav;
}
.brand { display: flex; align-items: center; gap: var(--s-2); font-weight: var(--fw-heavy); font-size: var(--fs-lg); letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.logo { width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; }
.logo svg { width: 18px; height: 18px; }
.tabs { display: flex; gap: 2px; margin: 0 0 0 auto; list-style: none; padding: 0; }
.tabs a { display: flex; align-items: center; gap: 6px; padding: var(--s-2) var(--gutter); border-radius: var(--r-pill); color: var(--ink-2); text-decoration: none; font-weight: var(--fw-bold); font-size: var(--fs-sm); transition: background var(--t-fast), color var(--t-fast); min-height: 40px; }
.tabs a:hover { background: var(--tile-2); color: var(--ink); }
.tabs a.on { background: var(--ink); color: var(--bg); }
.tabs svg { width: 18px; height: 18px; flex: none; }
.navmeta { font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; padding-right: 6px; }
.help-btn { display: inline-flex; align-items: center; gap: 6px; padding: var(--s-2) var(--s-3); border-radius: var(--r-pill); color: var(--ink-2); text-decoration: none; font-weight: var(--fw-bold); font-size: var(--fs-sm); min-height: 40px; border: 1px dashed var(--line-2); }
.help-btn svg { width: 18px; height: 18px; }
.help-btn:hover, .help-btn.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.help-fab { display: none; position: absolute; top: 10px; right: var(--s-3); z-index: var(--z-fab); width: 44px; height: 44px; place-items: center; border-radius: 50%; color: var(--ink-2);
  background: color-mix(in srgb, var(--tile) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.help-fab svg { width: 20px; height: 20px; }
.help-fab.on { color: var(--accent); }

/* 본문으로 건너뛰기 — Tab을 처음 누를 때만 왼쪽 위에 나타난다 */
.skip { position: fixed; top: var(--s-3); left: var(--s-3); z-index: var(--z-skip); padding: var(--s-2) var(--s-4); border-radius: var(--r-pill);
  background: var(--ink); color: var(--bg); font-weight: var(--fw-bold); font-size: var(--fs-sm); text-decoration: none; translate: 0 calc(-100% - var(--s-5)); }
.skip:focus-visible { translate: none; }
#main:focus, #d-title:focus { outline: none; } /* 건너뛰기로 받은 포커스 — 본문 전체에 테두리를 두르지 않는다 */

/* ── 본문 ── */
.page { max-width: 1280px; margin: 0 auto; padding: 26px var(--s-4) 90px; min-width: 0; view-transition-name: page; }
.view-head { margin: var(--s-2) var(--s-1) var(--s-5); }
.view-head h1, .detail-head h2 { margin: 0; font-weight: var(--fw-heavy); font-size: var(--fs-h1); line-height: 1.15; letter-spacing: -.035em; }
.view-head h1 em { font-style: normal; color: var(--accent); }
.lede { margin: 10px 0 0; max-width: 820px; color: var(--ink-2); }
.fine { margin: 26px var(--s-1) 0; font-size: var(--fs-xs); color: var(--ink-3); max-width: 75ch; }
.section-title { font-size: var(--fs-xl); font-weight: var(--fw-heavy); letter-spacing: -.02em; margin: var(--s-8) var(--s-1) var(--gutter); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.section-title small { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--ink-3); }
.empty { padding: 40px var(--s-5); text-align: center; color: var(--ink-3); }
.empty .btns { justify-content: center; margin: 0; }

/* ── 타일 ── */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(140px, auto); gap: var(--gutter); }
.t, .card-tile { background: var(--tile); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s-5) var(--s-6); position: relative; overflow: hidden; min-width: 0; box-shadow: var(--shadow-1); }
.card-tile h2, .card-tile h3 { margin: 0 0 var(--s-3); font-size: var(--fs-lg); font-weight: var(--fw-heavy); letter-spacing: -.015em; }
.card-tile h2 small, .card-tile h3 small { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--ink-3); }
.cap { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-3); display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
.cap small { font-weight: var(--fw-regular); }
.big-num { font-size: var(--fs-2xl); font-weight: var(--fw-heavy); letter-spacing: -.035em; margin-top: 10px; line-height: 1.1; }
.sub { font-size: var(--fs-sm); color: var(--ink-3); margin-top: var(--s-1); }
.note { margin: -6px 0 var(--s-3); font-size: var(--fs-sm); color: var(--ink-3); }
/* 제목 아래가 아니라 표·목록 같은 덩어리 뒤에 오는 설명은 위로 붙지 않게 */
:is(.table-wrap, table, ul, .btns, .form-grid) + .note { margin: var(--s-4) 0 0; }
.span-2 { grid-column: span 2; }

/* 히어로 — 홈의 답 하나 */
.hero { grid-column: span 2; grid-row: span 2; background: linear-gradient(160deg, var(--hero-a), var(--hero-b)); color: var(--on-hero); border: 0; display: flex; flex-direction: column; }
.hero .cap { color: var(--on-hero-2); }
h1.cap { margin: 0; } /* 결과 화면의 제목(h1)은 작은 머리말 모양 그대로 */
.hero .v { font-size: var(--fs-display); font-weight: var(--fw-heavy); letter-spacing: -.04em; line-height: 1; margin: var(--s-4) 0 6px; }
.hero p { margin: 0; color: var(--on-hero-2); }
.hero .blob { position: absolute; width: 380px; height: 380px; right: -130px; top: -150px; border-radius: 50%; background: radial-gradient(circle, var(--hero-glow), transparent 65%); pointer-events: none; }
.hero .ctrl { margin-top: auto; display: grid; gap: 10px; background: var(--veil-1); border-radius: var(--r-lg); padding: var(--gutter) var(--s-4); position: relative; }
.hero .ctrl label { display: flex; justify-content: space-between; font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.hero output { font-weight: var(--fw-heavy); }
.hero input[type=range] { width: 100%; accent-color: var(--hero-range); margin: 0; height: 28px; }
.hero .term-q { background: var(--veil-3); color: var(--on-hero); }
.answer { grid-column: auto; grid-row: auto; min-height: 0; padding: 28px clamp(20px, 4vw, 40px); gap: 6px; }
.answer .v { margin: 10px 0 var(--s-2); }
.answer .ctrl { margin-top: 0; }
/* 큰 숫자의 기준 (규제지역) · 비규제 지역 최대 가격 */
.hero .hero-basis { margin: 0 0 var(--s-3); font-size: var(--fs-sm); font-weight: var(--fw-bold); line-height: 1.5; color: var(--on-hero-2); }
.hero .hero-basis:empty { display: none; }
.hero .verdict-line { font-size: var(--fs-lg); line-height: 1.5; max-width: 40em; margin: 0 0 var(--s-5); color: var(--on-hero); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: var(--s-5); }
.fact { background: var(--veil-1); border-radius: var(--r-lg); padding: var(--s-3) var(--gutter); display: grid; gap: 2px; }
.fact span { font-size: var(--fs-sm); color: var(--on-hero-2); }
.fact b { font-size: var(--fs-xl); font-weight: var(--fw-heavy); letter-spacing: -.02em; }
.fact small { font-size: var(--fs-xs); color: var(--on-hero-2); }
.answer .cta { margin-top: var(--s-4); align-self: flex-start; background: var(--hero-cta); color: var(--hero-b); border-color: var(--hero-cta); text-decoration: none; display: inline-flex; align-items: center; }
.answer .cta:hover { background: var(--on-hero-2); }
.policy-alert { align-self: flex-start; margin: -6px 0 var(--s-5); padding: var(--s-2) var(--s-3); border-radius: var(--r-md); background: var(--veil-2); color: var(--on-hero); font-size: var(--fs-sm); font-weight: var(--fw-bold); text-decoration: none; line-height: 1.45; }
.policy-alert:hover { background: var(--veil-3); }
/* 판정을 바꾸는 가정 한 줄 (비상금·예산) — 사실 3칸 바로 아래 */
.hero .assume { margin: calc(-1 * var(--s-3)) 0 var(--s-5); font-size: var(--fs-sm); line-height: 1.5; color: var(--on-hero-2); }
.hero .assume a { color: var(--on-hero); font-weight: var(--fw-bold); text-underline-offset: 3px; }
/* 정책대출 판정 전 안내 (policy-ask.js askLine) — 판정이 들어갈 자리에 */
.policy-ask { margin: var(--s-2) 0 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-2); }
.ask-link { padding-block: 0; min-height: 28px; vertical-align: baseline; }
.ask-link, .hero .assume a { position: relative; }
:is(.ask-link, .hero .assume a)::before { content: ""; position: absolute; inset: -8px -4px; } /* 글줄 안 링크 — 누르는 영역 44px */

/* 링·연도 막대·알약 줄 (숫자 자세히 보기) */
.ring { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ring .cap { align-self: stretch; }
.ring .rw { position: relative; margin: var(--s-2) 0 2px; }
.ring svg { width: 160px; height: 160px; transform: rotate(-90deg); display: block; }
.ring circle { fill: none; stroke-width: 14; stroke-linecap: round; }
.ring .bg { stroke: var(--tile-2); } .ring .fg { stroke: var(--ok-2); transition: stroke var(--t-base); } .ring .fg.warn { stroke: var(--warn); } .ring .fg.bad { stroke: var(--bad); }
.ring .in { position: absolute; inset: 0; display: grid; place-content: center; }
.ring .in b { font-size: var(--fs-2xl); font-weight: var(--fw-heavy); letter-spacing: -.03em; }
.ring .in small { color: var(--ink-3); font-size: var(--fs-xs); }
.ybars { display: flex; gap: 10px; align-items: flex-end; height: 120px; margin-top: var(--gutter); }
.ybar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--ink-3); min-width: 0; }
.ybar i { width: 100%; height: 84px; border-radius: var(--r-sm) var(--r-sm) var(--r-xs) var(--r-xs); background: var(--accent-soft); transform-origin: bottom; transform: scaleY(0); display: block; transition: transform .35s var(--out); }
.ybar.ok i { background: var(--ok-2); } .ybar b { font-size: var(--fs-xs); color: var(--ink-2); }
.pills { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }
.pill { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: var(--s-2) var(--s-3); border-radius: var(--r-md); background: var(--tile-2); font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.pill small { display: block; font-weight: var(--fw-regular); font-size: var(--fs-xs); color: var(--ink-3); }
.pill small.deadline { margin-top: 2px; }
.pill small.deadline.soon { color: var(--warn-text); font-weight: var(--fw-bold); }

/* ── 알약 — 배지·판정·D-day·상태·개수가 같은 해부를 쓴다. 톤은 --pill-bg / --pill-fg만 바꾼다 ── */
:where(.badge, .fit, .dday, .tag-n, .pop-cat, .cs-st, .count, .count-dot) {
  display: inline-flex; align-items: center; gap: var(--s-1); padding: 2px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); font-style: normal; line-height: 18px; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: var(--pill-bg, var(--tile-2)); color: var(--pill-fg, var(--ink-2));
}
.fit::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
:where(.tabs .count, .count-dot) { padding: 0 7px; }
:where(.tag-n) { padding: 1px 7px; margin-left: 6px; vertical-align: 1px; }
:where(.cs-st) { padding: 1px var(--s-2); }
/* 톤: 정보(강조) · 판정(좋음/나쁨/주의) · 꽉 찬 강조 · 진한 글자 */
.badge.accent, .tag-n, .pop-cat, .cs-st.s-1, .tabs .count { --pill-bg: var(--accent-soft); --pill-fg: var(--accent); }
.badge.ok, .fit.ok, .dday.done { --pill-bg: var(--ok-soft); --pill-fg: var(--ok-text); }
.badge.no, .fit.no, .dday.late { --pill-bg: var(--bad-soft); --pill-fg: var(--bad-text); }
.badge.soft, .dday.soon { --pill-bg: var(--warn-soft); --pill-fg: var(--warn-text); }
.cs-st.s-2, .count-dot { --pill-bg: var(--accent); --pill-fg: var(--on-accent); }
.badge.new { --pill-bg: var(--ink); --pill-fg: var(--bg); }
.cs-st.s-3 { --pill-bg: transparent; --pill-fg: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.tabs a.on .count, .chip.on .count-dot { --pill-bg: var(--accent-2); --pill-fg: var(--on-accent-2); }

/* 점수 막대 — 높을수록 진한 틸. 중간 점수는 경고가 아니므로 주황을 쓰지 않는다 */
.scorebar { display: inline-flex; align-items: center; gap: var(--s-2); min-width: 76px; }
.scorebar i { display: block; width: 44px; height: 6px; border-radius: var(--r-pill); background: var(--tile-3); overflow: hidden; }
.scorebar u { display: block; height: 100%; background: color-mix(in srgb, var(--accent-2) 55%, var(--tile-3)); border-radius: var(--r-pill); }
.scorebar.hi u { background: var(--accent-2); } .scorebar.lo u { background: var(--ink-3); }
.scorebar b { font-size: var(--fs-sm); font-weight: var(--fw-heavy); }

/* 가격 방향 — 한국 관례(상승 붉은 계열·하락 파랑)를 따르되 판정색(코랄)과는 다른 차분한 색 */
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--ink-3); }
.bad, td.bad, dd.bad { color: var(--bad-text); font-weight: var(--fw-heavy); }
td.warn { color: var(--warn-text); font-weight: var(--fw-heavy); }

/* ── 후보 카드 — 제목 버튼이 카드 전체를 덮어 누르는 자리가 되고, 별·상태는 그 위에 따로 선다 ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--gutter); margin-top: var(--gutter); }
.cards > .group-sep { grid-column: 1 / -1; margin: var(--s-4) var(--s-1) 0; font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--ink-2); } /* 살 수 있는 곳 먼저: 여기부터 나머지 */
/* 목록 위 한 줄 요약 — 살 수 있는 곳 보기 방식, 모든 곳이 같은 월 상환 */
.list-sum { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s-3); margin: var(--s-2) 0 0; font-size: var(--fs-sm); color: var(--ink-2); }
.list-sum .link-btn { padding-inline: 0; min-height: 44px; }
.section-title + .list-sum { margin: calc(-1 * var(--s-2)) var(--s-1) 0; }
.card { background: var(--tile); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s-5); text-align: left; position: relative; box-shadow: var(--shadow-1); cursor: pointer;
  transition: transform .5s var(--spring), box-shadow var(--t-base), border-color var(--t-fast); display: flex; flex-direction: column; min-width: 0; }
.card:hover, .card:has(.card-open:focus-visible) { transform: translateY(-4px) scale(1.012); box-shadow: var(--shadow-2); border-color: var(--accent-2); }
.card:has(.card-open:active) { transform: translateY(-2px) scale(.992); transition-duration: .12s; } /* 누르는 순간 살짝 눌림 (별 버튼은 제외) — 떼면 상세로 커진다 */
.card:has(.card-open:focus-visible) { outline: 2.5px solid var(--focus); outline-offset: 2px; } /* 테두리색(2.45:1)만으로는 포커스가 약하다 */
.card.dropped { opacity: .5; }
.card .top { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
.card .tag { font-size: var(--fs-xs); color: var(--ink-3); }
.card h3 { font-size: var(--fs-lg); font-weight: var(--fw-heavy); margin: var(--s-3) 0 2px; letter-spacing: -.015em; line-height: 1.3; }
.card-open { all: unset; cursor: pointer; }
.card-open::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-open:focus-visible { outline: none; }
.card .meta { font-size: var(--fs-sm); color: var(--ink-3); }
.card .meta2 { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--accent); margin-top: 2px; }
/* 추세선은 무채색 — 방향은 옆의 % 숫자 색이 말하고, 카드의 색은 판정(살 수 있어요/현금 부족)에 남겨 둔다 */
.card svg.spark { width: 100%; height: 44px; margin-top: 10px; }
.card svg.spark .ln { fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card svg.spark .area { fill: color-mix(in srgb, var(--ink-3) 10%, transparent); }
.card .price { display: flex; justify-content: space-between; align-items: flex-end; margin-top: var(--s-3); }
.card .price b { font-size: var(--fs-xl); font-weight: var(--fw-heavy); letter-spacing: -.03em; }
.card .price small { font-size: var(--fs-xs); font-weight: var(--fw-heavy); }
.card .need { display: flex; justify-content: space-between; gap: var(--s-2); font-size: var(--fs-sm); color: var(--ink-2); border-top: 1px dashed var(--line-2); margin-top: 10px; padding-top: 10px; }
.card .need b { font-weight: var(--fw-heavy); }
.card .need .warn { color: var(--warn-text); font-weight: var(--fw-heavy); } /* 월 상환이 목표 초과 (부담 큼은 .bad) */
.card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: var(--s-2); min-height: 30px; }
.card .foot > *, .card .top > * { position: relative; z-index: 1; }
.star { background: none; border: 0; padding: 6px; line-height: 1; color: color-mix(in srgb, var(--ink-3) 55%, var(--tile)); border-radius: 50%; min-width: 44px; min-height: 44px; margin: -4px; display: inline-grid; place-items: center; transition: transform var(--t-slow) var(--spring), color var(--t-fast); }
.star.on, .star:hover { color: var(--fav); }
.star:active { transform: scale(.85); }
.star svg { width: 20px; height: 20px; display: block; }

/* ── 버튼 ── */
.btns { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink); text-decoration: none; border: 1px solid var(--line-2); background: var(--tile); padding: 10px var(--s-4); border-radius: var(--r-pill); font-weight: var(--fw-bold); font-size: var(--fs-sm); min-height: 44px; transition: transform .4s var(--spring), background var(--t-fast), border-color var(--t-fast); }
.btn:hover { background: var(--tile-2); }
.btn > svg { width: 16px; height: 16px; flex: none; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); border-color: transparent; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { color: var(--bad-text); }
.btn[disabled], .btn[disabled]:hover { opacity: .5; cursor: not-allowed; background: var(--tile); }
.btn.primary[disabled] { background: var(--accent); }
.link-btn { display: inline-flex; align-items: center; gap: var(--s-1); border: 0; background: none; color: var(--accent); font-weight: var(--fw-bold); text-decoration: none; padding: var(--s-2) var(--s-1); min-height: 44px; }
/* 화살표는 흐름 밖에 둔다 — flex 항목이면 밑줄이 글자와 화살표에 따로 그어져 끊겨 보인다. 자리는 오른쪽 여백으로 잡는다 */
.link-btn.go { position: relative; padding-right: 0; margin-right: calc(1em + var(--s-1) * 2); }
.link-btn.go::after { content: "→" / ""; position: absolute; left: calc(100% + var(--s-1)); transition: translate var(--t-fast) var(--out); }
.link-btn.go:hover::after { translate: 3px 0; }
.link-btn:hover { text-decoration: underline; }
.more-btn { display: block; margin: var(--s-4) auto 0; padding: var(--s-3) var(--s-6); background: var(--tile); border: 1px solid var(--line-2); color: var(--ink); border-radius: var(--r-pill); font-weight: var(--fw-bold); }
.more-btn:hover { background: var(--tile-2); }
.close { position: sticky; top: 0; float: right; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--tile-2); font-size: var(--fs-xl); z-index: 2; }
.close:hover { background: var(--tile-3); }

/* ── 칩·세그먼트 ── */
.chip { border: 1px solid var(--line-2); background: transparent; border-radius: var(--r-pill); padding: 6px var(--s-3); font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-2); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; min-height: 40px; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* 칩 안 개수 — 흐림(opacity) 대신 한 단계 옅은 글자색 (4.5:1 이상), 켜진 칩에선 칩 글자색 그대로 */
.chip i:not(.count-dot) { font-style: normal; font-size: var(--fs-xs); color: var(--ink-3); }
.chip.on i:not(.count-dot) { color: inherit; }
/* 세그먼트는 하나: 보기 방식·임장 화면(.page-seg)·지도 알약 색 기준(.lg-modes) */
.seg { display: inline-flex; gap: 2px; background: var(--tile-2); border-radius: var(--r-pill); padding: 3px; margin-left: auto; }
.seg > :is(button, a) { display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: var(--r-pill); padding: 6px var(--gutter); min-height: 38px;
  font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-3); text-decoration: none; white-space: nowrap; transition: background-color var(--t-fast), color var(--t-fast); }
.seg > :is(button, a):hover { color: var(--ink); }
.seg > :is(button, a).on { background: var(--seg-on); color: var(--ink); box-shadow: var(--shadow-press); }
.page-seg { margin: 0 0 var(--gutter); }
/* 예/아니요 (ui.js field type "yesno") — 답하기 전엔 둘 다 꺼진 모양 */
.seg.yesno { margin-left: 0; position: relative; }
.seg.yesno > button { min-width: 72px; min-height: 44px; position: relative; transition: color var(--t-fast); }   /* 면은 segSlide가 옮긴다 — 배경 전환이 겹치면 끝에서 깜빡인다 */
.seg.yesno > button.on { background: var(--accent); color: var(--on-accent); }   /* 답은 보기 방식보다 또렷하게 */
/* 답을 바꾸는 동안만 — 고른 면을 임시 면(motion.js segSlide)이 대신 그리며 옮긴다 */
.seg.yesno.sliding > button.on { background: transparent; }
.seg-ghost { position: absolute; inset: 0; border-radius: inherit; background: var(--accent); pointer-events: none; }
.page-seg > a { padding-inline: var(--s-4); }

/* ── 입력칸 — 흰 상자+테두리 대신 '파인 면'. 포커스는 면이 밝아지며 틸 테두리와 부드러운 링 ── */
select, input:is([type="number"], [type="text"], [type="search"], [type="url"], [type="date"]), textarea {
  appearance: none; -webkit-appearance: none; border: 1.5px solid var(--control-line); background-color: var(--field); color: var(--ink);
  border-radius: var(--r-md); padding: 10px var(--gutter); min-width: 0; min-height: 44px; font-size: var(--fs-md); font-weight: var(--fw-medium); line-height: 1.3;
  transition: background-color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-base) var(--out); }
select:hover, input:is([type="number"], [type="text"], [type="search"], [type="url"], [type="date"]):hover, textarea:hover { background-color: var(--field-hover); }
select:focus-visible, input:is([type="number"], [type="text"], [type="search"], [type="url"], [type="date"]):focus, textarea:focus {
  outline: none; background-color: var(--tile); border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 16%, transparent); }
/* 잘못된 값 — 음수·범위 밖 값은 빨간 테두리와 안내 줄로 */
:is(input, select, textarea):user-invalid, :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 14%, transparent); }
.field:has(:user-invalid) small, .field small.field-error { color: var(--bad-text); font-weight: var(--fw-bold); }
:is(input, select, textarea):disabled { opacity: .5; cursor: not-allowed; }
::placeholder { color: var(--field-ph); font-weight: var(--fw-regular); opacity: 1; }
input[type="number"]::-webkit-inner-spin-button { opacity: .45; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
input[type="search"] { padding-left: 42px; background-image: var(--glass); background-repeat: no-repeat; background-position: var(--gutter) center; background-size: 18px; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; width: 18px; height: 18px; margin: 0 -4px 0 var(--s-2); cursor: pointer;
  background: var(--ink-3); -webkit-mask: var(--xcirc) center / contain no-repeat; mask: var(--xcirc) center / contain no-repeat; }
input[type="search"]::-webkit-search-cancel-button:hover { background: var(--ink-2); }
select { padding-right: 38px; cursor: pointer; background-image: var(--chev-gray); background-repeat: no-repeat; background-position: right 13px center; background-size: 16px; text-overflow: ellipsis; }
input[type="checkbox"] { width: 20px; height: 20px; margin: 2px; accent-color: var(--accent); cursor: pointer; }

/* 상태 드롭다운 — 관심 · 임장 · 결정 · 탈락 (s-0 … s-3) */
select.status { font-size: var(--fs-xs); font-weight: var(--fw-bold); padding: var(--s-1) 28px var(--s-1) var(--s-3); border-radius: var(--r-pill); min-height: 38px; background-color: var(--field); color: var(--ink-2); border: 0; background-position: right 9px center; background-size: 13px; }
select.status.s-1 { background-color: var(--accent-soft); color: var(--accent); }
select.status.s-2 { background-color: var(--accent); color: var(--on-accent); background-image: var(--chev-on-accent); }
select.status.s-3 { color: var(--ink-3); background-color: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
select.status:focus-visible { box-shadow: 0 0 0 2.5px var(--focus); }

/* 표 안 작은 드롭다운 (입지 점수) — 아래 @supports 안의 값이 이기도록 그보다 앞에 둔다 */
.loc select { min-height: 36px; padding: var(--s-1) 30px var(--s-1) var(--s-3); border-radius: var(--r-sm); background-position: right 9px center; background-size: 14px; }

/* 드롭다운 펼친 목록 — 지원 브라우저(Chrome 계열)는 페이지와 같은 떠 있는 타일로 */
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { background-image: none !important; padding-right: var(--s-3); display: inline-flex; align-items: center; gap: var(--s-2); }
  select::picker-icon { content: ""; width: 16px; height: 16px; flex: none; margin-left: auto; background: currentColor; opacity: .55;
    -webkit-mask: var(--chev) center / contain no-repeat; mask: var(--chev) center / contain no-repeat; transition: rotate var(--t-base) var(--out); }
  select:open::picker-icon { rotate: 180deg; }
  select:open { background-color: var(--tile); border-color: var(--focus); }
  select.status { padding-right: 10px; gap: var(--s-1); }
  select.status::picker-icon { width: 13px; height: 13px; opacity: .7; }
  select.status:open { border-color: transparent; }
  .loc select { padding-right: var(--s-2); }

  ::picker(select) { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--tile); color: var(--ink); padding: 6px; margin-block: 6px;
    min-width: anchor-size(width); max-height: min(60vh, 420px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
    box-shadow: var(--shadow-3);
    opacity: 1; translate: 0 0; scale: 1; transform-origin: top center;
    transition: opacity .16s, translate .26s var(--out), scale .26s var(--out), overlay .26s allow-discrete, display .26s allow-discrete; }
  ::picker(select):not(:popover-open) { opacity: 0; translate: 0 -6px; scale: .98; }
  @starting-style { ::picker(select):popover-open { opacity: 0; translate: 0 -6px; scale: .98; } }

  option { display: flex; align-items: center; gap: 10px; padding: 10px var(--s-3); min-height: 44px; border-radius: var(--r-md); font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--ink-2); cursor: pointer; transition: background-color .15s; }
  option:hover, option:focus-visible { background: var(--tile-2); color: var(--ink); outline: none; }
  option:checked { background: var(--accent-soft); color: var(--accent); font-weight: var(--fw-bold); }
  option::checkmark { content: ""; order: 1; margin-left: auto; width: 16px; height: 16px; background: currentColor;
    -webkit-mask: var(--check) center / contain no-repeat; mask: var(--check) center / contain no-repeat; }
}

/* 필드 묶음 */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field.wide { grid-column: 1 / -1; }
.field-label { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); }
.field-input { display: flex; align-items: center; gap: 6px; }
.field-input input, .field-input select { flex: 1; width: 100%; }
.field-input em { font-style: normal; font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; }
.field small { font-size: var(--fs-xs); color: var(--ink-3); }
.field textarea { width: 100%; resize: vertical; }
.toggle { width: 48px; height: 28px; border-radius: var(--r-pill); border: 0; background: var(--control-line); position: relative; padding: 0; flex: none !important; transition: background .25s; }
.toggle::after { content: ""; position: absolute; inset: -8px; } /* 누르는 영역 44px */
.toggle span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--knob); box-shadow: var(--shadow-press); transition: transform var(--t-slow) var(--spring); }
.toggle.on { background: var(--accent); } /* 켜짐도 타일 대비 3:1 이상 (accent-2는 2.45:1) */
.toggle.on span { transform: translateX(20px); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-3) var(--gutter); }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: var(--gutter); margin: var(--gutter) 0; }

/* ── 필터 줄 — 칩·세그먼트·입력칸이 같은 알약, 같은 높이 ── */
.filters { display: grid; gap: 10px; padding: var(--s-4) var(--s-5); background: var(--tile); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.frow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.frow > .field-error { flex: 1 0 100%; order: 1; margin: 0; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--bad-text); }
.frow.main .search { flex: 1 1 220px; margin: 0; width: auto; }
.frow.main > select { flex: 0 1 auto; }
.flabel { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); width: 44px; }
.flabel.gap { width: auto; margin-left: 10px; }
/* 라벨과 컨트롤 한 덩어리 — 좁은 화면에서 줄바꿈이 둘 사이가 아니라 덩어리 사이에서 일어난다 */
.fpair { display: inline-flex; align-items: center; gap: var(--s-2); }
.fpair > .flabel.gap { margin-left: 0; }
.fpair > .seg { margin-left: 0; }
.frow.pairs { column-gap: var(--s-4); }
.filters :is(select, input[type="search"], input[type="number"]) { border-radius: var(--r-pill); min-height: 44px; }
.filters input[type="number"] { width: 120px; }
.filters .chip, .filters .seg { min-height: 44px; }
.filter-btn { position: relative; }
.filter-btn:not(.on) { background: var(--field); border-color: transparent; color: var(--ink-2); }
.filter-btn:not(.on):hover { background: var(--field-hover); }
.more-filters { display: grid; gap: 10px; border-top: 1px dashed var(--line-2); padding-top: var(--s-3); }
.search { margin-left: auto; width: 220px; }

/* ── 표 ── */
.table-wrap { overflow-x: auto; margin-top: var(--gutter); border: 1px solid var(--line); border-radius: var(--r); background: var(--tile); box-shadow: var(--shadow-1); }
.table-wrap.flat { box-shadow: none; margin-top: var(--s-1); }
table { border-collapse: collapse; width: 100%; }
.ledger th, .ledger td { padding: var(--s-3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.ledger thead th { position: sticky; top: 0; background: var(--tile-2); font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); z-index: 1; }
.ledger tbody tr { cursor: pointer; transition: background .15s; }
.ledger tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.ledger tbody tr[data-id]:active { background: var(--accent-soft); transition-duration: 0s; }
.ledger td.name { font-weight: var(--fw-heavy); min-width: 10em; max-width: 280px; white-space: normal; word-break: keep-all; overflow-wrap: break-word; } /* 자동 표 배치가 이 칸을 한 글자 폭으로 줄이지 못하게. 어절 단위로 줄바꿈, 표는 감싸개 안에서 가로로 넘친다 */
.ledger td small { display: block; font-size: var(--fs-xs); font-weight: var(--fw-regular); color: var(--ink-3); }
.ledger td small.memo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.ledger tr.dropped { opacity: .45; }
.ledger tr.dropped td.name { text-decoration: line-through; }
.mini { font-size: var(--fs-sm); }
.mini caption { text-align: left; font-size: var(--fs-sm); color: var(--ink-3); padding-bottom: var(--s-2); font-weight: var(--fw-bold); }
.mini caption .cap-note { display: block; margin-top: 2px; font-size: var(--fs-xs); font-weight: var(--fw-regular); }
.mini th, .mini td { padding: var(--s-2); border-bottom: 1px solid var(--line); text-align: left; }
.mini th { font-weight: var(--fw-bold); color: var(--ink-3); font-size: var(--fs-xs); }
.mini tr.hl td { background: var(--accent-soft); font-weight: var(--fw-heavy); }
/* 숫자 칸은 표 종류와 상관없이 오른쪽 정렬 — .ledger td·.mini td보다 구체적이어야 한다 */
table :is(td, th).num { text-align: right; }
.loc td { padding: 6px var(--s-3); }

/* ── 접기 (details) ── */
details.more { margin-top: 30px; }
details.more > summary, details.advanced > summary, details.card-tile > summary, .fine-details > summary, .more-setup > summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; min-height: 44px; }
details > summary::-webkit-details-marker { display: none; }
details.more > summary, details.advanced > summary { padding: var(--s-4) var(--s-5); border-radius: var(--r); background: var(--tile); border: 1px solid var(--line); font-size: var(--fs-lg); font-weight: var(--fw-heavy); box-shadow: var(--shadow-1); }
details.more > summary small, details.advanced > summary small { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--ink-3); }
details.more > summary::after, details.advanced > summary::after, details.card-tile > summary::after, .more-setup > summary::after, .fine-details > summary::after {
  content: ""; width: 16px; height: 16px; background: var(--ink-3); margin-left: auto; align-self: center; transition: transform .25s var(--out);
  -webkit-mask: var(--chev) center / contain no-repeat; mask: var(--chev) center / contain no-repeat; }
details[open] > summary::after { transform: rotate(180deg); }
details.more .bento, details.advanced .set-grid { margin-top: var(--gutter); }
details.more .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); }
details.card-tile > summary { font-size: var(--fs-lg); font-weight: var(--fw-heavy); }
details.card-tile[open] > summary { margin-bottom: var(--s-3); }
.fine-details { margin-top: 6px; } .fine-details > summary { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-3); padding: 6px 0; align-items: center; }
details.advanced { margin-top: var(--gutter); }
details.advanced > summary { padding-inline: var(--s-6); } /* 카드 글자 시작선과 맞춘다 */
details.advanced > .note { margin: var(--s-3) var(--s-1) 0; }
details.advanced .card-tile { margin-top: var(--gutter); }

/* ── 토스트·로딩 ── */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 20px); display: flex; align-items: center; gap: var(--gutter); background: var(--ink); color: var(--bg); padding: 10px var(--s-5); border-radius: var(--r-pill); opacity: 0; transition: .35s var(--out); z-index: var(--z-toast); font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-act { border: 0; background: none; color: var(--accent-inverse); font-weight: var(--fw-heavy); padding: 6px 2px; min-height: 36px; position: relative; }
.toast-act::after { content: ""; position: absolute; inset: -4px -8px; } /* 누르는 영역 44px (토스트 높이는 그대로) */
.loading { display: grid; place-items: center; align-content: center; gap: var(--gutter); min-height: 80vh; color: var(--ink-3); font-weight: var(--fw-bold); text-align: center; padding: 0 var(--s-4); }
.loading .logo { width: 56px; height: 56px; border-radius: var(--r-lg); animation: bob 1.2s var(--out) infinite alternate; }
.loading .logo svg { width: 34px; height: 34px; }
.loading.failed .logo { animation: none; background: var(--ink-3); }
.loading.failed p { margin: 0; max-width: 34ch; color: var(--ink-2); }
@keyframes bob { to { transform: translateY(-8px); } }

/* ── 용어 도움말 ── */
.term { display: inline-flex; align-items: center; gap: var(--s-1); }
.term-q { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 0; padding: 0; margin-left: var(--s-1); vertical-align: 1px;
  background: var(--tile-3); color: var(--ink-2); font-size: var(--fs-xs); font-weight: var(--fw-heavy); line-height: 1; flex: none; position: relative; transition: background var(--t-fast), color var(--t-fast), transform var(--t-slow) var(--spring); }
.term-q::after { content: ""; position: absolute; inset: -13px; } /* 터치 영역 44px 확보 */
.term-q:hover, .term-q:focus-visible { background: var(--accent); color: var(--on-accent); }
.term-q:active { transform: scale(.88); }
.term-q.static { cursor: default; }
.pop { position: absolute; z-index: var(--z-pop); background: var(--tile); border: 1px solid var(--line); border-radius: var(--r-xl); padding: var(--s-4) var(--s-5) var(--gutter); box-shadow: var(--shadow-3); max-height: min(70vh, 520px); overflow: auto; outline: none; }
.pop.sheet-pop { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto !important; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 82vh; padding: var(--s-5) var(--s-5) calc(20px + env(safe-area-inset-bottom)); }
.pop.sheet-pop::before { content: ""; display: block; width: 40px; height: 4px; border-radius: var(--r-pill); background: var(--line-2); margin: -6px auto 10px; }
.pop-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: calc(var(--z-pop) - 1); }
.pop-head { display: flex; justify-content: space-between; align-items: center; }
.pop-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--tile-2); font-size: var(--fs-lg); position: relative; }
.pop-x::after { content: ""; position: absolute; inset: -6px; }
.pop h3, .gterm h3 { margin: 10px 0 2px; font-size: var(--fs-xl); font-weight: var(--fw-heavy); letter-spacing: -.02em; }
.pop-short { margin: 0 0 10px; font-weight: var(--fw-bold); color: var(--ink-2); }
.pop p, .gterm p { font-size: var(--fs-sm); line-height: 1.65; margin: 0 0 var(--s-2); }
.pop p b, .gterm p b { color: var(--ink); font-weight: var(--fw-heavy); background: linear-gradient(transparent 62%, var(--accent-soft) 62%); }
.pop-mine { display: grid; gap: 2px; background: var(--accent-soft); color: var(--ink); border-radius: var(--r-md); padding: 10px var(--s-3); margin: 10px 0 var(--s-1); font-size: var(--fs-sm); }
.pop-mine b { font-size: var(--fs-xs); font-weight: var(--fw-heavy); color: var(--accent); }
.pop-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: var(--fs-sm); font-weight: var(--fw-bold); flex-wrap: wrap; }
.pop-foot a { text-decoration: none; }

/* ── 단지 검색 콤보박스 — 같은 재질, 결과는 떠 있는 타일 ── */
.cs { position: relative; flex: 1 1 100%; }
.cs input.cs-input { width: 100%; min-height: 52px; border-radius: var(--r-pill); padding: var(--s-3) var(--s-5) var(--s-3) 46px; font-size: var(--fs-md); background-position: 17px center; background-size: 20px; }
.cs-list { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: var(--z-dropdown); list-style: none; margin: 0; padding: 6px; max-height: min(60vh, 420px); overflow: auto;
  background: var(--tile); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-3); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  transform-origin: top center; transition: opacity .16s, translate .26s var(--out), scale .26s var(--out), display .26s allow-discrete; }
@starting-style { .cs-list:not([hidden]) { opacity: 0; translate: 0 -6px; scale: .98; } }
.cs-opt { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: var(--s-3); padding: 10px var(--gutter); border-radius: var(--r-md); cursor: pointer; min-height: 56px; transition: background-color .15s; }
.cs-opt[aria-selected="true"], .cs-opt:hover { background: var(--tile-2); }
.cs-opt[aria-selected="true"] .cs-go { opacity: 1; translate: 0 0; }
.cs-main { display: grid; gap: 2px; min-width: 0; }
.cs-name { display: flex; align-items: center; gap: 6px; font-weight: var(--fw-heavy); min-width: 0; }
.cs-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-name em { font-style: normal; font-weight: var(--fw-medium); color: var(--ink-3); font-size: var(--fs-sm); flex: none; }
.cs-name mark { background: none; color: var(--accent); }
.cs-star { width: 15px; height: 15px; flex: none; fill: var(--fav); stroke: var(--fav); display: block; }
.cs-meta { font-size: var(--fs-sm); color: var(--ink-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cs-meta b { font-weight: var(--fw-heavy); color: var(--ink-2); }
.cs-go { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--accent); white-space: nowrap; opacity: 0; translate: -4px 0; transition: opacity .15s, translate .2s var(--out); }
.cs-empty { padding: var(--s-5) var(--gutter); line-height: 1.5; color: var(--ink-3); font-size: var(--fs-sm); }
@media (hover: none) { .cs-go { display: none; } }

/* ── 상세 — 카드에서 커지는 모달 ── */
.scrim { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: var(--z-scrim); }
.big-card { position: fixed; top: 4vh; left: 50%; transform: translateX(-50%); width: min(1040px, 94vw); max-height: 92vh; overflow: auto; z-index: var(--z-modal);
  background: var(--bg); border-radius: var(--r-2xl); padding: 26px clamp(16px, 3vw, 30px) 30px; border: 1px solid var(--line); box-shadow: var(--shadow-4); }
/* 스크롤바가 둥근 모서리 밖으로 삐져나오지 않게 — 위아래를 모서리만큼 비우고, 가는 손잡이만 카드 안쪽에 띄운다 */
.big-card::-webkit-scrollbar { width: 14px; background: transparent; }
.big-card::-webkit-scrollbar-track { background: transparent; margin-block: var(--r-2xl); }
.big-card::-webkit-scrollbar-thumb { background: var(--control-line); border: 4px solid transparent; background-clip: padding-box; border-radius: var(--r-pill); }
.big-card::-webkit-scrollbar-thumb:hover { background-color: var(--ink-3); }
@supports not selector(::-webkit-scrollbar) { .big-card { scrollbar-width: thin; scrollbar-color: var(--control-line) transparent; } }
.big-card > .close { box-shadow: 0 0 0 6px var(--bg), var(--shadow-float); } /* 스크롤 중 카드 위에 떠도 경계가 또렷하게 */
/* 닫기 버튼(44px, 오른쪽 위에 떠 있다)이 맨 위 제목·평형 칩을 덮지 않게 그만큼 오른쪽을 비워 둔다. 스크롤하면 버튼은 그대로 떠 있는다 */
.detail-head { padding-right: calc(44px + var(--s-2)); }
.detail-head .type { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--ink-3); margin-left: var(--s-2); letter-spacing: 0; }
.head-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-top: var(--gutter); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--gutter); margin-top: var(--s-5); }
.dcol { display: flex; flex-direction: column; gap: var(--gutter); min-width: 0; }
.chart-box { height: 260px; position: relative; }
.type-stats { display: grid; gap: var(--s-1); margin-top: 10px; font-size: var(--fs-sm); }
.ts { display: flex; align-items: center; gap: var(--s-2); color: var(--ink-2); padding: var(--s-1) var(--s-2); border-radius: var(--r-sm); }
.ts.on { background: var(--tile-2); } .ts i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.kv { display: grid; gap: var(--s-2); margin: var(--s-3) 0; }
.kv div { display: flex; justify-content: space-between; gap: 10px; padding: 10px var(--gutter); background: var(--tile-2); border-radius: var(--r-md); font-size: var(--fs-sm); }
.kv b { font-weight: var(--fw-heavy); text-align: right; } .kv small { font-weight: var(--fw-regular); color: var(--ink-3); }
.verdict { display: flex; align-items: center; gap: 10px; padding: var(--s-3) 0 var(--s-1); font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.verdict.big { padding: 0 0 var(--gutter); }
.verdict.big strong { font-size: var(--fs-lg); font-weight: var(--fw-heavy); letter-spacing: -.015em; }
/* 판정 카드 — 위에 결과 색 띠, 돈 네 칸 */
.calc-card .btns { margin: var(--s-4) 0 0; }
/* 관심에 담기 전 메모 자리 — 왜 비어 있는지와 담기 버튼 */
.memo-empty p { margin: 0 0 var(--s-3); font-size: var(--fs-sm); color: var(--ink-3); max-width: 52ch; }
/* 판정 카드 아래 이동 링크 — 버튼 줄과 왼쪽 끝을 맞추고 가는 선으로 나눈다 */
.next-links { display: flex; flex-wrap: wrap; gap: 0 var(--s-5); margin-top: var(--s-3); padding-top: var(--s-1); border-top: 1px solid var(--line); }
.next-links .link-btn { padding-inline: 0; min-height: 44px; font-size: var(--fs-sm); }
.calc-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--line-2); }
.calc-card.is-ok::before { background: var(--ok-2); } .calc-card.is-no::before { background: var(--bad); }
.calc-card .verdict.big { padding-right: 46px; } /* 닫기 버튼 자리 */
/* 두 가격 — 실거래(점)와 KB시세(점선). 표시를 차트와 맞춘다 */
.price-ref, .chart-card h3 small { word-break: keep-all; }
.price-ref { margin: var(--s-2) 0 0; padding: var(--s-1) var(--gutter) var(--s-3); background: var(--tile-2); border-radius: var(--r-md); font-size: var(--fs-sm); }
.price-ref dl { margin: 0; }
.pr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--s-1) var(--s-3); padding: 10px 0; }
.pr-row + .pr-row { border-top: 1px solid var(--line); }
.pr-row dt { display: flex; align-items: flex-start; gap: 10px; min-width: 0; color: var(--ink); font-weight: var(--fw-bold); }
.pr-row dt > span { display: grid; gap: 2px; }
.pr-row dt small, .pr-row dd small { font-size: var(--fs-xs); font-weight: var(--fw-regular); color: var(--ink-2); }
.pr-row dd { margin: 0; display: grid; justify-items: end; gap: 2px; text-align: right; }
.pr-row dd b { font-size: var(--fs-md); font-weight: var(--fw-heavy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pr-row.is-empty dd b { color: var(--ink-3); font-weight: var(--fw-bold); }
.pr-mark { flex: none; margin-top: 6px; }
.pr-mark.dot { width: 10px; height: 10px; border-radius: 50%; }
.pr-mark.dash { width: 14px; height: 0; margin-top: 10px; border-top: 2px dashed var(--ref); }
.pr-note { margin: var(--s-1) 0 0; color: var(--ink-2); line-height: 1.5; }
.pr-note.warn { color: var(--warn-text); font-weight: var(--fw-medium); }
.pr-link { display: inline-block; margin-top: var(--s-2); font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-2); text-underline-offset: 3px; }
.pr-link:hover { color: var(--accent); }
.stats.pending .stat > b { color: var(--ink-3); transition: color var(--t-base) var(--out); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: var(--gutter) 0 var(--s-1); background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: var(--s-3) var(--gutter); background: var(--tile-2); min-width: 0; }
.stat-k { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); }
.stat > b { font-size: var(--fs-xl); font-weight: var(--fw-heavy); letter-spacing: -.02em; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.stat.policy > b { font-size: var(--fs-md); line-height: 1.35; margin-top: var(--s-1); letter-spacing: -.01em; }
.stat.policy.muted > b { color: var(--ink-3); font-weight: var(--fw-bold); }
.stat small { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--ink-3); word-break: keep-all; }
.stat.bad > b, .stat small.bad { color: var(--bad-text); }
.stat.warn > b, .stat small.warn { color: var(--warn-text); }
.meter { position: relative; display: block; height: 4px; margin-top: 6px; border-radius: var(--r-pill); background: var(--tile-3); }
.meter u { position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: inherit; background: var(--ok-2); text-decoration: none; transform-origin: left; transition: scale .5s var(--out); }
.meter.warn u { background: var(--warn); }
.meter.bad u { background: var(--bad); }
.meter i { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink-2); }
/* 입지 카드 — 그룹 리스트 + 5칸 점수 막대 */
.loc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.loc-head h3 { margin: 0 !important; }
.loc-score b { font-size: var(--fs-xl); font-weight: var(--fw-heavy); letter-spacing: -.03em; color: var(--accent); }
.loc-score small { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); margin-left: 2px; }
/* 한눈에: 강점·약점 칩 → 그룹별 한 줄 요약(이름 · 핵심 값 · 막대). 펼치면 근거 설명이 붙은 목록 */
/* 통근 상태: 아직 값이 없는 수단만, 조용한 한 줄씩 */
.commute-note { list-style: none; margin: var(--s-2) 0 0; padding: 0; font-size: var(--fs-sm); color: var(--ink-3); }
.commute-note li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s-2); }
.commute-note .link-btn { min-height: 32px; padding-block: 0; }
.loc-glance { display: grid; gap: 6px; margin: var(--s-3) 0 var(--s-1); padding: 10px var(--s-3); border-radius: var(--r-md); background: var(--tile-2); }
.loc-glance p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gl-k { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); width: 32px; flex: none; }
.ls-group h4 { margin: var(--gutter) 0 2px; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); letter-spacing: .02em; }
.ls-group ul { list-style: none; margin: 0; padding: 0; }
.ls-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: var(--s-2) 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.ls-k { color: var(--ink-2); font-weight: var(--fw-bold); word-break: keep-all; }
.ls-v { font-weight: var(--fw-heavy); color: var(--ink); line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.ls-v.muted { color: var(--ink-3); font-weight: var(--fw-medium); }
.ls-row .pips { padding-top: 0; }
.pips.lo i.on { background: var(--warn); }
.loc-more { margin-top: var(--s-1); border-top: 1px solid var(--line); }
.loc-more[open] > summary { margin-bottom: var(--s-1); }
/* 펼치면 같은 점수를 두 번 보이지 않게 요약은 숨긴다 */
.loc-card:has(.loc-more[open]) .loc-sum { display: none; }
.loc-card:has(.loc-more[open]) .loc-more { margin-top: var(--s-2); }
details:not([open]) > summary .if-open, details[open] > summary .if-closed { display: none; }
.lf-group + .lf-group { margin-top: 6px; }
.lf-group h4 { margin: var(--gutter) 0 2px; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); letter-spacing: .02em; }
.lf-group ul { list-style: none; margin: 0; padding: 0; }
.lf { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: var(--s-1) var(--s-3); align-items: start; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.lf-k { color: var(--ink-2); font-weight: var(--fw-bold); padding-top: 1px; word-break: keep-all; }
.lf-v { display: grid; gap: 6px; min-width: 0; }
.lf-v > span { display: grid; gap: 1px; }
.lf-v b { font-weight: var(--fw-heavy); color: var(--ink); line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.lf-v small { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.45; word-break: keep-all; }
.pips { display: inline-flex; gap: 3px; padding-top: 6px; }
.pips i { width: 6px; height: 12px; border-radius: 2px; background: var(--tile-3); }
.pips i.on { background: var(--accent-2); }
.pips.none { width: 42px; }
.loc-missing { margin: var(--s-3) 0 0; padding: 10px var(--s-3); border-radius: var(--r-md); background: var(--warn-soft); color: var(--ink); font-size: var(--fs-xs); line-height: 1.5; }
.loc-missing b { color: var(--ink); font-weight: var(--fw-heavy); }
/* 상세 미니 지도 */
.mini-card h3 small { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--warn-text); }
.mini-canvas { height: 240px; border-radius: var(--r-md); overflow: hidden; background: var(--tile-2); margin-bottom: 10px; }
.mini-st { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; }
.mini-st li { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); }
.mini-st i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--tile); flex: none; }
.mini-st span { color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; }
.mini-pin span, .st-pin span { position: absolute; translate: -50% calc(-100% - 6px); white-space: nowrap; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: var(--fw-heavy); padding: var(--s-1) 9px; box-shadow: var(--shadow-float); }
.mini-pin span { background: var(--accent); color: var(--on-accent); }
.st-pin span { background: var(--tile); color: var(--accent); border: 1.5px solid var(--accent-2); translate: -50% -50%; }

/* ── 첫 방문: 3단계 ── */
.setup { max-width: 760px; padding: 26px clamp(18px, 4vw, 32px); overflow: visible; }
.setup-progress { display: flex; gap: 6px; margin-bottom: var(--s-5); }
.setup-progress i { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--tile-3); overflow: hidden; }
.setup-progress i::after { content: ""; display: block; height: 100%; border-radius: inherit; background: var(--accent-2); transform-origin: left; scale: 0 1; }   /* 찬 칸 — motion.js stepBars가 차오르게 */
.setup-progress i.on::after { scale: 1; }
.setup-work { display: grid; gap: var(--s-1); margin-bottom: var(--s-4); }
.setup-fields { display: grid; gap: var(--s-4); }
.setup-fields .field-label { font-size: var(--fs-md); color: var(--ink); }
.setup-fields .field small { font-size: var(--fs-sm); }
.setup-ask { margin-top: var(--s-5); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.more-setup { margin-top: var(--s-5); border-top: 1px dashed var(--line-2); padding-top: var(--s-3); }
.more-setup > summary { font-weight: var(--fw-bold); color: var(--accent); padding: 6px 0; align-items: center; }
.more-setup .setup-fields { margin-top: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.setup-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--s-6); }
.setup-hint { flex-basis: 100%; margin: 0; font-size: var(--fs-sm); color: var(--ink-3); }

/* ── 홈: 다음 할 일 ── */
.next-card { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s-3); margin-bottom: var(--gutter); text-decoration: none; color: var(--ink); border-color: color-mix(in srgb, var(--accent-2) 40%, var(--line)); transition: transform .4s var(--spring), border-color var(--t-fast); }
.next-card:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.next-card .cap { flex-basis: 100%; }
.next-card b { font-size: var(--fs-lg); font-weight: var(--fw-heavy); letter-spacing: -.015em; }
.next-card small { flex-basis: 100%; font-size: var(--fs-sm); color: var(--ink-3); }

/* ── 임장 체크 ── */
.check th.cat { background: var(--tile-2); font-size: var(--fs-sm); font-weight: var(--fw-heavy); vertical-align: top; }
.check td.item { white-space: normal; min-width: 240px; }
.check .slot { min-width: 150px; white-space: normal; font-size: var(--fs-sm); }
.check .slot select { width: 100%; font-size: var(--fs-sm); }
.check .slot small { display: block; margin-top: var(--s-1); font-size: var(--fs-xs); color: var(--accent); font-weight: var(--fw-bold); }
.check tbody tr { cursor: default; }
.check tfoot th, .check tfoot td { padding: var(--gutter) var(--s-3); font-weight: var(--fw-heavy); background: var(--tile-2); }
.check td.total { text-align: center; font-size: var(--fs-md); }
.mark-cell { text-align: center; }
.check-one { display: grid; gap: var(--s-3); margin-top: var(--gutter); }
.check-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px var(--s-3); padding: 0 var(--s-1); }
.check-summary b { font-size: var(--fs-lg); font-weight: var(--fw-heavy); } .check-summary span { color: var(--accent); font-weight: var(--fw-heavy); } .check-summary small { color: var(--ink-3); font-size: var(--fs-sm); }
.check-cat h3 { margin: 0 0 6px; font-size: var(--fs-md); }
.check-item { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 10px 0; border-top: 1px solid var(--line); }
.check-item:first-of-type { border-top: 0; }
.check-item > span { font-size: var(--fs-md); }
/* O · △ · X — 고르기 전엔 글자 색만, 고르면 옅은 면과 테두리 */
.marks { display: flex; gap: 6px; flex: none; }
.mark { --mark: var(--ink-3); --mark-soft: transparent; width: 48px; height: 44px; border-radius: var(--r-md); border: 1px solid transparent; background: transparent; font-size: var(--fs-md); font-weight: var(--fw-heavy); color: var(--mark); transition: transform .4s var(--spring); }
.mark:hover { background: var(--tile-2); }
.mark:active { transform: scale(.9); }
.mark.m-0 { --mark: var(--ok-text); --mark-soft: var(--ok-soft); --mark-line: var(--ok-2); }
.mark.m-1 { --mark: var(--warn-text); --mark-soft: var(--warn-soft); --mark-line: var(--warn); }
.mark.m-2 { --mark: var(--bad-text); --mark-soft: var(--bad-soft); --mark-line: var(--bad); }
.mark.on { background: var(--mark-soft); border-color: var(--mark-line); }
.marks.compact .mark { width: 34px; height: 34px; font-size: var(--fs-sm); }
.slot-chip { padding: 0; gap: 0; overflow: hidden; }
.slot-chip button { border: 0; background: transparent; color: inherit; min-height: 44px; font-weight: var(--fw-bold); }
.slot-pick { padding: 6px var(--s-1) 6px var(--gutter); display: inline-flex; gap: 6px; align-items: center; }
.slot-x { padding: 6px var(--s-3) 6px 6px; min-width: 44px; font-size: var(--fs-lg); }

/* ── 매수 일정 ── */
.plan-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px var(--s-4); margin-bottom: var(--gutter); }
.plan-head p { margin: var(--s-1) 0 0; font-size: var(--fs-sm); }
.plan-name { font-size: var(--fs-xl); font-weight: var(--fw-heavy); letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.plan-name span { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--ink-3); }
.plan-name:hover { color: var(--accent); }
.plan-cta { display: flex; align-items: center; gap: var(--s-3); }
.plan-d { display: inline-flex; align-items: center; gap: 6px; font-weight: var(--fw-heavy); color: var(--ink-2); }
.flow-card { margin-bottom: var(--gutter); }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; counter-reset: step; }
.flow-step { display: grid; gap: 6px; align-content: start; padding: var(--gutter) var(--s-4); border-radius: var(--r-md); background: var(--tile-2); position: relative; }
.flow-step.short { background: color-mix(in srgb, var(--bad-soft) 70%, var(--tile-2)); }
.flow-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.flow-top b { font-size: var(--fs-md); font-weight: var(--fw-heavy); }
.flow-date input { width: 100%; background-color: var(--tile); }
.flow-cash { font-size: var(--fs-xl); font-weight: var(--fw-heavy); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.flow-step small { font-size: var(--fs-xs); color: var(--ink-3); }
.flow-step small.bad { color: var(--bad-text); font-weight: var(--fw-heavy); }
.flow-step small.field-error { color: var(--bad-text); font-weight: var(--fw-bold); }
.flow-meter { height: 6px; border-radius: var(--r-pill); background: var(--tile-3); overflow: hidden; }
.flow-meter i { display: block; height: 100%; background: var(--ok-2); border-radius: inherit; transform-origin: left; }
.flow-step.short .flow-meter i { background: var(--bad); }
.flow-total { margin: var(--s-3) 2px var(--s-1); font-weight: var(--fw-heavy); color: var(--ok-text); }
.flow-total.bad { color: var(--bad-text); }
.todo-card .next-up { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: -4px 0 10px; padding: var(--s-3) var(--gutter); border-radius: var(--r-md); background: var(--accent-soft); }
.next-up > span { font-size: var(--fs-xs); font-weight: var(--fw-heavy); color: var(--accent); }
.next-up b { font-weight: var(--fw-heavy); }
.todo-phase h3 { margin: var(--gutter) 0 var(--s-1); font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-3); }
.todo-phase ul { list-style: none; margin: 0; padding: 0; }
.todo { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-3); padding: 10px 0; border-top: 1px solid var(--line); }
.todo-phase li:first-child { border-top: 0; }
.todo-check { width: 26px; height: 26px; border-radius: var(--r-sm); border: 2px solid var(--control-line); background: var(--tile); padding: 0; position: relative; transition: background-color var(--t-fast), border-color var(--t-fast), transform .4s var(--spring); }
.todo-check::before { content: ""; position: absolute; inset: -9px; } /* 누르는 영역 44px */
.todo-check::after { content: ""; position: absolute; inset: 3px; background: var(--on-accent); -webkit-mask: var(--check) center / contain no-repeat; mask: var(--check) center / contain no-repeat; scale: 0; transition: scale var(--t-base) var(--spring); }
.todo-check[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.todo-check[aria-pressed="true"]::after { scale: 1; }
.todo-check:active { transform: scale(.88); }
.todo-body { display: grid; gap: 2px; min-width: 0; }
.todo-body b { font-weight: var(--fw-bold); }
.todo-body small { font-size: var(--fs-xs); color: var(--ink-3); }
.todo.done .todo-body b { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.todo-when { display: grid; justify-items: end; gap: 3px; }
.todo-when small { font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ── 설정 ── */
.basics, .work-card, .data-card { margin-bottom: var(--gutter); }
.basics .form-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.data-card .btns { align-items: center; margin-bottom: 0; }
.data-card .btn.danger { flex: none; border-color: color-mix(in srgb, var(--bad) 45%, var(--line-2)); }
.data-card .btn.danger:hover { background: var(--bad-soft); }

/* ── 가이드 ── */
.glossary { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--gutter); margin-top: var(--gutter); align-items: stretch; }
.gterm { display: flex; flex-direction: column; }
.gterm .pop-mine { margin-top: auto; }
.gterm .cap a { font-size: var(--fs-xs); text-decoration: none; }
.gterm.focus, .about-card.focus { border-color: var(--accent-2); }
.gterm.flash, .about-card.flash { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 55%, transparent); } /* 움직임 줄이기: 바로 연 용어를 잠깐 고정 테두리로 */
.guide-filters { margin-top: var(--gutter); }
.policy-compare h2 small { font-weight: var(--fw-regular); }
.compare th, .compare td { white-space: normal; vertical-align: top; min-width: 120px; }
.compare thead th { font-size: var(--fs-sm); color: var(--ink); } .compare thead th div { margin-top: var(--s-1); }
.compare tbody th { color: var(--ink-3); font-weight: var(--fw-bold); font-size: var(--fs-xs); min-width: 90px; }

/* ── 비교 보고서 ── */
.report-table th[scope="col"] { vertical-align: top; min-width: 170px; white-space: normal; }
.report-table th[scope="col"] b { display: block; font-size: var(--fs-md); color: var(--ink); font-weight: var(--fw-heavy); }
.report-table th[scope="col"] small { display: block; margin: 2px 0 6px; font-weight: var(--fw-medium); color: var(--ink-3); }
.report-table tbody th { color: var(--ink-3); font-weight: var(--fw-bold); font-size: var(--fs-sm); }
.report-table td { white-space: normal; font-variant-numeric: tabular-nums; }
.report-table tbody tr { cursor: default; }
.report-table td.best { background: var(--ok-soft); color: var(--ok-text); font-weight: var(--fw-heavy); }
.report-table tr.sub th, .report-table tr.sub td { font-size: var(--fs-sm); padding-top: 6px; padding-bottom: 6px; }
.report-table td.memo { font-size: var(--fs-sm); color: var(--ink-2); max-width: 240px; }

/* ── 상환 비교 — 이자는 주황(비용), 원금은 틸, 지원금은 점선 ── */
.repay-ctrl .seg { margin-left: 0; }
.repay-ctrl input[type="range"] { flex: 1 1 200px; accent-color: var(--accent); }
.repay-ctrl output { font-weight: var(--fw-heavy); font-variant-numeric: tabular-nums; min-width: 72px; }
.repay-wrap { margin-top: var(--gutter); }
.repay-table td small, .repay-table th small { display: block; font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--ink-3); white-space: normal; }
.repay-table tbody tr { cursor: pointer; }
.repay-table tr.on > * { background: var(--accent-soft); }
.repay-table tr.dim { opacity: .55; }
.repay-table .badge { margin: 0 var(--s-1) 2px 0; }
.repay-table th .link-btn { padding: var(--s-1) 0; min-height: 32px; text-align: left; }
.repay-sched { margin-top: var(--gutter); }
.repay-sched h2 small { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--ink-3); }
.rbars { display: flex; gap: 2px; height: 160px; margin-top: var(--gutter); position: relative; outline: none; border-radius: var(--r-sm); cursor: crosshair; }
.rbars:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus); }
.rbar { flex: 1; display: flex; flex-direction: column; min-width: 0; border-radius: var(--r-xs); transition: opacity var(--t-fast), background var(--t-fast); }
.rbars.hot .rbar { opacity: .32; }
.rbars.hot .rbar.on { opacity: 1; background: color-mix(in srgb, var(--ink) 8%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent); }
.rbars.hot .rbar.on b { color: var(--ink); }
.rbar .stack { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none; }
.rbar i { display: block; position: relative; }
.rbar i.int { background: var(--warn); border-radius: 2px 2px 0 0; }
.rbar i.pri { background: var(--accent-2); }
.rbar i.int u { position: absolute; left: 0; right: 0; top: 0; border: 1.5px dashed var(--ink); border-bottom: 0; }
.rbar b { height: 16px; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); text-align: center; line-height: 16px; }
.rtip { position: absolute; top: 0; z-index: 3; min-width: 176px; padding: 10px var(--s-3); border-radius: var(--r-md); background: var(--tile); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-3); font-size: var(--fs-xs); pointer-events: none; transition: left .12s var(--out); }
.rtip.below { top: calc(100% + 4px); }
.rt-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 6px; font-size: var(--fs-sm); font-weight: var(--fw-heavy); color: var(--ink); }
.rt-h small { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); }
.rt-row { display: flex; justify-content: space-between; gap: var(--gutter); padding: 2px 0; color: var(--ink-2); }
.rt-row span { display: inline-flex; align-items: center; gap: 6px; }
.rt-row b { font-weight: var(--fw-heavy); color: var(--ink); }
.rt-row.sum { margin-top: var(--s-1); padding-top: 6px; border-top: 1px solid var(--line); }
.rt-row.sum b { font-size: var(--fs-sm); }
.rt-row .k { width: 9px; height: 9px; border-radius: 3px; box-sizing: border-box; }
.repay-legend { display: flex; flex-wrap: wrap; gap: 6px var(--gutter); margin: var(--s-2) 0 0; font-size: var(--fs-xs); color: var(--ink-3); }
.repay-legend .k::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; box-sizing: border-box; }
.repay-legend .pri::before, .rt-row .k.pri { background: var(--accent-2); }
.repay-legend .int::before, .rt-row .k.int { background: var(--warn); }
.repay-legend .sub::before, .rt-row .k.sub { border: 1.5px dashed var(--ink); }

/* ── 지도 ── */
.map-wrap { position: relative; margin-top: var(--gutter); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-1); background: var(--tile-2); isolation: isolate; }
.map-canvas { height: min(72vh, 760px); min-height: 420px; background: var(--map-bg); font: inherit; }
/* 가격 알약: 아래 꼬리가 좌표를 가리킨다 */
.mk-btn { position: relative; width: 0; height: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.maplibregl-marker:has(.mk-btn:hover), .maplibregl-marker:has(.mk-btn:focus-visible), .maplibregl-marker:has(.mk-btn.on) { z-index: 3; }
.mk { position: absolute; left: 0; top: 0; translate: -50% calc(-100% - 7px); display: inline-flex; align-items: center; gap: var(--s-1); white-space: nowrap;
  padding: 5px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: var(--fw-heavy); letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.2;
  background: var(--tile); color: var(--ink); border: 1.5px solid var(--line-2); box-shadow: var(--shadow-float);
  transition: scale var(--t-base) var(--spring), translate var(--t-base) var(--out), background-color var(--t-fast), color var(--t-fast); cursor: pointer; }
.mk::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 8px; height: 8px; translate: -50% 0; rotate: 45deg; background: inherit;
  border-right: inherit; border-bottom: inherit; border-bottom-right-radius: 2px; }
.mk.mk-ok { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.mk.mk-out { color: var(--ink-2); }
.mk.mk-sl::before { content: ""; width: 10px; height: 10px; flex: none; background: var(--fav); -webkit-mask: var(--star) center / contain no-repeat; mask: var(--star) center / contain no-repeat; }
.mk.mk-ok.mk-sl::before { background: var(--fav-on-accent); }
.mk.mk-decide { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.mk.mk-drop { opacity: .55; }
.mk-btn:hover .mk, .mk-btn:focus-visible .mk, .mk-btn.on .mk { scale: 1.12; z-index: 1; box-shadow: var(--shadow-2); }
.mk-btn:focus-visible { outline: none; }
.mk-btn:focus-visible .mk { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.mk-btn.on .mk { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* 멀리서 보면 점 */
.far .mk { font-size: 0; padding: 0; width: 12px; height: 12px; gap: 0; translate: -50% -50%; border-width: 2px; }
.far .mk::after, .far .mk::before { display: none; }
.far .mk.mk-out { background: var(--tile); border-color: var(--ink-3); }
/* 직장 핀 — 판정이 아니라 기준점이므로 잉크색 */
.work-pin { --brief: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M4 8h16v11H4zM9 8V5h6v3'/%3E%3C/svg%3E"); z-index: 2; }
.work-pin span { position: absolute; translate: -50% -50%; display: inline-flex; align-items: center; gap: var(--s-1); padding: 6px var(--s-3) 6px var(--s-2); border-radius: var(--r-md);
  background: var(--ink); color: var(--bg); font-size: var(--fs-xs); font-weight: var(--fw-heavy); box-shadow: var(--shadow-float); white-space: nowrap; }
.work-pin span::before { content: ""; width: 15px; height: 15px; background: currentColor; -webkit-mask: var(--brief) center / contain no-repeat; mask: var(--brief) center / contain no-repeat; }
/* 말풍선 */
.mp-pop { animation: pop-in .26s var(--out); z-index: 5; }
@keyframes pop-in { from { opacity: 0; } }
.mp-pop .maplibregl-popup-content { background: var(--tile); color: var(--ink); border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow-3); padding: var(--gutter) var(--gutter) 10px; font: inherit; font-size: var(--fs-sm); line-height: 1.45; min-width: 250px; }
.mp-pop.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .mp-pop.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .mp-pop.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--tile); }
.mp-pop.maplibregl-popup-anchor-top .maplibregl-popup-tip, .mp-pop.maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .mp-pop.maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--tile); }
.mp-pop.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--tile); }
.mp-pop.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--tile); }
.mp-pop .maplibregl-popup-close-button { width: 32px; height: 32px; top: 6px; right: 6px; border-radius: 50%; font: 400 22px/30px var(--font); color: var(--ink-3); }
.mp-pop .maplibregl-popup-close-button:hover { background: var(--tile-2); color: var(--ink); }
.mp-head { display: grid; gap: 1px; padding-right: 28px; margin-bottom: var(--s-2); }
.mp-head b { font-size: var(--fs-md); font-weight: var(--fw-heavy); letter-spacing: -.015em; }
.mp-head small { font-size: var(--fs-xs); color: var(--ink-3); }
.mp-metrics { color: var(--ink-2) !important; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.mp-types { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mp-types li { display: flex; align-items: center; gap: 2px; }
.mp-types .star { min-width: 44px; min-height: 44px; margin: 0; }
.mp-type { flex: 1; display: grid; grid-template-columns: 44px auto 1fr; align-items: center; gap: var(--s-2); min-height: 44px; padding: 6px 10px; border: 0; border-radius: var(--r-md); background: transparent; text-align: left; cursor: pointer; transition: background-color .15s; }
.mp-type:hover, .mp-type:focus-visible { background: var(--tile-2); }
.mp-t { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); }
.mp-type b { font-size: var(--fs-md); font-weight: var(--fw-heavy); font-variant-numeric: tabular-nums; }
.mp-fit { justify-self: end; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); }
.mp-fit.ok { color: var(--ok-text); } .mp-fit.no { color: var(--bad-text); }
.mp-foot { margin: var(--s-2) 2px 0; padding-top: var(--s-2); border-top: 1px dashed var(--line-2); font-size: var(--fs-xs); color: var(--ink-3); }
.mp-approx { color: var(--warn-text); }
/* 범례: 위 줄은 기준 고르기, 아래 줄은 색 풀이 */
.map-legend { position: absolute; top: var(--s-3); left: var(--s-3); z-index: var(--z-map-ui); display: grid; gap: var(--s-2); justify-items: start; max-width: min(calc(100% - 24px), 520px); padding: var(--s-2) var(--s-3); border-radius: var(--r-md);
  background: color-mix(in srgb, var(--tile) 90%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow-1); font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-2); backdrop-filter: blur(8px); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lg-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); }
.seg.lg-modes { margin-left: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg.lg-modes > button { padding: 5px 11px; min-height: 32px; font-size: var(--fs-xs); }
.lg-heat { border: 1px solid var(--line-2); background: var(--tile); border-radius: var(--r-pill); padding: 5px var(--s-3); min-height: 32px; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-2); }
.lg-heat:hover { border-color: var(--ink-3); color: var(--ink); }
.lg-heat.on { background: var(--warn-soft); color: var(--ink); border-color: var(--warn); }
.lg { width: 12px; height: 12px; border-radius: var(--r-pill); display: inline-block; border: 1.5px solid var(--line-2); background: var(--tile); }
.lg.lg-ok { background: var(--accent); border-color: var(--accent); }
.map-wrap.vw .lg-st-item { display: none; } /* VWorld는 역을 자체 기호로 그린다 */
.lg.lg-st { width: 9px; height: 9px; background: var(--accent); border: 2px solid var(--tile); box-shadow: 0 0 0 1px var(--accent); }
.lg.lg-sl { border: 0; border-radius: 0; background: var(--fav); -webkit-mask: var(--star) center / contain no-repeat; mask: var(--star) center / contain no-repeat; }
.lg-ramp { gap: var(--s-2); }
.lg-ramp small { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lg-bar { display: inline-flex; border-radius: var(--r-pill); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.lg-bar i { width: 22px; height: 10px; background: var(--mk-bg); }
.lg-ramp .lg-note { flex-basis: 100%; font-weight: var(--fw-regular); color: var(--ink-3); }
.map-status { margin: 0; padding: 10px var(--s-4); font-size: var(--fs-sm); color: var(--ink-3); background: var(--tile); border-top: 1px solid var(--line); }
.map-status b { color: var(--ink); font-weight: var(--fw-heavy); }
.map-status span { color: var(--ink-3); }
/* MapLibre 기본 컨트롤을 팔레트로 */
.map-canvas .maplibregl-ctrl-group { background: var(--tile); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-1); }
.map-canvas .maplibregl-ctrl-group button { width: 44px; height: 44px; }
.map-canvas .maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
.map-canvas .maplibregl-ctrl-group button:hover { background-color: var(--tile-2); }
.map-canvas .maplibregl-ctrl-group button .maplibregl-ctrl-icon { background-image: none; background-color: var(--ink-2); -webkit-mask: var(--ic) center / 18px no-repeat; mask: var(--ic) center / 18px no-repeat; }
.map-canvas .maplibregl-ctrl-zoom-in { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.map-canvas .maplibregl-ctrl-zoom-out { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E"); }
.map-canvas .maplibregl-ctrl-attrib { background: color-mix(in srgb, var(--tile) 85%, transparent); color: var(--ink-3); font-size: var(--fs-xs); }
.map-canvas .maplibregl-ctrl-attrib a { color: var(--ink-2); }
.map-canvas .maplibregl-ctrl-attrib.maplibregl-compact { border-radius: var(--r-md); }
.map-canvas .maplibregl-cooperative-gesture-screen { background: color-mix(in srgb, var(--ink) 55%, transparent); font: var(--fw-bold) var(--fs-md)/1.4 var(--font); }
/* 지도 색 기준 (평당가·상승률·입지·연식) — 지도 전용 데이터 램프라 원색 hex를 여기에 둔다.
   순차: 옅은 청록 → 짙은 청록 / 상승률: 파랑(하락) · 모래(0~5%) · 붉은 단계(5·10·20%+). 글자는 모두 4.5:1 이상 */
.mk-q0 { --mk-bg: #eef6f2; --mk-fg: #4b5757; --mk-bd: #cfe6de; }
.mk-q1 { --mk-bg: #c3e5dc; --mk-fg: #0b5a54; }
.mk-q2 { --mk-bg: #7ccbbd; --mk-fg: #0b3d38; }
.mk-q3 { --mk-bg: #2a9d8f; --mk-fg: #04211e; }
.mk-q4 { --mk-bg: #0b5a54; --mk-fg: #fff; }
.mk-d0 { --mk-bg: #2b67a6; --mk-fg: #fff; }
.mk-d1 { --mk-bg: #efe9dd; --mk-fg: #4b5757; --mk-bd: #d6ccba; }
.mk-d2 { --mk-bg: #f6c7ba; --mk-fg: #8a2d1c; }
.mk-d3 { --mk-bg: #ec8f78; --mk-fg: #4a1409; }
.mk-d4 { --mk-bg: #b8432d; --mk-fg: #fff; }
@media (prefers-color-scheme: dark) {
  .mk-q0 { --mk-bg: #1f2d2b; --mk-fg: #b9c6c3; --mk-bd: #36413f; } .mk-q1 { --mk-bg: #1d4a44; --mk-fg: #cfeee8; } .mk-q2 { --mk-bg: #22766b; --mk-fg: #fff; }
  .mk-q3 { --mk-bg: #34b3a1; --mk-fg: #07211e; } .mk-q4 { --mk-bg: #6fe8d6; --mk-fg: #07211e; }
  .mk-d0 { --mk-bg: #4a8fd4; --mk-fg: #07111e; } .mk-d1 { --mk-bg: #2a3433; --mk-fg: #b9c6c3; --mk-bd: #36413f; } .mk-d2 { --mk-bg: #4a2a22; --mk-fg: #ffb3a3; }
  .mk-d3 { --mk-bg: #a0493a; --mk-fg: #fff; } .mk-d4 { --mk-bg: #ff8a72; --mk-fg: #2a0f09; }
}
.mk:is(.mk-q0, .mk-q1, .mk-q2, .mk-q3, .mk-q4, .mk-d0, .mk-d1, .mk-d2, .mk-d3, .mk-d4) { background: var(--mk-bg); color: var(--mk-fg); border-color: var(--mk-bd, var(--mk-bg)); }
.mk.mk-na { background: var(--tile); color: var(--ink-3); border-color: var(--line-2); border-style: dashed; } /* 값 없음 — 흐림 대신 점선 */
.mk:is(.mk-q4, .mk-d0, .mk-d4).mk-sl::before { background: var(--fav-on-accent); }

/* ── 뷰 전환 ── */
::view-transition-old(page) { animation: .16s var(--in) both vt-out; }
::view-transition-new(page) { animation: .38s var(--out) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }
/* 카드 → 상세: 뒤 화면은 제자리에서 어두워지기만 한다. page·nav를 따로 띄우면 화면 전환 효과(사라졌다 떠오름)가 걸리고,
   막(scrim)이 그 아래 깔렸다가 끝에서야 덮인다 */
:root.vt-morph :is(.page, .topnav) { view-transition-name: none; }
/* 상자만 커지고 안의 내용은 원래 크기 그대로 — 카드를 모달 크기로 늘리면 글자가 두 배로 부풀어 보인다.
   카드 내용은 빨리 빠지고, 상세 내용은 커지는 상자 안에서 드러난다 */
::view-transition-group(detail) { animation-duration: .42s; animation-timing-function: var(--out); }
::view-transition-image-pair(detail) { overflow: clip; border-radius: var(--r-2xl); }
::view-transition-old(detail), ::view-transition-new(detail) { width: auto; height: auto; }
::view-transition-old(detail) { animation: .14s var(--in) both vt-fade-out; }
::view-transition-new(detail) { animation: .3s var(--out) .06s both vt-fade-in; }
:root.closing::view-transition-group(detail) { animation-duration: .3s; }
:root.closing::view-transition-old(detail) { animation-duration: .12s; animation-delay: 0s; }
:root.closing::view-transition-new(detail) { animation-duration: .22s; animation-delay: .04s; }
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }

/* 하단 안내와 가이드의 '출처와 안내' */
.about-card { margin-top: var(--s-6); display: grid; gap: var(--s-2); }
.about-card h2 { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-heavy); letter-spacing: -.02em; }
.about-card h3 { margin: var(--s-4) 0 0; font-size: var(--fs-md); font-weight: var(--fw-heavy); }
.about-card p { margin: 0; font-size: var(--fs-sm); line-height: 1.65; }
.about-list { margin: 0; padding: 0 0 0 var(--s-4); display: grid; gap: var(--s-2); font-size: var(--fs-sm); line-height: 1.65; }
.about-src { list-style: none; padding: 0; }
.about-src li { display: grid; gap: 2px; }
.about-src span { color: var(--ink-3); font-size: var(--fs-xs); }
.site-foot { margin: var(--s-8) var(--s-1) 0; padding-top: var(--s-4); border-top: 1px solid var(--line); max-width: 75ch; font-size: var(--fs-xs); color: var(--ink-3); }
.site-foot p { margin: 0; line-height: 1.6; }
.site-foot a { display: inline-flex; align-items: center; min-height: 32px; font-weight: var(--fw-bold); }

/* ── 반응형 — 넓은 화면부터 좁은 화면 순서로 한곳에 ── */
@media (max-width: 1100px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .navmeta { display: none; } }
@media (max-width: 960px) {
  .detail-grid { grid-template-columns: 1fr; }
  .dcol { display: contents; }
  .calc-card { order: 1; } .chart-card { order: 2; } .loc-card { order: 3; } .mini-card { order: 4; } .memo-card { order: 5; } .deals-card { order: 6; }
  .set-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --tabbar-h: 74px; } /* 하단 탭바 바닥 여백 10 + 높이 (테두리 2 · 안쪽 여백 12 · 탭 48) + 여유 2 */
  .topnav { top: auto; bottom: 10px; position: fixed; left: 10px; right: 10px; width: auto; margin: 0; padding: 6px; }
  .topnav .brand { display: none; }
  .tabs { margin: 0; width: 100%; justify-content: space-between; }
  .tabs li { flex: 1; display: flex; }
  .tabs a { flex-direction: column; gap: 2px; padding: 6px var(--s-1); font-size: var(--fs-xs); flex: 1; border-radius: var(--r-xl); min-height: 48px; justify-content: center; position: relative; }
  .tabs .count { position: absolute; top: 2px; right: 10%; line-height: 15px; padding: 0 5px; }
  .help-btn { display: none; }
  .help-fab { display: grid; }
  .page { padding: 66px 14px 110px; }
  .site-foot { padding-bottom: calc(var(--tabbar-h) - var(--s-3)); } /* .page 아래 여백(110px)에 --tabbar-h를 따라 더해, 탭바 위 12px에 뜨는 두 줄 토스트보다 글이 위에 오게 */
  .site-foot a { min-height: 44px; }
  .bento, details.more .bento { grid-template-columns: minmax(0, 1fr); }
  .hero, .span-2 { grid-column: auto; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .fact { grid-template-columns: 1fr auto; align-items: baseline; }
  .fact small { grid-column: 1 / -1; }
  .answer .cta { align-self: stretch; justify-content: center; }
  .search { margin-left: 0; width: 100%; }
  .seg { margin-left: 0; }
  .chip, select.status, .loc select, .lg-heat { min-height: 44px; }
  .seg > :is(button, a), .seg.lg-modes > button { min-height: 44px; }
  .big-card { top: 0; width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
  .glossary { grid-template-columns: 1fr; }
  .check-item { flex-direction: column; align-items: stretch; }
  .marks { justify-content: stretch; } .marks .mark { flex: 1; }
  .todo { grid-template-columns: auto 1fr; }
  .todo-when { grid-column: 2; justify-items: start; grid-auto-flow: column; justify-content: start; align-items: center; gap: var(--s-2); }
  .todo-check { width: 30px; height: 30px; }
  .toast { bottom: calc(var(--tabbar-h) + var(--s-3)); max-width: calc(100vw - 2 * var(--s-4)); } /* 하단 탭바를 덮지 않게 */
  .commute-note .link-btn, .pr-link { min-height: 44px; display: inline-flex; align-items: center; }
  .map-canvas { height: calc(100svh - 300px); min-height: 380px; }
  .map-legend { top: var(--s-2); left: var(--s-2); gap: 2px 10px; padding: 6px 10px; }
  .mini-canvas { height: 200px; }
  .mini-card .link-btn { min-height: 44px; }
  .repay-wrap { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .repay-table, .repay-table tbody { display: block; }
  .repay-table thead { display: none; }
  .repay-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; padding: var(--s-3) var(--gutter); margin-bottom: 10px; background: var(--tile); border: 1px solid var(--line); border-radius: var(--r-lg); }
  .repay-table tr.on { border-color: var(--accent-2); }
  .repay-table :is(th, td, td.num) { border: 0; padding: 0; white-space: normal; text-align: left; }
  .repay-table th[scope="row"] { grid-column: 1 / -1; }
  .repay-table th .link-btn { min-height: 44px; }
  .repay-table td:last-child { grid-column: span 2; }
  .repay-table td::before { content: attr(data-label); display: block; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); }
  .rbars { height: 120px; gap: 1px; }
}
@media (max-width: 420px) { .lf, .ls-row { grid-template-columns: 72px minmax(0, 1fr) auto; gap: var(--s-1) 10px; } .stat > b { font-size: var(--fs-lg); } }

/* ── 움직임 줄이기 — 상태 변화는 남기고 이동만 뺀다 ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .cs-list, ::picker(select), select::picker-icon, .cs-go, .mk, .todo-check, .todo-check::after, .next-card { transition: none !important; }
  }

/* ── 인쇄 (비교 보고서) ── */
@media print {
  .skip, .topnav, .help-fab, .toast, .no-print, .page-seg { display: none !important; }
  body { background: #fff; color: #000; }
  .page { padding: 0 !important; max-width: none !important; }
  .site-foot, .site-foot a { color: #1f2a2a !important; border-color: #ccc; }
  .report-wrap { border: 0; box-shadow: none; overflow: visible; }
  .view.report, .view.report * { color: #1f2a2a !important; }
  .report-table th, .report-table td, .report-table b, .report-table small { color: #1f2a2a !important; }
  .report-table thead th, .report-table tbody th { background: #fff !important; }
  .report-wrap, .report-table { background: #fff !important; }
  .report-table td.best { background: #e6f4f1 !important; color: #0b5a54 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report-table th, .report-table td { border-color: #ccc; }
}

/* 내 직장 — 칸 두 개를 늘 보여 주고, 빈 칸은 점선으로 '채울 자리'를 알린다 */
.work-slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.work-slot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); min-height: 68px; padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--tile-2); }
.work-slot.is-empty { background: none; outline: 1.5px dashed var(--line-2); outline-offset: -1.5px; }
.work-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); }
.work-ico svg { width: 19px; height: 19px; }
.work-slot.is-empty .work-ico { background: var(--tile-2); color: var(--ink-3); }
.work-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.work-txt small { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--ink-3); word-break: keep-all; }
.work-txt b { font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-txt span { font-size: var(--fs-sm); color: var(--ink-3); }
.work-slot .link-btn { flex: none; padding-inline: var(--s-2); color: var(--ink-2); }
.work-slot .link-btn.quiet { color: var(--ink-3); }
.work-slot .link-btn.quiet:hover { color: var(--bad-text); }
.work-slot.is-adding { background: var(--tile-2); outline: none; }
.work-find { flex-basis: 100%; }
.work-card { overflow: visible; } /* 직장 검색 목록이 카드 밖으로 펼쳐지게 */
/* 백업 — 되돌릴 수 없는 초기화는 선으로 떼어 따로 둔다 */
.reset-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-4); margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.reset-row b { font-size: var(--fs-md); }
.reset-row .note { margin: 2px 0 0; }
@media (max-width: 760px) {
  .work-slots { grid-template-columns: minmax(0, 1fr); }
  .reset-row { flex-wrap: wrap; }
  /* 이름이 잘리지 않게: 글은 줄 끝까지 쓰고, 바꾸기·지우기는 아래 줄로 내린다 */
  .work-txt { flex: 1 1 calc(100% - 38px - var(--s-3)); }
  .work-slot .link-btn:first-of-type { margin-left: calc(38px + var(--s-3)); }
}
