/* Novagana 디자인 시스템 v8 · 북쪽 바다
   브랜드: Novagana는 AI를 위한 생각의 도구다. 기준을 주고, 그 기준으로 잰다.
   로고: 기둥 사이 배 위에서 나침반을 보는 선장. 파스텔 하늘색, 남색, 흰 돛.
   화면은 로고에서 나온다: 하늘색 면, 남색 글, 흰 판. 북유럽의 맑고 차분한 톤.

   원칙 (브랜드 정의서의 "그래서 화면은")
   1. 하늘 위에 남색: 바탕은 옅은 하늘, 글은 남색, 판은 흰색. 어두운 환경에서는 밤바다로 뒤집는다.
   2. 전달하려는 것만 둔다: 요소마다 무엇을 전하는지 묻고, 답이 없으면 뺀다. 통계 수치와 장식은 쓰지 않는다.
   3. 선을 쓰지 않는다: 영역은 여백과 면(바탕 톤)으로 나눈다. 머리선, 구분선, 밑줄 표시가 없다.
      예외는 데이터인 선뿐이다: 사이트맵과 마인드맵의 가지, 아트보드의 상태 테두리, 매핑 칸, 키보드 초점.
      그림자는 사용자의 화면(아트보드)과 떠 있는 판에만 쓴다.
   4. 부드러운 모서리: 로고 타일처럼 모서리 6px, 떠 있는 판 10px. 둥근 알약 모양은 없다.
   5. 색은 뜻이 있을 때만: 위반(빨강), 경고와 바뀜(호박), 더함(초록), 옮김(보라). 고른 것은 하늘색 면,
      주된 동작은 로고의 남색. 링크와 초점도 남색 계열. 그러데이션은 쓰지 않는다.
   사용자의 화면(아트보드)은 사용자의 것이라 브랜드 색을 입히지 않고 중립으로 둔다.
   클래스 이름은 OCaml 화면 코드와 같다. */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&family=Noto+Serif+KR:wght@600;700&family=EB+Garamond:ital,wght@0,500;0,600;1,400;1,500&display=swap");

/* ================= 1. 토큰 ================= */
:root {
  color-scheme: light;
  /* 브랜드: 로고의 색 그대로 */
  --brand: #1a345d;       /* 남색: 주된 동작 */
  --brand-sky: #bfd9ef;   /* 하늘색 */
  --brand-sail: #f9fbfd;  /* 흰 돛 */
  /* 면 */
  --bg: #f3f6f9;          /* 옅은 하늘: 쪽 바탕 */
  --bg-2: #ffffff;        /* 하늘 위에 놓인 흰 판 */
  --bg-3: #e4ecf4;        /* 누름, 입력칸 */
  --bg-4: #d3e3f1;        /* 고른 것: 로고 하늘색에 가깝게 */
  --desk: #eaf0f6;        /* 아트보드를 펼치는 책상 */
  --rule: #d5dfea;        /* 데이터인 선만 */
  --rule-2: #e6edf4;
  /* 글 */
  --tx: #1a2c47;          /* 남색 먹 */
  --tx-2: #4a5a70;
  --tx-3: #566579;
  --on-ink: #f9fbfd;      /* 남색 위의 글 */
  /* 뜻이 있는 색 */
  --link: #1f5aa6;
  --focus: #1f5aa6;
  --error: #b8322a;
  --warn: #8a5a00;
  --added: #1d7046;
  --moved: #5e46b8;
  --modified: #8a5a00;
  --error-bg: #fbeceb;
  --warn-bg: #fbf2e1;
  --added-bg: #e4f3ea;
  /* 사용자의 화면(아트보드)은 늘 밝고 중립이다 */
  --paper: #ffffff;
  --surface: #ffffff;
  --sunk: #f1f2f4;
  --ink: #1b1d1f;
  --ink-2: #565a60;
  --ink-3: #8b9097;
  --line: #dcdee2;
  --line-2: #ecedf0;
  /* 마인드맵 가지: 가지를 구분하는 색 */
  --br1: #2f6bc4; --br2: #23866b; --br3: #b86a1c; --br4: #6f55c9; --br5: #c2466d; --br6: #5b8a24; --br7: #1f8aa8; --br8: #9a7d12;
  /* 디자인 명세(spec/token)의 이름: 작업대 = 앱 바탕 */
  --ground: var(--bg); --ground-2: var(--bg-2); --ground-3: var(--bg-3);
  --fg: var(--tx); --fg-2: var(--tx-2); --fg-3: var(--tx-3);

  --sans: "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  --num: "EB Garamond", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --t-xs: 11px; --t-sm: 13px; --t-md: 15px; --t-lg: 22px; --t-xl: 28px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r: 6px; --r-sm: 4px; --r-lg: 10px;
  --tap: 44px;
  --lift: 0 10px 30px rgba(26,52,93,.12);
  --lift-sm: 0 6px 20px rgba(26,52,93,.10);
  --scrim: rgba(14,23,36,.36);
  --rail: 232px; --bar: 52px; --sub: 44px; --tabs: 58px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #bfd9ef; --brand-sky: #24364f;
    --bg: #0e1724; --bg-2: #142033; --bg-3: #1b2a40; --bg-4: #26395a; --desk: #0b131e;
    --rule: #2a3a52; --rule-2: #1c2a3d;
    --tx: #e6eef7; --tx-2: #a8b8cc; --tx-3: #8899b0; --on-ink: #0e1724;
    --link: #9cc6ee; --focus: #9cc6ee;
    --error: #ff7a6a; --warn: #f0b955; --added: #6fd394; --moved: #b9a9ff; --modified: #f0b955;
    --error-bg: #3a1f1f; --warn-bg: #33291a; --added-bg: #16301f;
    --br1: #8ab4f0; --br2: #5cc7a6; --br3: #e09a5a; --br4: #b79bff; --br5: #ec8aa8; --br6: #9ccf6a; --br7: #5fc4e3; --br8: #d6c060;
    --lift: 0 14px 36px rgba(0,0,0,.5);
    --lift-sm: 0 8px 24px rgba(0,0,0,.42);
    --scrim: rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #bfd9ef; --brand-sky: #24364f;
  --bg: #0e1724; --bg-2: #142033; --bg-3: #1b2a40; --bg-4: #26395a; --desk: #0b131e;
  --rule: #2a3a52; --rule-2: #1c2a3d;
  --tx: #e6eef7; --tx-2: #a8b8cc; --tx-3: #8899b0; --on-ink: #0e1724;
  --link: #9cc6ee; --focus: #9cc6ee;
  --error: #ff7a6a; --warn: #f0b955; --added: #6fd394; --moved: #b9a9ff; --modified: #f0b955;
  --error-bg: #3a1f1f; --warn-bg: #33291a; --added-bg: #16301f;
  --br1: #8ab4f0; --br2: #5cc7a6; --br3: #e09a5a; --br4: #b79bff; --br5: #ec8aa8; --br6: #9ccf6a; --br7: #5fc4e3; --br8: #d6c060;
  --lift: 0 14px 36px rgba(0,0,0,.5);
  --lift-sm: 0 8px 24px rgba(0,0,0,.42);
  --scrim: rgba(0,0,0,.5);
}

/* ================= 2. 바탕 ================= */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: var(--t-sm)/1.55 var(--sans); color: var(--tx); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, input, select, textarea { border: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* 번호는 주소다: 기울인 세리프. 점은 포함 관계만 뜻한다 (3.21은 3.2 아래) */
.num, .cnum, .sk-n, .card-head .num { font-family: var(--num); font-style: italic; font-weight: 500; letter-spacing: 0; font-variant-numeric: lining-nums; color: var(--tx-3); }
.num, .card-head .num { font-size: 1.1em; }
.cnum { min-width: 2.6em; display: inline-block; font-size: 1.05em; }
.sk-num::before { content: none; }
.sk-n { margin-right: .4em; }

/* ================= 3. 조각: 버튼, 입력칸, 고르개 ================= */
.btn { border-radius: var(--r); padding: 11px 18px; font-weight: 600; font-size: var(--t-md); line-height: 1.2; min-height: var(--tap); }
.btn.primary { background: var(--brand); color: var(--on-ink); }
.btn.primary:hover { filter: brightness(1.15); }
.btn.quiet { background: var(--bg-3); color: var(--tx-2); }
.btn.quiet:hover { color: var(--tx); background: var(--bg-4); }
.btn[disabled] { opacity: .35; cursor: default; }
.row { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s2); }

.field { width: 100%; padding: 11px 13px; border-radius: var(--r); background: var(--bg-3); color: var(--tx); font-size: var(--t-md); outline: none; }
.field::placeholder { color: var(--tx-3); }
.field:focus { background: var(--bg-4); }
.field-label { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.field-name { font-size: var(--t-sm); color: var(--tx-2); font-weight: 600; }
.form-error { color: var(--error); font-size: var(--t-md); }
.fields { display: flex; flex-direction: column; gap: 4px; }
.fields .field { width: auto; padding: 0; background: none; color: var(--tx-2); font: var(--t-sm) var(--mono); box-shadow: none; }

/* 막대 안의 칸 고르개 */
.seg, .act { background: none; color: var(--tx-2); padding: 7px 12px; border-radius: var(--r); white-space: nowrap; text-decoration: none; }
.seg:hover, .act:hover { color: var(--tx); background: var(--bg-3); }
.seg.on, .act.on { color: var(--tx); background: var(--bg-2); font-weight: 600; box-shadow: 0 1px 2px rgba(26,52,93,.10); }
select.act { appearance: none; padding-right: 12px; }
select.act option { color: #000; }
.segs { display: flex; gap: 2px; }
.more { align-self: flex-start; background: none; color: var(--tx-2); padding: 8px 0; min-height: 40px; }
.more:hover { color: var(--tx); }

/* ================= 4. 틀: 레일, 위 막대, 휴대폰 막대 ================= */
.app { position: relative; height: 100vh; overflow: hidden; }
.main { position: absolute; inset: 0; display: flex; }

.top { position: absolute; z-index: 5; top: 0; left: 0; right: 0; height: var(--bar); display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 0 var(--s4); pointer-events: none; }
.dock { pointer-events: auto; display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--bg-3); border-radius: var(--r-lg); font-size: 14px; }
.dock.tools:empty, .with-rail .tools:empty { display: none; }
.brand { font-weight: 700; padding: 0 var(--s3) 0 var(--s2); white-space: nowrap; color: var(--tx); text-decoration: none; }
.crumb { color: var(--tx-2); padding: 0 var(--s1) 0 var(--s3); white-space: nowrap; text-decoration: none; }
.crumb:hover { color: var(--tx); }
.org-name, .who { color: var(--tx-2); padding: 0 var(--s3); white-space: nowrap; }
.patch-name { color: var(--tx); font-weight: 600; padding: 0 var(--s3); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.view-chip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.view-chip.viewing { color: var(--warn); font-weight: 600; }

/* 레일: 다섯 영역. 종이 위에 머리선 하나로 나뉜다 */
.rail { position: fixed; z-index: 7; left: 0; top: 0; bottom: 0; width: var(--rail); display: flex; flex-direction: column; gap: 1px;
  padding: var(--s4) var(--s3) var(--s3); background: var(--bg-3); overflow-y: auto; scrollbar-width: none; }
.rail a { text-decoration: none; color: inherit; }
.rail-brand { display: block; padding: 6px var(--s3) var(--s4); color: var(--tx) !important; line-height: 0; }
.rail-brand svg { display: block; height: 26px; width: auto; }
.rail-ctx { margin: 0 0 var(--s3); padding: var(--s3); display: flex; flex-direction: column; gap: 2px; }
.rail-org { color: var(--tx-3); font-size: var(--t-xs); letter-spacing: .02em; }
.rail-project { color: var(--tx) !important; font-weight: 700; font-size: var(--t-md); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-area { display: flex; flex-direction: column; margin-top: var(--s3); }
.rail-head { padding: 6px var(--s3); border-radius: var(--r); color: var(--tx-3); font-weight: 600; font-size: var(--t-xs); letter-spacing: .04em; }
.rail-head:hover { background: var(--bg-4); color: var(--tx); }
.rail-head.on, .rail-area.cur .rail-head { color: var(--tx-2); }
.rail-head.off { color: var(--tx-3); cursor: default; }
.rail-head.off:hover { background: none; }
.rail-items { display: flex; flex-direction: column; gap: 1px; padding: 1px 0 var(--s1); }
.rail-item { position: relative; display: flex; align-items: baseline; gap: var(--s2); padding: 7px var(--s3); border-radius: var(--r); color: var(--tx); font-size: 14px; }
.rail-item:hover { background: var(--bg-4); color: var(--tx); }
.rail-item.on { background: var(--bg-2); color: var(--brand) !important; font-weight: 600; }
.rail-count { margin-left: auto; font: italic 500 14px/1 var(--num); color: var(--tx-3); }
.rail-who { margin-top: auto; padding: 10px var(--s3); color: var(--tx-2) !important; font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-who:hover, .rail-who.on { color: var(--tx) !important; background: var(--bg-4); }

.with-rail .main { left: var(--rail); }
.with-rail .top { left: var(--rail); }
.with-rail .appbar { pointer-events: auto; display: flex; align-items: center; gap: var(--s2); visibility: hidden; }
.tabbar, .subnav { display: none; }
.appbar-mark { display: none; flex: none; color: var(--tx); line-height: 0; }
.appbar-mark svg { width: 24px; height: 24px; }

/* ================= 5. 캔버스: 책상 위의 아트보드 ================= */
.viewport { position: relative; flex: 1; overflow: hidden; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  background-color: var(--desk); }
.viewport:active { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.e-tree { fill: none; stroke: var(--tx-3); stroke-width: 1.5; stroke-linejoin: miter; }
.e-attach { fill: none; stroke: var(--tx-3); stroke-width: 1.5; stroke-dasharray: 2 6; }
.e-nav { fill: none; stroke-width: 2; }
.e-nav.out { stroke: var(--focus); }
.e-nav.in { stroke: var(--tx-3); }
.e-nav.open { stroke-dasharray: 8 6; }
.arrowhead { fill: var(--focus); }

.card { position: absolute; display: flex; flex-direction: column; }
.card-head { flex: none; height: 30px; display: flex; align-items: baseline; gap: var(--s2); padding: 0 2px; color: var(--tx-2); font-size: var(--t-md); white-space: nowrap; overflow: hidden; }
.card-head .label { overflow: hidden; text-overflow: ellipsis; }
.card-head .from { margin-left: auto; color: var(--moved); }
.card-body { flex: 1; overflow: hidden; cursor: auto; color: var(--ink); background: var(--paper); border-radius: var(--r); box-shadow: var(--lift); }
.card.k-panel .card-body, .card.k-modal .card-body { background: var(--surface); }
.card.k-group { justify-content: center; align-items: center; background: var(--bg-2); border-radius: var(--r); cursor: pointer; }
.card.k-group .card-head { height: auto; color: var(--tx); font-size: 22px; font-weight: 700; letter-spacing: -.01em; padding: 0 var(--s3); }
.card.k-group.sel { background: var(--bg-4); }
.card.sel .card-head { color: var(--tx); font-weight: 600; }
.card.sel .card-body { box-shadow: 0 0 0 2px var(--tx), var(--lift); }
.card.has-warning .card-head { color: var(--warn); }
.card.has-warning .card-body { box-shadow: 0 0 0 2px var(--warn), var(--lift); }
.card.has-error .card-head { color: var(--error); }
.card.has-error .card-body { box-shadow: 0 0 0 2px var(--error), var(--lift); }
.card.sel.has-warning .card-body, .card.sel.has-error .card-body { box-shadow: 0 0 0 2px var(--tx), var(--lift); }
.card.dim { opacity: .18; }
.card.d-added .card-body { box-shadow: 0 0 0 2px var(--added), var(--lift); }
.card.d-modified .card-body { box-shadow: 0 0 0 2px var(--modified), var(--lift); }
.card.d-moved .card-body { box-shadow: 0 0 0 2px var(--moved), var(--lift); }
.card.d-removed { opacity: .45; }
.card.d-removed .card-body { box-shadow: 0 0 0 2px var(--error), var(--lift); filter: grayscale(1); }
.card.d-added .card-head { color: var(--added); }
.card.d-moved .card-head { color: var(--moved); }
.card.d-removed .card-head { color: var(--error); text-decoration: line-through; }
.card-body.framed { position: relative; background: #fff; }
.card-body.framed iframe { display: block; transform-origin: 0 0; pointer-events: none; background: #fff; }
.card.sel .card-body.framed iframe { pointer-events: auto; }
.slot-chip { color: var(--link); cursor: pointer; padding: var(--s1) 0; font-size: var(--t-xs); }

.zoom { position: absolute; right: var(--s4); bottom: var(--s4); display: flex; gap: 2px; padding: 3px; background: var(--bg-3); border-radius: var(--r-lg); }
.zoom button { background: none; color: var(--tx-2); min-width: 36px; height: 32px; border-radius: var(--r); font-variant-numeric: tabular-nums; }
.zoom button:hover { background: var(--bg-4); color: var(--tx); }

/* 테두리 색의 뜻 */
.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s4); font-size: var(--t-xs); color: var(--tx-2); }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 14px; height: 10px; box-shadow: inset 0 0 0 2px var(--tx-3); }
.lg-added .sw { box-shadow: inset 0 0 0 2px var(--added); }
.lg-modified .sw { box-shadow: inset 0 0 0 2px var(--modified); }
.lg-moved .sw { box-shadow: inset 0 0 0 2px var(--moved); }
.lg-removed .sw { box-shadow: inset 0 0 0 2px var(--error); opacity: .5; }
.lg-error .sw { box-shadow: inset 0 0 0 2px var(--error); }

/* ================= 6. 사용자의 화면 (아트보드 안, 늘 밝다) ================= */
.v-root { padding: var(--s3); height: 100%; font-size: var(--t-xs); color: var(--ink); }
.v-box { display: flex; gap: var(--s2); min-width: 0; }
.v-row { flex-direction: row; align-items: flex-start; }
.v-col { flex-direction: column; flex: 1; }
.v-text { line-height: 1.4; overflow: hidden; text-overflow: ellipsis; }
.v-title { font-size: var(--t-sm); font-weight: 600; }
.v-muted { color: var(--ink-3); }
.v-badge { color: var(--ink-2); white-space: nowrap; }
.v-field { border-radius: var(--r); padding: var(--s1) var(--s2); color: var(--ink-3); }
.v-list { display: flex; flex-direction: column; gap: 2px; }
.v-item { padding: var(--s1) var(--s2); background: var(--sunk); border-radius: var(--r); }
.v-item .v-row { justify-content: space-between; }
.v-click { cursor: pointer; }
.v-click:hover { background: var(--line-2); }
.v-empty { padding: var(--s2) 0; color: var(--ink-3); }
.v-input { display: flex; flex-direction: column; gap: 2px; color: var(--ink-2); }
.v-input input { font-size: var(--t-xs); border-radius: var(--r); padding: 3px var(--s1); background: var(--surface); color: var(--ink); }
.v-btn { flex: none; align-self: flex-start; white-space: nowrap; border-radius: var(--r); background: var(--ink); color: var(--surface); padding: 2px var(--s2); font-size: var(--t-xs); }
.v-btn + .v-btn { background: var(--surface); color: var(--ink); }
.v-link { color: #1d4ed8; text-decoration: none; align-self: center; white-space: nowrap; }
.v-link:hover { opacity: .75; }
.v-slot { width: 30%; flex: none; display: flex; flex-direction: column; }
.v-slot:empty { display: none; }
.v-comp { background: var(--sunk); padding: var(--s1); color: var(--ink-3); }
.v-nav { width: 92px; flex: none; align-self: stretch; background: var(--sunk); padding: var(--s1) 0; }
.v-nav-brand { font-weight: 600; padding: 2px var(--s2) var(--s1); }
.v-nav-group { padding: 2px var(--s2); color: var(--ink-2); cursor: pointer; }
.v-nav-group.open { color: var(--ink); font-weight: 600; }
.v-nav-item { padding: 2px var(--s2) 2px var(--s4); color: var(--ink-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-nav-group.d1 { padding-left: var(--s4); }
.v-nav-item.d1 { padding-left: var(--s5); }
.v-nav-item.on { color: var(--ink); font-weight: 600; background: var(--surface); }
.v-none { display: none; }

/* 빌드본 (사용자의 앱 그 자체) */
.app-page { background: var(--surface); color: var(--ink); }
.app-shell { height: 100vh; }
.app-shell > .v-root { font-size: 14px; padding: 0; }
.app-shell > .v-root > .v-box { height: 100%; }
.app-page .v-root { font-size: 14px; }
.app-page .v-title { font-size: 22px; margin-bottom: var(--s2); }
.app-page .v-nav { width: 200px; font-size: var(--t-sm); padding: var(--s3) 0; min-height: 100vh; }
.app-page .v-nav-brand { font-size: var(--t-md); padding: var(--s1) var(--s4) var(--s3); }
.app-page .v-nav-group { padding: 6px var(--s4); }
.app-page .v-nav-item { padding: 5px var(--s4) 5px 26px; }
.app-page .v-nav-item.d1 { padding-left: 36px; }
.app-page .v-col { padding: var(--s4); gap: var(--s3); }
.app-page .v-row > .v-col { max-width: 900px; }
.app-page .v-box .v-box .v-col { padding: 0; }
.app-page .v-input { font-size: 12px; max-width: 360px; }
.app-page .v-input input { font-size: 14px; padding: 7px 9px; }
.app-page .v-btn { font-size: var(--t-sm); padding: 6px 14px; }
.app-page .v-item { padding: var(--s2) 0; }
.app-page .v-field { max-width: 360px; padding: var(--s2); }
.app-page .v-slot { width: 320px; background: var(--sunk); min-height: 100vh; }
.app-page .panel .v-root { padding: var(--s4); }
.app-page .v-root.v-screen > .v-col { max-width: 380px; margin: 60px auto; }
.modal-back { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; }
.modal { background: var(--surface); border-radius: var(--r-lg); width: 420px; box-shadow: var(--lift); }
.modal .v-root { padding: var(--s5); }

/* 화면 한 장 미리보기 */
.before { height: 260px; overflow: hidden; border-radius: var(--r); background: var(--paper); color: var(--ink); }
.shot { position: relative; overflow: hidden; width: 340px; }
.shot .frame { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.shot.plain { max-height: 420px; overflow: auto; }

/* ================= 7. 쪽: 읽는 화면의 공통 틀 ================= */
.tree-view, .matrix-view, .changes-view, .page-view { flex: 1; overflow: auto; padding: calc(var(--bar) + var(--s5)) var(--s6) 64px; }
.empty-view { flex: 1; display: flex; align-items: center; justify-content: center; }
.pv-wrap { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s5); }
.pv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; padding-bottom: var(--s4); }
.pv-title { font-size: var(--t-xl); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.page-title { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; padding-bottom: var(--s4); margin-bottom: var(--s6); }

/* 판: 종이 위에 놓인 종이. 머리선으로만 나뉜다 */
.rule-block, .fact, .vg.open, .pc.open, .ptab, .pp-change, .pp-next, .pp-rival, .sk, .pmap, .tile {
  background: var(--bg-2); border-radius: var(--r); }


/* 검증 */
.rule-block { padding: var(--s4) var(--s5); }
.rule-head { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s2); padding-bottom: var(--s2); }
.rule-name { font-weight: 700; font-size: var(--t-md); color: var(--tx); text-decoration: none; }
a.rule-name:hover { opacity: .75; }
.rule-name.error { color: var(--error); } .rule-name.warning { color: var(--warn); }
.rule-issues .issue, .rule-issues .issue.warning, .rule-issues .issue.error { color: var(--tx); }
.issue { font-size: var(--t-md); line-height: 1.5; padding: 5px 0; cursor: pointer; }
.issue.warning { color: var(--warn); }
.issue.error { color: var(--error); }
.issue.resolved { color: var(--added); cursor: default; text-decoration: line-through; }
.issue:not(.resolved):hover { background: var(--bg-3); }
.idol { color: var(--tx-3); margin-right: var(--s2); white-space: nowrap; }
.issue.warning .idol, .issue.error .idol { color: inherit; opacity: .75; }

/* 표현 */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.fact { padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: 4px; }
.fact-name { color: var(--tx-3); font-size: var(--t-sm); }
.fact-val { font-size: var(--t-md); line-height: 1.55; }

/* 낱말과 참조 */
.synopsis { max-width: 760px; margin: 0 auto var(--s6); font-size: 18px; line-height: 1.8; color: var(--tx-2); }
.term, .ref { color: var(--link); text-decoration: none; padding-bottom: 1px; }
.term:hover, .term.sel, .ref:hover, .ref.sel { color: var(--link); }
.term.missing, .ref.missing { color: var(--error); }
.defs { margin-top: var(--s3); display: flex; flex-direction: column; gap: 4px; }
.def { color: var(--tx-2); font-size: var(--t-md); line-height: 1.6; }
.desc { margin-top: var(--s4); padding: 12px 14px; background: var(--bg-3); border-radius: var(--r); color: var(--tx-2); line-height: 1.7; }
.cdiff { color: var(--tx-2); font-size: var(--t-sm); margin-left: 10px; }

/* 여백 주석: 데스크톱은 오른쪽 여백 단, 휴대폰은 그 줄 바로 아래 */
.with-margin { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 6px 40px; align-items: baseline; }
.marg { color: var(--tx-3); font-size: var(--t-sm); line-height: 1.55; }
.marg.warning { color: var(--warn); }
.marg.error { color: var(--error); }
/* 꼬리말: 쪽 끝 오른쪽에 같은 층 다음 항목의 이름 */
.catch { display: flex; justify-content: flex-end; padding: var(--s6) 0 var(--s2); margin-top: var(--s5); }
.catch a { color: var(--tx-2); text-decoration: none; font-size: var(--t-md); min-height: var(--tap); display: inline-flex; align-items: center; gap: var(--s2); }
.catch a .cnum { min-width: 0; }
.catch a:hover { color: var(--tx); }

/* ================= 8. 개념 체계, 매핑 ================= */
.tree { max-width: 760px; margin: 0 auto; }
.crow { display: flex; align-items: baseline; gap: var(--s3); padding: 8px var(--s4); border-radius: var(--r); cursor: pointer; color: var(--tx-2); }
.crow:hover { background: var(--bg-3); }
.crow.sel { background: var(--bg-4); color: var(--tx); }
.crow.d0 { color: var(--tx); margin-top: var(--s2); }
.crow.d0 .clabel { font-size: var(--t-xl); font-weight: 700; letter-spacing: -.015em; }
.crow.d1 { margin-top: var(--s4); color: var(--tx); border-radius: 0; padding-top: var(--s3); }
.crow.d1 .clabel { font-size: 19px; font-weight: 600; }
.crow.d2 .clabel, .crow.d3 .clabel { font-size: var(--t-md); }
.cfacet { color: var(--tx-3); font-size: var(--t-sm); }
.cfacet .ref { color: inherit; }
.crow.has-warning .clabel, .crow.has-warning .cnum { color: var(--warn); }
.crow.has-error .clabel, .crow.has-error .cnum { color: var(--error); }
.crow.d-added .clabel { color: var(--added); }
.crow.d-removed .clabel { color: var(--error); text-decoration: line-through; }
.crow.d-modified .clabel { color: var(--modified); }
.crow.d-moved .clabel { color: var(--moved); }
.crow.dim { opacity: .3; }
.crow.ctx { opacity: .55; }
.crow.in-facet { background: var(--bg-3); color: var(--tx); }
.cwhy { color: var(--tx-2); font-size: var(--t-sm); margin-left: 10px; }
.cnone { padding: var(--s4); color: var(--tx-2); }
.csearch { position: sticky; top: -20px; z-index: 2; max-width: 760px; margin: 0 auto var(--s5); background: var(--bg); padding: var(--s2) 0; }
.csearch-input { width: 100%; padding: 12px var(--s4); background: var(--bg-3); color: var(--tx); border-radius: var(--r); font-size: 16px; outline: none; }
.csearch-input:focus { background: var(--bg-4); }
.csearch-input::placeholder { color: var(--tx-3); }
.facets { display: flex; flex-direction: column; gap: 0; margin-top: var(--s6); }
.frow { display: flex; align-items: baseline; gap: var(--s4); padding: 12px var(--s4); cursor: pointer; }
.frow:hover, .frow.sel { background: var(--bg-3); }
.frow .fname { color: var(--tx); font-weight: 600; min-width: 120px; }
.frow .fvals { display: flex; flex-wrap: wrap; gap: var(--s3); color: var(--tx-2); }
.frow .fq { color: var(--tx-2); min-width: 220px; }
.frow.has-warning .fname { color: var(--warn); }

.matrix-scroll { overflow: auto; max-height: calc(100vh - 140px); }
.matrix { border-collapse: separate; border-spacing: 2px; font-size: var(--t-xs); margin: 0 auto; }
.matrix .corner { position: sticky; left: 0; top: 0; z-index: 3; background: var(--bg); min-width: 150px; }
.matrix th.col { position: sticky; top: 0; z-index: 2; background: var(--bg); height: 140px; vertical-align: bottom; padding: var(--s1) 0; cursor: pointer; font-weight: 400; color: var(--tx-3); }
.matrix th.col div { writing-mode: vertical-rl; white-space: nowrap; margin: 0 auto; }
.matrix th.col:hover, .matrix th.col.sel { color: var(--tx); }
.matrix th.col.orphan { color: var(--error); }
.matrix .rowh { position: sticky; left: 0; z-index: 1; background: var(--bg); text-align: left; font-weight: 400; white-space: nowrap; cursor: pointer; padding-right: var(--s4); color: var(--tx-2); font-size: var(--t-sm); }
.matrix .rowh:hover { color: var(--tx); }
.matrix td { width: 20px; min-width: 20px; height: 20px; background: var(--bg-3); font-size: 0; }
.matrix td.cell { background: var(--bg-2); box-shadow: inset 0 0 0 1.5px var(--tx-2); }
.matrix td.cell.primary { background: var(--tx); box-shadow: none; }
.mrow.unmapped .rowh { color: var(--error); }
.mrow.scattered .rowh { color: var(--warn); }
.mrow.scattered td.cell { box-shadow: inset 0 0 0 1.5px var(--warn); }
.mrow.scattered td.cell.primary { background: var(--warn); }

/* ================= 9. 마인드맵 (개념 체계, 사이트맵) =================
   카드 없이 글자와 선. 최상위 가지마다 색 하나(--b), 아래로 물려준다. 이름은 먹, 상태는 이름 뒤 네모로. */
.mm-view { flex: 1; display: flex; flex-direction: column; min-width: 0; padding-top: var(--bar); }
.mm-head { flex: none; display: flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s6) var(--s3); }
.mm-title { font-size: var(--t-lg); font-weight: 700; letter-spacing: -.02em; }
.mm-levels { display: flex; gap: 2px; padding: 2px; border-radius: var(--r-lg); background: var(--bg-3); }
.mm-levels .act { padding: 4px 12px; }
.mm-scroll { flex: 1; overflow: auto; padding: var(--s5) var(--s6) 120px; }
.main:has(> .side:not(.hidden)) .mm-scroll { padding-right: 440px; }
.mm { --b: var(--tx-3); display: flex; flex-direction: column; gap: var(--s3); width: max-content; }
.mm-colored { display: contents; }
.mm-node { display: flex; align-items: center; }
.mm-label { flex: none; display: flex; align-items: center; gap: 4px; max-width: 280px; }
.mm-name { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 0; background: none; color: var(--tx); text-align: left;
  padding: 4px 8px; border-radius: var(--r) var(--r) 0 0; font-size: var(--t-sm); line-height: 1.35; }
.mm-name > span:first-child { white-space: nowrap; }
.mm-name:hover { background: var(--bg-3); }
.mm-sub { color: var(--tx-3); font-size: var(--t-xs); }
.mm-root > .mm-label .mm-name { font-size: 20px; font-weight: 700; border-bottom-color: var(--tx); padding: 6px 10px; }
.mm-kids > .mm-branch > .mm-colored > .mm-node > .mm-label .mm-name,
.mm-root > .mm-kids > .mm-branch > .mm-colored > .mm-node > .mm-label .mm-name { font-size: var(--t-md); font-weight: 700; }
.mm-label.k-group .mm-name { font-weight: 700; }
.mm-fold { flex: none; min-width: 26px; height: 22px; padding: 0 6px; border: 0; border-radius: var(--r); background: var(--bg-3); color: var(--tx-2); font: italic 500 13px/1 var(--num); }
.mm-fold:hover { background: var(--bg-4); color: var(--tx); }
.mm-label.sel .mm-name { background: var(--bg-4); box-shadow: 0 0 0 2px var(--tx); }
.mm-label.has-warning .mm-name > span:first-child::after, .mm-label.has-error .mm-name > span:first-child::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; vertical-align: middle; background: var(--warn); }
.mm-label.has-error .mm-name > span:first-child::after { background: var(--error); }
.mm-label.d-added .mm-sub { color: var(--added); }
.mm-label.d-modified .mm-sub { color: var(--modified); }
.mm-label.d-moved .mm-sub { color: var(--moved); }
.mm-label.d-removed .mm-name > span:first-child { text-decoration: line-through; color: var(--tx-3); }
.mm-label.dim { opacity: .35; }
/* 선: 부모 글자에서 가로로 나와 세로 등뼈를 타고 아이들에게 (직각) */
.mm-kids { position: relative; display: flex; flex-direction: column; padding-left: 0; }
.mm-kids::before { content: ""; position: absolute; left: 0; top: 50%; width: 22px; border-top: 2px solid var(--b); }
.mm-kids > .mm-branch { margin-left: 22px; }
.mm-branch { position: relative; padding: 3px 0 3px 22px; }
.mm-branch::before { content: ""; position: absolute; left: 0; top: 50%; width: 22px; border-top: 2px solid var(--b); }
.mm-branch::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--b); }
.mm-branch:first-child::after { top: 50%; border-top: 2px solid var(--b); border-top-left-radius: 10px; width: 10px; }
.mm-branch:first-child::before, .mm-branch:last-child::before { left: 10px; width: 12px; }
.mm-branch:last-child::after { bottom: calc(50% - 2px); border-bottom: 2px solid var(--b); border-bottom-left-radius: 10px; width: 10px; }
.mm-branch:only-child::after { display: none; }
.mm-branch:only-child::before { left: 0; width: 22px; }
.mm-shot { margin-left: var(--s3); border-radius: var(--r); overflow: hidden; box-shadow: var(--lift); background: var(--paper); }
.mm-shot .shot.plain { width: 340px; max-height: 260px; overflow: hidden; color: var(--ink); }

/* 들여쓴 사이트맵 (휴대폰): 들어가기와 경로 */
.outline-view { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
.outline { display: flex; flex-direction: column; gap: 0; padding: 0 var(--s3) var(--s6); }
.ol-item { display: flex; align-items: stretch; gap: 2px; }
.ol-item > .ol-row { flex: 1; min-width: 0; }
.ol-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s2); width: 100%; min-height: 48px; text-align: left; border-radius: var(--r);
  padding: 11px var(--s3) 11px calc(var(--s3) + var(--depth, 0) * 18px); background: none; color: var(--tx); font-size: var(--t-md); }
.ol-row:hover { background: var(--bg-3); }
.ol-row.sel { background: var(--bg-4); }
.ol-row .num { min-width: 2.2em; }
.ol-label { flex: 1; min-width: 0; }
.ol-row.k-group .ol-label { font-weight: 700; }
.ol-row.k-panel .ol-label, .ol-row.k-modal .ol-label { color: var(--tx-2); }
.ol-kind { color: var(--tx-3); font-size: var(--t-xs); }
.ol-change { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--tx-2); }
.ol-change::before { content: ""; width: 9px; height: 9px; background: var(--tx-3); }
.d-added .ol-change::before { background: var(--added); } .d-added .ol-change { color: var(--added); }
.d-modified .ol-change::before { background: var(--modified); } .d-modified .ol-change { color: var(--modified); }
.d-moved .ol-change::before { background: var(--moved); } .d-moved .ol-change { color: var(--moved); }
.d-removed .ol-change::before { background: var(--error); } .d-removed .ol-label { text-decoration: line-through; color: var(--tx-3); }
.ol-issue { flex-basis: 100%; padding-left: 2.6em; font-size: var(--t-sm); line-height: 1.5; color: var(--warn); }
.ol-row.has-error .ol-issue { color: var(--error); }
.ol-row.has-error .ol-label { color: var(--tx); }
.ol-row.dim { opacity: .45; }
.ol-issue a.ref { color: inherit; }
.ol-warn { font-size: var(--t-sm); color: var(--warn); white-space: nowrap; }
.ol-enter { flex: none; align-self: center; min-width: 48px; min-height: 40px; padding: 0 10px; border-radius: var(--r); background: var(--bg-3);
  color: var(--tx-2); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.ol-enter:hover, .ol-enter:active { background: var(--bg-4); color: var(--tx); }
.ol-path { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; padding: var(--s2) var(--s3);
  background: var(--bg); }
.ol-path .ol-up { margin-right: var(--s2); padding: 6px 10px; border-radius: var(--r); background: var(--bg-3); color: var(--tx); font-size: var(--t-sm); }
.ol-crumb { padding: 4px 2px; background: none; color: var(--tx-2); font-size: var(--t-sm); }
.ol-crumb + .ol-crumb::before { content: "›"; margin-right: 4px; color: var(--tx-3); }
.ol-crumb.here { color: var(--tx); font-weight: 700; }

/* ================= 10. 떠 있는 판: 옆 패널, 보기 고르기 ================= */
.side { position: absolute; z-index: 4; top: calc(var(--bar) + var(--s2)); right: var(--s4); max-height: calc(100vh - var(--bar) - 24px); width: 400px; overflow: auto;
  padding: var(--s5) var(--s5) var(--s6); background: var(--bg-2); border-radius: var(--r-lg); box-shadow: var(--lift-sm); }
.side.hidden { display: none; }
.close { position: absolute; top: var(--s3); right: var(--s3); background: none; color: var(--tx-3); padding: var(--s1) var(--s2); border-radius: var(--r); }
.close:hover { color: var(--tx); background: var(--bg-3); }
.side-title { font-size: var(--t-lg); font-weight: 700; line-height: 1.25; letter-spacing: -.01em; padding-right: 48px; }
.side-lede { color: var(--tx-2); font-size: var(--t-md); margin-top: var(--s2); line-height: 1.6; }
.sec { margin-top: var(--s5); padding-top: var(--s3); }
.sec-title { color: var(--tx-3); font-size: var(--t-xs); font-weight: 600; letter-spacing: .04em; margin-bottom: var(--s2); }
.links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.plink { color: var(--tx); text-decoration: none; font-size: var(--t-md); }
.plink:hover { color: var(--link); }
.change-row { display: flex; gap: var(--s3); align-items: baseline; padding: 6px 0; cursor: pointer; font-size: var(--t-md); }
.change-row .what { font-weight: 500; flex: 1; }
.change-row .how { color: var(--tx-2); }
.change-row .from { display: block; margin-top: 2px; font-size: var(--t-xs); color: var(--tx-2); text-decoration: none; }
.change-row:hover .what { color: var(--link); }
.op-added .what { color: var(--added); }
.op-removed .what { color: var(--error); }
.op-moved .what { color: var(--moved); }
.op-renamed .what, .op-modified .what { color: var(--modified); }
.verdict { margin-left: auto; color: var(--tx-3); white-space: nowrap; }
.verdict.v-accept { color: var(--added); }
.verdict.v-reject { color: var(--error); }

.picker { position: absolute; z-index: 6; top: calc(var(--bar) + var(--s2)); right: var(--s4); width: 380px; max-height: calc(100vh - var(--bar) - 24px); overflow: auto;
  display: flex; flex-direction: column; gap: 0; padding: var(--s2); background: var(--bg-2); border-radius: var(--r-lg); box-shadow: var(--lift-sm); }
.pick { display: flex; align-items: stretch; gap: 2px; border-radius: var(--r); }
.pick.on { background: var(--bg-4); }
.pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: none; padding: 10px var(--s3); border-radius: var(--r); min-height: 48px; justify-content: center; }
.pick-main:hover { background: var(--bg-3); }
.pick-name { font-size: var(--t-md); color: var(--tx); font-weight: 600; }
.pick-sub { font-size: var(--t-sm); color: var(--tx-2); }
.pick-sub.met { color: var(--added); } .pick-sub.unmet { color: var(--warn); } .pick-sub.outside { color: var(--error); }
.pick-add { flex: none; width: 48px; background: none; color: var(--tx-2); font-size: 20px; border-radius: var(--r); }
.pick-add:hover { background: var(--bg-3); color: var(--tx); }
.pick-note { padding: var(--s2) var(--s3); display: flex; flex-direction: column; gap: 4px; font-size: var(--t-sm); }
.pick-all { background: none; color: var(--tx-2); text-align: left; padding: 12px var(--s3); border-radius: var(--r); min-height: 44px; }
.pick-all:hover { background: var(--bg-3); color: var(--tx); }

/* ================= 11. 변경: 패치 목록과 패치 한 장 ================= */
.vgs { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s3); }
.vg { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); align-items: flex-start; }
.vg:not(.open) { padding: var(--s3) var(--s5); }
.vg-head { display: flex; flex-direction: column; gap: 2px; }
.vg-title { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.vg-when { color: var(--tx-3); }
.vg.open .vg-when { color: var(--warn); }
.vg-lines { display: flex; flex-direction: column; gap: 4px; color: var(--tx-2); font-size: var(--t-md); }

.pv-summary { display: flex; flex-direction: column; gap: 6px; font-size: var(--t-md); }
.pv-count { font-size: var(--t-lg); font-weight: 700; letter-spacing: -.01em; }
.pv-calm { color: var(--tx-3); }
.pc { padding: 0; gap: 0; display: flex; flex-direction: column; align-items: stretch; border-radius: var(--r); }
.pc:not(.open) { border-radius: 0; }
.pc.open.sel { background: var(--bg-3); }
.pc > *:not(.pc-head) { margin: 0 var(--s5); }
.pc > *:not(.pc-head) + * { margin-top: var(--s3); }
.pc > .pc-actions { margin-bottom: var(--s4); margin-top: var(--s3); }
.pc.past > *:last-child:not(.pc-head) { margin-bottom: var(--s4); }
.pc-head { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
button.pc-head { width: 100%; background: none; color: inherit; text-align: left; padding: var(--s4) var(--s5); border-radius: var(--r); min-height: 52px; }
button.pc-head:hover { background: var(--bg-3); }
.pc.expanded > button.pc-head { border-radius: var(--r) var(--r) 0 0; }
.pc-head .pc-meta { margin-left: auto; color: var(--tx-3); font-size: var(--t-sm); }
.pc.past button.pc-head { padding: 10px var(--s5); min-height: 44px; }
.pc.past .pc-name { font-size: var(--t-md); font-weight: 600; }
.pc-name { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.pc.discarded .pc-name { color: var(--tx-3); }
.pc-verdict { font-weight: 600; }
.pc-verdict.met { color: var(--added); }
.pc-verdict.unmet { color: var(--warn); }
.pc-verdict.outside { color: var(--error); }
.pc-intent { color: var(--tx); font-size: var(--t-md); line-height: 1.6; }
.pc-checks { display: flex; flex-direction: column; gap: 4px; font-size: var(--t-md); }
.pc-check { display: flex; gap: var(--s2); align-items: baseline; flex-wrap: wrap; color: var(--tx-3); }
.pc-check.ok { color: var(--tx); }
.pc-check.no { color: var(--warn); }
.pc-check .mark, .pc-reading .mark { display: none; }
.pc-check .detail { color: var(--tx-3); font-size: var(--t-sm); }
.pc-outside { color: var(--error); font-size: var(--t-md); }
.pc-meta { color: var(--tx-3); }
.pc-links { display: flex; flex-direction: column; gap: 4px; font-size: var(--t-md); }
.pc-link.k-conflict { color: var(--error); }
.pc-link.k-together { color: var(--warn); }
.pc-link.k-common, .pc-link.k-dependency { color: var(--tx-2); }
.pc-link .detail { display: block; margin-top: 6px; color: var(--tx-2); }
.pc-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pc-actions .btn { padding: 10px 16px; }
.pc-turn { font-size: var(--t-sm); }
.pc-restate, .pc-comment, .pc-since, .ba, .pp-ask { background: var(--bg-3); border-radius: var(--r); }
.pc-restate { margin-top: 10px; padding: 12px 14px; }
.pc-restate-text { color: var(--tx); line-height: 1.7; }
.pc-restate .detail { display: block; margin-top: 4px; color: var(--tx-2); font-size: var(--t-sm); }
.pc-readings { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.pc-reading { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; color: var(--tx-3); }
.pc-reading.chosen { color: var(--tx); font-weight: 600; }
.pc-reading.chosen .detail { font-weight: 400; }
.pc-reading .detail { color: var(--tx-3); font-size: var(--t-sm); }
.pc-comment { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-top: 8px; padding: 10px 12px; }
.pc-comment.resolved, .pc-comment.outdated { opacity: .55; }
.pc-comment .detail { color: var(--tx-3); font-size: var(--t-sm); }
.pc-comment-body { line-height: 1.6; }
.pc-comment .pp-mini { margin-left: auto; min-height: 32px; }
.pc-since { margin-top: var(--s3); padding: var(--s3) var(--s4); }
.pc-since-title, .pc-rev-head { color: var(--tx-2); font-size: var(--t-sm); margin-bottom: 4px; }
.pc-history { margin-top: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.pc-rival-note { display: block; font-size: var(--t-sm); color: var(--tx-2); }
.ba { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding: 10px 12px; font-size: var(--t-sm); line-height: 1.6; }
.ba-old { color: var(--tx-3); text-decoration: line-through; }
.ba-old a.ref { color: inherit; }
.ba-new { color: var(--tx); }
.rival-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.rival { padding: 14px; background: var(--bg-3); border-radius: var(--r); display: flex; flex-direction: column; gap: 6px; }
.past-toggle { margin-top: var(--s4); align-self: flex-start; background: none; color: var(--tx-2); padding: 12px var(--s5); border-radius: var(--r); min-height: 44px; font-size: var(--t-md); }
.past-toggle:hover { background: var(--bg-3); color: var(--tx); }

/* 패치 지도 */
.pmap { padding: var(--s4); overflow-x: auto; }
.pmap svg { display: block; }
.pm-edge { fill: none; stroke-width: 2; }
.pm-edge.k-conflict { stroke: var(--error); }
.pm-edge.k-common { stroke: var(--link); stroke-dasharray: 5 4; }
.pm-edge.k-dependency { stroke: var(--tx-3); }
.pm-edge.k-together { stroke: var(--warn); stroke-dasharray: 2 4; }
.pm-node { cursor: pointer; }
.pm-node circle { fill: var(--bg-2); stroke: var(--tx-2); stroke-width: 2; }
.pm-node.met circle { stroke: var(--added); }
.pm-node.unmet circle { stroke: var(--warn); }
.pm-node.outside circle { stroke: var(--error); }
.pm-node text { fill: var(--tx); font-size: 13px; }
.pm-key { display: flex; gap: var(--s4); padding-top: var(--s2); color: var(--tx-3); }
.pm-k.k-conflict { color: var(--error); }
.pm-k.k-common { color: var(--link); }
.pm-k.k-together { color: var(--warn); }

/* 패치 한 장: PR처럼 읽는다 */
.pp { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s4); }
.pp-top { display: flex; align-items: center; gap: var(--s3); padding-bottom: var(--s3); }
.pp-name { font-size: var(--t-lg); font-weight: 700; letter-spacing: -.01em; }
.pp-turn { font-size: var(--t-md); font-weight: 600; padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--bg-3); }
.pp-turn.t-author, .pc-turn.t-author { color: var(--warn); }
.pp-turn.t-author { background: var(--warn-bg); }
.pp-turn.t-review, .pc-turn.t-review { color: var(--link); }
.pp-turn.t-ready, .pc-turn.t-ready { color: var(--added); }
.pp-turn.t-ready { background: var(--added-bg); }
.pp-turn.t-wait, .pc-turn.t-wait { color: var(--tx-2); }
.pp-intent { font-size: 17px; line-height: 1.65; }
.pp-checks, .pp-issues, .pp-talk { display: flex; flex-direction: column; gap: var(--s2); }
.pp-changes { display: flex; flex-direction: column; gap: var(--s3); }
.pp-change { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.pp-change-head { font-weight: 600; display: flex; gap: var(--s3); align-items: baseline; flex-wrap: wrap; }
.pp-copy { color: var(--tx); }
.pp-shots { display: flex; gap: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.pp-shot { flex: 0 0 auto; width: 340px; scroll-snap-align: start; border-radius: var(--r); overflow: hidden; background: var(--paper); }
.pp-shot.old { opacity: .7; }
.pp-todo { margin: 2px 0; color: var(--tx-3); }
.pp-compose { display: grid; gap: 8px; margin-top: 10px; }
.pp-input { width: 100%; resize: vertical; min-height: 64px; padding: 12px 14px; border-radius: var(--r); background: var(--bg-3); color: var(--tx); font-size: 16px; line-height: 1.5; }
.pp-input:focus { outline: none; background: var(--bg-4); }
.pp-compose-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.pp-compose .pp-compose-row { margin-top: 0; }
.pp-compose-row .btn.primary { margin-left: auto; padding: 10px 18px; }
.pp-mini { border-radius: var(--r); min-height: 36px; padding: 6px 12px; background: var(--bg-3); color: var(--tx-2); font-size: var(--t-sm); font-weight: 600; white-space: nowrap; flex: 0 0 auto; }
.pp-mini:hover { color: var(--tx); background: var(--bg-4); }
.pp-mini.on { color: var(--on-ink); background: var(--tx); }
.pp-mini.on.v-hold { background: var(--warn); }
.pp-mini.on.v-reject { background: var(--error); }
.pp-mini.on.v-accept { background: var(--added); }
.pp-talk .pp-compose { margin-top: 14px; }
.pp-next { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); }
.pp-approve { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.pp-approve .detail { color: var(--tx-2); flex: 1 1 240px; }
.pp-ask { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); }
.pp-ask-text { flex: 1 1 auto; min-width: 0; line-height: 1.5; }
.pp-ask .pp-mini { margin-left: auto; }
.pp-ask-choices { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s2); }
.pp-sub { font-weight: 600; color: var(--tx-2); font-size: var(--t-sm); }
.pp-rivals { display: flex; flex-direction: column; gap: var(--s2); }
.pp-rival { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s3) var(--s4); }
.pp-rival-name { all: unset; cursor: pointer; font-weight: 600; font-size: 16px; color: var(--link); }
.pp-rival-name:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* 세 표: 있음, 가까운 없음, 정도, 배제, 첫 수확 */
.ptabs { display: flex; flex-direction: column; gap: var(--s3); }
.ptab { padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s2); }
.ptab-h { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; font-size: var(--t-md); font-weight: 700; color: var(--tx); }
.ptab-h .latin { font: italic 400 15px var(--num); color: var(--tx-3); }
.ptab-h .count { margin-left: auto; font-weight: 400; color: var(--tx-3); font-size: var(--t-sm); }
.ptab-body { display: flex; flex-direction: column; gap: 6px; color: var(--tx-2); font-size: var(--t-md); line-height: 1.55; }
.ptab.quiet { background: none; border-radius: 0; padding-block: var(--s3); }
.ptab.quiet .ptab-body { color: var(--tx-3); }
.ptab.final { background: var(--bg-3); }

/* 버튼 하나 막대: 화면 끝에 주된 동작 하나만 */
.finalbar { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: flex-end; gap: var(--s4); padding: var(--s4) 0 calc(var(--s4) + env(safe-area-inset-bottom, 0px)); background: var(--bg); }
.finalbar .why { color: var(--tx-2); font-size: var(--t-sm); }
.finalbar .btn { min-width: 168px; min-height: 48px; }

/* 그 자리 코멘트 */
.inline-note { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s2); }
.inline-note .opts { display: flex; gap: var(--s4); font-size: var(--t-sm); }
.inline-note .opts a { color: var(--tx-2); text-decoration: none; padding: 8px 0; min-height: 36px; display: inline-flex; align-items: center; cursor: pointer; }
.inline-note .opts a:hover, .inline-note .opts a.on { color: var(--tx); }
.inline-note .opts a.on.v-hold { color: var(--warn); }
.inline-note .opts a.on.v-reject { color: var(--error); }

/* ================= 12. 스킬 ================= */
.skills { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s6); }
.sk-group { display: flex; flex-direction: column; gap: var(--s2); }
.sk-title { font-size: var(--t-sm); font-weight: 600; color: var(--tx-2); padding: 0 0 var(--s2); }
.sk-head { all: unset; box-sizing: border-box; width: 100%; display: flex; flex-direction: column; gap: 4px; padding: var(--s4) var(--s5); cursor: pointer; }
.sk-head:hover { background: var(--bg-3); }
.sk-head:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sk-name { font: 15px var(--mono); color: var(--tx); }
.sk-desc { color: var(--tx-2); line-height: 1.6; }
.sk-body, .sk-file { padding: 0 var(--s5) var(--s5); line-height: 1.7; color: var(--tx); }
.sk-file { margin: 0 var(--s4) var(--s4); padding: var(--s4); background: var(--bg-3); border-radius: var(--r); }
.sk-path { font: 13px var(--mono); color: var(--tx-2); margin-bottom: var(--s2); }
.sk-h { font-weight: 600; margin: var(--s4) 0 var(--s1); }
.sk-p { margin: var(--s2) 0; }
.sk-li { margin: 4px 0; }
.sk-code, .cmd { margin: var(--s2) 0; padding: var(--s3) var(--s4); background: var(--bg-3); border-radius: var(--r); color: var(--tx); font: 13px/1.6 var(--mono); white-space: pre-wrap; }
.sk .issue { margin: 0 var(--s5) var(--s2); }
.sk code, .sk-file code { font: 13px var(--mono); padding: 1px 5px; background: var(--bg-3); border-radius: var(--r); }

/* ================= 13. 서비스 셸: 들어가기, 프로젝트, 멤버, MCP, 계정 ================= */
.shell-page .app { height: auto; min-height: 100vh; overflow: visible; }
.shell-main { padding: 112px max(5vw, 24px) 96px; }
.shell-page .with-rail .shell-main { margin-left: var(--rail); padding-top: calc(var(--bar) + var(--s5)); }
.page { max-width: 1080px; margin: 0 auto; }

/* 들어가기: 종이 한 장, 위에 로고, 아래 눈금 */
.center { min-height: calc(100vh - 220px); display: flex; align-items: center; justify-content: center; }
.shell-page .center:only-child { min-height: 100vh; }
.sheet { position: relative; width: min(400px, 100%); display: flex; flex-direction: column; gap: var(--s3); padding: var(--s6) var(--s6) calc(var(--s6) + 6px); background: var(--bg-2); border-radius: var(--r); }
.wordmark { color: var(--tx); margin-bottom: var(--s5); line-height: 0; }
.wordmark svg { display: block; height: 36px; width: auto; }
.sheet-title { font-size: var(--t-lg); font-weight: 700; margin-bottom: var(--s2); }

/* 프로젝트: 판 위의 이름과 한 줄 */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); }
.tile { position: relative; display: flex; flex-direction: column; gap: var(--s2); min-height: 180px; padding: var(--s5); color: var(--tx); text-decoration: none; }
.tile:hover { background: var(--bg-3); }
.tile-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.tile-text { color: var(--tx-2); font-size: var(--t-md); line-height: 1.6; }
.tile-open { margin-top: auto; padding-top: var(--s3); color: var(--tx-2); font-size: var(--t-sm); }
.tile.has-error .tile-open { color: var(--error); }
.tile.new { min-height: 0; align-self: start; flex-direction: row; align-items: center; gap: var(--s2); padding: var(--s4) var(--s5); background: none; color: var(--brand); font-size: var(--t-md); font-weight: 600; }
.tile.new::before { content: "+"; font-size: 20px; line-height: 1; }
.tile.new:hover { color: var(--tx); background: var(--bg-4); }

.empty { display: flex; flex-direction: column; align-items: center; gap: var(--s4); color: var(--tx-2); font-size: var(--t-md); padding: 96px 0; }
.empty.left { align-items: flex-start; padding: 0; }
.cmd { user-select: all; padding: var(--s4) var(--s5); }

/* 멤버 */
.people { display: flex; flex-direction: column; max-width: 760px; }
.person { display: grid; grid-template-columns: 180px 1fr auto; align-items: center; gap: var(--s4); padding: var(--s3) var(--s4); }
.person:hover { background: var(--bg-3); }
.p-name { font-weight: 600; font-size: var(--t-md); }
.p-mail { color: var(--tx-3); overflow: hidden; text-overflow: ellipsis; }
.person select.act, .invite select.act { background: var(--bg-3); }
.person select.act[disabled] { background: none; cursor: default; }
.invite { display: grid; grid-template-columns: 1fr auto auto; gap: var(--s2); max-width: 760px; margin-top: var(--s6); }

/* ================= 14. 불러오는 중: 판 모양만 ================= */
.loading { position: fixed; inset: 0; }
.loading > div { position: absolute; background: var(--bg-3); border-radius: var(--r); animation: ld 1.4s ease-in-out infinite; }
.ld-dock { top: 10px; left: 16px; width: 420px; height: 34px; }
.ld-dock.right { left: auto; right: 16px; width: 260px; }
.ld-board.a { top: 140px; left: 8%; width: 220px; height: 150px; }
.ld-board.b { top: 140px; left: 30%; width: 220px; height: 150px; animation-delay: .15s !important; }
.ld-board.c { top: 330px; left: 30%; width: 220px; height: 150px; animation-delay: .3s !important; }
.ld-board.d { top: 140px; left: 52%; width: 220px; height: 150px; animation-delay: .45s !important; }
.loading .ld-grid { position: absolute; top: 200px; left: max(5vw, 24px); right: max(5vw, 24px); display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; background: none; animation: none; }
.ld-tile { position: static !important; height: 180px; background: var(--bg-3); border-radius: var(--r); animation: ld 1.4s ease-in-out infinite; }
@keyframes ld { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* ================= 15. 넓은 화면에서 옆 패널이 열리면 쪽이 비킨다 ================= */
@media (min-width: 641px) {
  .main:has(> .side:not(.hidden)) > .tree-view,
  .main:has(> .side:not(.hidden)) > .matrix-view { padding-right: 440px; }
}

/* ================= 16. 휴대폰 =================
   위 막대(로고 심볼, 프로젝트 이름, 보기), 그 아래 지금 영역의 화면 줄, 맨 아래 다섯 영역 탭.
   떠 있는 판은 아래에서 올라온다. 누르는 곳은 44px 이상. */
@media (max-width: 640px) {
  .rail { display: none; }
  .wide-only { display: none; }
  .top { position: fixed; top: 0; left: 0; right: 0; height: var(--bar); padding: 0 var(--s3) 0 var(--s4); gap: var(--s2); background: var(--bg); z-index: 6; }
  .dock { background: none; padding: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .dock::-webkit-scrollbar { display: none; }
  .seg, .act, .crumb, .who { min-height: var(--tap); display: inline-flex; align-items: center; }

  .with-rail .main { left: 0; top: calc(var(--bar) + var(--sub)); bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); }
  .with-rail.v-changes .main, .with-rail.v-expression .main { top: var(--bar); }
  .with-rail .top { left: 0; }
  .with-rail .appbar { visibility: visible; flex: 1; min-width: 0; }
  .with-rail .appbar .appbar-mark { display: block; margin-right: var(--s1); }
  .with-rail .appbar .crumb { display: none; }
  .with-rail .appbar .brand { padding: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .with-rail .appbar select.act { font-weight: 700; font-size: 17px; padding: 8px 0; }
  .with-rail .dock.tools { flex: none; max-width: 62vw; overflow: visible; }
  .with-rail .dock.tools .act { flex: none; padding: 8px 10px; min-height: 40px; }
  .with-rail .dock.tools .wide-only, .with-rail .dock.tools .next-problem { display: none; }
  .with-rail .view-chip { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

  .subnav { position: fixed; z-index: 5; top: var(--bar); left: 0; right: 0; height: var(--sub); display: flex; align-items: stretch; gap: 0; padding: 0 var(--s2);
    background: var(--bg); overflow-x: auto; scrollbar-width: none; }
  .subnav::-webkit-scrollbar { display: none; }
  .subtab { display: inline-flex; align-items: center; gap: 6px; flex: none; margin: 6px 0; padding: 0 14px; border-radius: var(--r); color: var(--tx-2); text-decoration: none; font-size: var(--t-md); }
  .subtab.on { color: var(--tx); font-weight: 600; background: var(--bg-2); box-shadow: 0 1px 2px rgba(26,52,93,.10); }
  /* 휴대폰: 위 막대와 칸 고르개가 이미 말한 이름을 제목으로 다시 쓰지 않는다 */
  .app:has(.subnav .subtab.on) .pv-head:has(> .pv-title:only-child), .app:has(.subnav .subtab.on) .page-title { display: none; }
  .subtab .rail-count { margin-left: 0; }
  .with-rail.v-changes .subnav, .with-rail.v-expression .subnav { display: none; }
  .shell-page .with-rail .subnav { display: flex; }

  .tabbar { position: fixed; z-index: 7; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabs) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg-3); }
  .tab { position: relative; display: flex; align-items: center; justify-content: center; color: var(--tx-3); text-decoration: none; font-size: var(--t-sm); isolation: isolate; font-weight: 600; white-space: nowrap; }
  .tab.cur { color: var(--brand); }
  .tab.cur::before { content: ""; position: absolute; inset: 9px 8px; z-index: -1; border-radius: var(--r-lg); background: var(--bg-2); }
  .tab.off { opacity: .45; }

  .tree-view, .matrix-view, .changes-view, .page-view { padding: var(--s4) var(--s4) var(--s6); }
  .mm-view { padding-top: 0; }
  .matrix-scroll { max-height: none; }
  .pv-title { font-size: 22px; }
  .facts { grid-template-columns: 1fr; }
  .rule-block { padding: var(--s3) var(--s4); }
  .synopsis { font-size: var(--t-md); }
  .crow { padding: 10px var(--s3); min-height: 44px; }
  .crow.d0 .clabel { font-size: 22px; }
  .crow.d1 .clabel { font-size: 17px; }
  .frow { flex-direction: column; gap: 4px; }
  .frow .fq { min-width: 0; }
  .matrix .corner { min-width: 104px; }
  .matrix .rowh { font-size: var(--t-xs); max-width: 120px; overflow: hidden; text-overflow: ellipsis; padding-right: var(--s2); }
  .matrix td { width: 26px; min-width: 26px; height: 26px; }
  .matrix th.col { height: 96px; }
  .matrix th.col div { writing-mode: horizontal-tb; transform: translateX(10px) rotate(-60deg); transform-origin: left bottom; width: 20px; }
  .with-margin { grid-template-columns: 1fr; gap: 2px; }
  .with-margin .marg { padding: 0 0 var(--s3) calc(2.6em + var(--s3)); }
  a.ref { position: relative; }
  a.ref::after { content: ""; position: absolute; left: 0; right: 0; top: -8px; bottom: -8px; }

  /* 떠 있는 판은 아래에서 올라오는 판으로, 탭 막대 위에 */
  .side, .picker { top: auto; left: 0; right: 0; bottom: 0; width: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--lift); }
  .side { max-height: 62vh; padding: var(--s4) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); }
  .picker { max-height: 70vh; padding-bottom: calc(var(--s3) + env(safe-area-inset-bottom)); }
  .with-rail .side, .with-rail .picker { bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); }
  .with-rail .side { max-height: 58vh; }
  .side .close { top: var(--s2); right: var(--s2); min-width: 64px; min-height: 40px; }
  .side.overview.min { max-height: 96px; overflow: hidden; }
  .side.overview.min .side-title { font-size: var(--t-md); }
  .side-title { font-size: 20px; padding-right: 72px; }
  .zoom { right: var(--s2); bottom: calc(var(--s2) + env(safe-area-inset-bottom)); padding: 2px; }
  .zoom button { min-width: 44px; height: 40px; }
  .side:not(.hidden) ~ .zoom, .viewport:has(~ .side:not(.hidden)) .zoom { display: none; }

  /* 변경 */
  .pc > *:not(.pc-head) { margin-left: var(--s4); margin-right: var(--s4); }
  button.pc-head { padding: var(--s3) var(--s4); flex-wrap: wrap; }
  .pc-head .pc-meta { margin-left: 0; width: 100%; }
  .pc-name { font-size: 16px; }
  .issue, .change-row, .def, .pc-intent, .pc-checks, .vg-lines { font-size: var(--t-sm); }
  .change-row { min-height: 44px; }
  .pp-name { font-size: 20px; }
  .pp-shot, .shot { width: calc(100vw - 48px); }
  .pp-ask { flex-wrap: wrap; }
  .finalbar { justify-content: stretch; }
  .finalbar .why { display: none; }
  .finalbar .btn { flex: 1; }
  .ptab { padding: var(--s3) var(--s4); }

  /* 서비스 셸 */
  .shell-main { padding: calc(var(--bar) + var(--s5)) var(--s4) 64px; }
  .shell-page .with-rail .shell-main { margin-left: 0; padding: calc(var(--bar) + var(--sub) + var(--s4)) var(--s4) calc(var(--tabs) + 48px); }
  .page-title { font-size: 26px; margin-bottom: var(--s5); }
  .tiles { grid-template-columns: 1fr; gap: var(--s3); }
  .tile { min-height: 0; padding: var(--s4) var(--s5); }
  .tile-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .person { grid-template-columns: 1fr auto; }
  .p-mail { display: none; }
  .invite { grid-template-columns: 1fr; }
  .cmd { font-size: 12px; overflow-x: auto; word-break: break-all; }
  .row:has(> .cmd) { flex-direction: column; align-items: stretch; }
  .sheet { padding: var(--s5) var(--s5) calc(var(--s5) + 6px); }
  .is-viewing .outline { padding-bottom: 140px; }
}

/* ================= v8.2 해라: 표정, 재질, 리듬 =================
   와이어프레임처럼 보이지 않도록 "하지 마라" 옆에 "해라"를 둔다.
   1. 아이콘: 영역, 화면, 상태에는 면으로 채운 아이콘을 붙인다 (src/web/icons.ml). 같은 뜻에는 같은 아이콘.
   2. 영역 타일: 영역 아이콘은 로고처럼 둥근 타일 안에 둔다. 지금 영역의 타일은 로고의 남색으로 채운다.
   3. 나침반 바늘: 지금 위치는 로고의 나침반 바늘(위 반 남색, 아래 반 하늘색)로 보인다.
   4. 눈썹과 큰 제목: 화면 머리는 영역 타일과 영역 이름(작은 글) 위에 큰 제목(30px)을 둔다.
   5. 재질: 바탕(하늘) 위에 흰 판이 옅은 그림자로 떠 있다. 누를 수 있는 판은 누를 때 더 떠오른다.
   6. 상태는 색과 아이콘을 함께: 색만으로 위반과 경고를 가르지 않는다.
   7. 잠잠한 화면: 할 일이 없으면 로고의 배와 한 문장을 보인다. */
.ic { width: 18px; height: 18px; flex: none; display: block; }

/* 레일: 영역 타일과 화면 아이콘 */
.rail-head { display: flex; align-items: center; gap: 10px; padding: 5px var(--s2); font-size: var(--t-sm); letter-spacing: 0; color: var(--tx); font-weight: 700; }
.rail-head.on, .rail-area.cur .rail-head { color: var(--tx); }
.rail-head.off { color: var(--tx-3); }
.atile .ic { width: 16px; height: 16px; }
.rail-head .atile, .eyebrow .atile { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-2); color: var(--brand); }
.rail-area.cur .rail-head .atile { background: var(--brand); color: var(--on-ink); }
.rail-head.off .atile { opacity: .5; }
.rail-items { padding: 2px 0 var(--s1) 0; }
.rail-item { align-items: center; gap: 10px; padding: 7px var(--s2) 7px 14px; }
.rail-item .ic { width: 16px; height: 16px; color: var(--tx-3); }
.rail-item.on .ic { color: var(--brand); }
.rail-item.on { box-shadow: 0 1px 3px rgba(26,52,93,.10); }
/* 나침반 바늘: 지금 위치 */
.rail-item.on::after, .rail-who.on::after { content: ""; margin-left: auto; width: 8px; height: 16px; flex: none;
  background: linear-gradient(var(--brand) 50%, var(--brand-sky) 50%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.rail-who { display: flex; align-items: center; gap: 10px; border-radius: var(--r); }
.rail-who .ic { width: 18px; height: 18px; color: var(--tx-3); }

/* 화면 머리: 눈썹 + 큰 제목 */
.pv-titles { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--tx-2); font-size: var(--t-sm); font-weight: 600; }
.eyebrow .atile { width: 24px; height: 24px; border-radius: 7px; background: var(--bg-4); color: var(--brand); }
.eyebrow .atile .ic { width: 14px; height: 14px; }
.pv-title, .page-title { font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--tx); }
.page > .eyebrow { margin-bottom: 10px; }
.mm-head { align-items: flex-end; padding-top: var(--s5); }
.mm-title { font-size: 26px; }

/* 재질: 흰 판은 옅게 떠 있고, 누를 수 있는 판은 더 떠오른다 */
.rule-block, .fact, .vg.open, .pc.open, .ptab, .pp-change, .pp-next, .pp-rival, .sk, .pmap, .tile:not(.new) { box-shadow: 0 1px 2px rgba(26,52,93,.06), 0 4px 14px rgba(26,52,93,.06); }
.tiles .tile:not(.new) { border-radius: var(--r-lg); transition: box-shadow .15s, transform .15s; }
.tiles .tile:not(.new):hover { background: var(--bg-2); box-shadow: var(--lift); transform: translateY(-1px); }
.tile-name { font-size: 20px; }
.tile-open { color: var(--brand); font-weight: 600; }

/* 상태: 색과 아이콘 */
.rule-name { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; }
.rule-name .ic { width: 18px; height: 18px; }

/* 잠잠한 화면 */
.calm { display: flex; flex-direction: column; align-items: center; gap: var(--s4); padding: 72px 0; color: var(--tx-2); font-size: var(--t-md); text-align: center; }
.calm svg { width: 96px; height: 96px; filter: drop-shadow(0 8px 20px rgba(26,52,93,.18)); }

/* 휴대폰 아래 탭: 아이콘 위, 이름 아래 */
@media (max-width: 640px) {
  .tab { flex-direction: column; gap: 3px; font-size: 11px; }
  .tab .ic { width: 22px; height: 22px; }
  .tab.cur::before { inset: 6px 10px; }
  .eyebrow { display: none; }
  .app:has(.subnav .subtab.on) .pv-head:has(.pv-titles > .pv-title) { display: none; }
  .pv-title, .page-title { font-size: 26px; }
}

/* ================= v8.3 세부: OpenAI 컴포넌트 시안에서 옮긴 디테일 (novagana-design/components-v1) =================
   선과 통계 타일은 시안에 있어도 옮기지 않는다. 옮긴 것: 상태 타일, 물든 발견 줄, 아이콘 달린 버튼, 프로젝트 카드의 타일과 발치,
   작업 공간의 판화 머리, 휴대폰 칸 고르개의 아이콘. */
.act { display: inline-flex; align-items: center; gap: 6px; }
.act .ic { width: 16px; height: 16px; }
.dock { padding: 4px; gap: 4px; }
.dock .act { padding: 7px 12px; }
.act.next-problem { background: var(--brand); color: var(--on-ink); font-weight: 600; padding-right: 10px; }
.act.next-problem:hover { background: var(--brand); filter: brightness(1.15); color: var(--on-ink); }
.act.next-problem .ic { width: 15px; height: 15px; }

/* 규칙 묶음: 상태 타일 + 이름 + 상태 낱말, 발견은 상태 색으로 물든 줄 */
.rule-block { padding: var(--s5); border-radius: var(--r-lg); }
.rule-head { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px; row-gap: 0; align-items: center; margin-bottom: var(--s4); padding-bottom: 0; }
.stile { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; }
.stile .ic { width: 22px; height: 22px; }
.rule-head.error .stile { background: var(--error-bg); color: var(--error); }
.rule-head.warning .stile { background: var(--warn-bg); color: var(--warn); }
.rule-name { font-size: 18px; letter-spacing: -.01em; }
.rule-state { font-size: var(--t-sm); font-weight: 600; color: var(--tx-3); }
.rule-head.error .rule-state { color: var(--error); } .rule-head.warning .rule-state { color: var(--warn); }
.rule-issues { display: flex; flex-direction: column; gap: 6px; }
.rule-issues .issue { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: var(--r); color: var(--tx); font-size: var(--t-md); line-height: 1.5; }
.rule-issues .issue.error { background: var(--error-bg); }
.rule-issues .issue.warning { background: var(--warn-bg); }
.rule-issues .issue .ic { width: 16px; height: 16px; margin-top: 3px; }
.rule-issues .issue.error .ic { color: var(--error); } .rule-issues .issue.warning .ic { color: var(--warn); }
.rule-issues .issue:not(.resolved):hover { filter: brightness(.98); background: var(--bg-3); }
.rule-issues .issue.error:hover { background: var(--error-bg); } .rule-issues .issue.warning:hover { background: var(--warn-bg); }
.issue-text { min-width: 0; }
.rule-block .more { display: inline-flex; margin-top: var(--s2); color: var(--brand); font-weight: 600; }

/* 프로젝트 카드: 타일, 이름, 설명, 발치(마지막 일 + 열기) */
.tiles .tile:not(.new) { gap: var(--s3); min-height: 220px; }
.atile.big { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-4); color: var(--brand); }
.atile.big .ic { width: 24px; height: 24px; }
.tile-name { font-size: 22px; margin-top: var(--s1); }
.tile-foot { margin-top: auto; display: flex; align-items: center; gap: var(--s3); padding-top: var(--s2); }
.tile-open { margin: 0; padding: 0; color: var(--tx-3); font-weight: 400; font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tile-go { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 600; font-size: var(--t-sm); white-space: nowrap; }
.tile-go .ic { width: 15px; height: 15px; transition: transform .15s; }
.tile:hover .tile-go .ic { transform: translateX(2px); }
.tile.new { gap: 12px; padding: var(--s3) 0; }
.tile.new::before { content: none; }
.tile.new .atile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: var(--on-ink); }
.tile.new .atile .ic { width: 18px; height: 18px; }

/* 작업 공간 머리: 1620년 표지의 배와 기둥을 판화로 */
.hero { position: relative; margin: calc(-1 * var(--s6)) calc(-1 * var(--s6)) var(--s5); padding: 56px var(--s6) 64px; min-height: 280px;
  isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("hero-sea.jpg") 96% 40% / auto 120% no-repeat;
  -webkit-mask-image: radial-gradient(ellipse 34% 62% at 76% 50%, #000 45%, transparent 100%); mask-image: radial-gradient(ellipse 34% 62% at 76% 50%, #000 45%, transparent 100%); }
.hero .page-title { font-size: 52px; letter-spacing: -.03em; margin: 0; padding: 0; }
.hero .eyebrow { margin-bottom: 14px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero::before { filter: invert(1) hue-rotate(180deg) brightness(.85); opacity: .4; } }
:root[data-theme="dark"] .hero::before { filter: invert(1) hue-rotate(180deg) brightness(.85); opacity: .4; }

/* 휴대폰 칸 고르개의 아이콘 */
.subtab .ic { width: 16px; height: 16px; color: var(--tx-3); }
.subtab.on .ic { color: var(--brand); }
@media (max-width: 640px) {
  .hero { margin: 0 0 var(--s3); padding: 0; min-height: 0; background: none; }
  .hero::before { content: none; }
  .tiles .tile:not(.new) { min-height: 0; }
  .rule-block { padding: var(--s4); }
}

/* ================= v9 "고른 시안": 판화 문장, 타일 메뉴, 바다 머리, 움직임 =================
   Alska가 고른 작업 공간 시안(2026-11-29 "이거 너무 좋다")을 기준으로 앱 전체를 맞춘다.
   해라:
   a. 큰 자리의 로고는 판화 문장 + 세리프 워드마크 + "Cognitive Structure Navigator". 작은 자리는 P1 표지.
   b. 메뉴 줄은 모두 아이콘 타일(38px, 흰 면 위 남색 면 아이콘)과 이름. 고른 줄은 남색 판으로 채우고, 판이 돛처럼 왼쪽에서 펼쳐진다.
   c. 내비게이션이 아닌 버튼은 아이콘만. 뜻은 툴팁(data-tip)과 aria-label로 (Alska, 2026-11-29).
   d. 움직임은 바다처럼 느리고 뜻이 있게: 머리 그림은 아주 천천히 흐르고 물 위로 빛이 지나간다. 화면을 열면 판이 차례로 떠오른다. 올리면 뜨고, 누르면 가라앉는다.
   e. 움직임 줄이기 설정이면 모든 움직임을 멈춘다.
   선(구분선, 테두리, 밑줄 탭)은 여전히 쓰지 않는다. */

:root { --rail: 264px; --ease: cubic-bezier(.2,.8,.2,1); --tile-face: linear-gradient(180deg, var(--bg-2), color-mix(in srgb, var(--bg-3) 55%, var(--bg-2)));
  --tile-lift: 0 1px 2px rgba(26,52,93,.10), inset 0 1px 0 rgba(255,255,255,.85); }

/* ---- 로고: 판화 문장 ---- */
.crest-lockup { display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1; }
.crest { display: block; width: 108px; height: 108px; background: var(--brand);
  -webkit-mask: url("crest.png") center / contain no-repeat; mask: url("crest.png") center / contain no-repeat; }
.wm { margin-top: 6px; font: 600 33px/1 var(--num); letter-spacing: .01em; color: var(--brand); }
.tagline { margin-top: 5px; font: italic 400 13.5px/1.2 var(--num); letter-spacing: .02em; color: var(--tx-2); white-space: nowrap; }
.signin .wordmark { line-height: 1; display: flex; justify-content: center; margin-bottom: var(--s3); }
.signin .crest { width: 132px; height: 132px; }
.signin .wm { font-size: 40px; }

/* ---- 레일 ---- */
.rail { padding: 22px 14px 14px; gap: 0; background: color-mix(in srgb, var(--bg-2) 62%, var(--bg)); box-shadow: 10px 0 30px -24px rgba(26,52,93,.35); }
.rail-brand { display: flex; justify-content: center; padding: 0 0 18px; color: var(--brand) !important; line-height: 1; }
.rail-brand:hover .crest { animation: nv-bob 1.6s var(--ease); }
.rail-ctx { margin: 0 4px 6px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--bg-3) 60%, transparent); }
.rail-ctx:empty { display: none; }
.rail-area { display: flex; flex-direction: column; gap: 3px; margin-top: 12px; }
.rail-item, .rail-who { position: relative; display: flex; align-items: center; gap: 14px; padding: 5px 10px 5px 6px; border-radius: 14px;
  color: var(--tx) !important; font-size: 15.5px; font-weight: 500; box-shadow: none; transition: background-color .2s, color .2s; }
.rail-item .ic, .rail-who .ic { width: 20px; height: 20px; color: inherit; }
.rtile { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--tile-face); box-shadow: var(--tile-lift);
  color: var(--brand); transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .2s; }
.rail-item:hover, .rail-who:hover { background: color-mix(in srgb, var(--bg-4) 55%, transparent); }
.rail-item:hover .rtile, .rail-who:hover .rtile { transform: translateY(-2px); box-shadow: 0 6px 14px -4px rgba(26,52,93,.25), inset 0 1px 0 rgba(255,255,255,.85); }
.rail-item:active .rtile { transform: translateY(0) scale(.96); }
.rail-item.on, .rail-who.on { background: var(--brand); color: var(--on-ink) !important; font-weight: 600; box-shadow: 0 10px 22px -12px rgba(26,52,93,.7);
  animation: nv-sail .5s var(--ease) both; }
.rail-item.on .rtile, .rail-who.on .rtile { background: var(--bg-2); color: var(--brand); box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.rail-item.on::after, .rail-who.on::after { content: ""; margin-left: auto; width: 7px; height: 14px; flex: none;
  background: linear-gradient(currentColor 50%, color-mix(in srgb, currentColor 40%, transparent) 50%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  animation: nv-needle 1.2s var(--ease) .15s both; }
.rail-who { margin-top: auto; padding-top: 5px; }
.rail-who.on { margin-top: auto; }
@keyframes nv-sail { from { clip-path: inset(0 100% 0 0 round 14px); } to { clip-path: inset(0 0 0 0 round 14px); } }
@keyframes nv-needle { 0% { transform: rotate(-70deg); opacity: 0; } 55% { transform: rotate(14deg); opacity: 1; } 80% { transform: rotate(-5deg); } 100% { transform: none; } }
@keyframes nv-bob { 0%, 100% { transform: none; } 40% { transform: translateY(-3px) rotate(-1.5deg); } 70% { transform: translateY(1px) rotate(.8deg); } }

/* ---- 눈썹과 제목 ---- */
.eyebrow { gap: 0; color: var(--link); font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.eyebrow .atile { display: none; }

/* ---- 아이콘 버튼 ---- */
.ib { position: relative; display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; padding: 0; border-radius: 11px;
  background: none; color: var(--tx-2); cursor: pointer; isolation: isolate; transition: color .15s, transform .12s; }
.ib .ic { width: 20px; height: 20px; transition: transform .25s var(--ease); }
.ib::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--bg-3); transform: scale(.6); opacity: 0;
  transition: transform .25s var(--ease), opacity .2s; }
.ib:hover { color: var(--brand); }
.ib:hover::before { transform: none; opacity: 1; }
.ib:active { transform: translateY(1px) scale(.96); }
.ib.on, .ib[aria-pressed="true"] { color: var(--brand); }
.ib.on::before, .ib[aria-pressed="true"]::before { transform: none; opacity: 1; background: var(--bg-2); box-shadow: 0 1px 3px rgba(26,52,93,.14); }
.ib.primary { color: var(--on-ink); }
.ib.primary::before { transform: none; opacity: 1; background: var(--brand); box-shadow: 0 8px 18px -10px rgba(26,52,93,.8); }
.ib.primary:hover::before { filter: brightness(1.18); }
.ib.primary:hover .ic { transform: translateX(1px); }
.ib.wide { width: 100%; height: 48px; border-radius: 12px; }
.ib.wide .ic { width: 22px; height: 22px; }
.ib.done { color: var(--added); }
.ib.done .ic { animation: nv-pop .35s var(--ease); }
.ib.v-accept { color: var(--added); } .ib.v-hold { color: var(--warn); } .ib.v-reject { color: var(--error); }
.ib.more { margin: 6px auto 0; display: grid; }
.ib.lv .num { font-size: 17px; color: inherit; }
.ib.act { padding: 0; min-height: 0; }
.act.ib { width: 36px; height: 36px; padding: 0; }
.act.ib.on { background: none; box-shadow: none; }
.act.next-problem { width: 40px; padding: 0; background: none; }
.act.next-problem::before { transform: none; opacity: 1; background: var(--brand); }
.act.next-problem:hover { filter: none; background: none; }
.act.next-problem:hover .ic { transform: translateX(2px); }
/* 툴팁: 잠깐 머물면 아래로 떠오른다 */
[data-tip]::after { content: attr(data-tip); position: absolute; z-index: 30; top: calc(100% + 8px); left: 50%; transform: translate(-50%, -4px);
  padding: 6px 10px; border-radius: 8px; background: var(--brand); color: var(--on-ink); font: 600 12.5px/1.2 var(--sans); white-space: nowrap;
  box-shadow: 0 8px 20px -8px rgba(26,52,93,.5); opacity: 0; pointer-events: none; transition: opacity .15s, transform .2s var(--ease); }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .35s; }
.ib.wide[data-tip]::after { display: none; }
.dock.tools .ib[data-tip]::after, .side .close[data-tip]::after { left: auto; right: 0; transform: translateY(-4px); }
.dock.tools .ib[data-tip]:hover::after, .side .close[data-tip]:hover::after { transform: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn:active:not(:disabled) { transform: translateY(1px); }

/* ---- 세그먼트, 칸 고르개 ---- */
.segs, .mm-levels, .dock.tools:has(> .wide-only) { gap: 2px; }
.mm-levels { display: inline-flex; padding: 3px; border-radius: 13px; background: var(--bg-3); }
.mm-levels .ib::before { background: var(--bg-2); }
.mm-levels .ib:not(.on):hover::before { background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.seg.on, .act.on:not(.ib), .subtab.on { animation: nv-pop .3s var(--ease); }

/* ---- 바다 머리 ---- */
.shell-page .with-rail .shell-main { overflow-x: clip; }
.hero { position: relative; isolation: isolate; z-index: 0; min-height: 0;
  margin: calc(-1 * (var(--bar) + var(--s5))) calc(50% - 50vw + var(--rail) / 2) -84px;
  padding: calc(var(--bar) + 104px) calc(50vw - var(--rail) / 2 - 50%) 200px; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: url("sea-hero.jpg") right 58% / auto 108% no-repeat;
  -webkit-mask: linear-gradient(to right, transparent 8%, #000 45%), linear-gradient(#000 60%, transparent); -webkit-mask-composite: source-in;
  mask: linear-gradient(to right, transparent 8%, #000 45%), linear-gradient(#000 60%, transparent); mask-composite: intersect; filter: none; opacity: 1; transform-origin: 80% 60%;
  animation: nv-tide 48s ease-in-out infinite alternate; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; top: 52%; height: 30%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,.5) 50%, transparent 65%) 0 0 / 250% 100% no-repeat;
  -webkit-mask: linear-gradient(transparent, #000 40%, transparent); mask: linear-gradient(transparent, #000 40%, transparent);
  mix-blend-mode: soft-light; animation: nv-glint 11s ease-in-out infinite; }
.hero .eyebrow { margin-bottom: 18px; font-size: 16px; }
.hero .page-title { font-size: 68px; line-height: 1.02; letter-spacing: -.035em; color: var(--brand); margin: 0; padding: 0; animation: nv-rise .7s var(--ease) both .05s; }
@keyframes nv-tide { from { transform: scale(1.02); } to { transform: scale(1.07) translateX(-1.2%); } }
@keyframes nv-glint { 0% { background-position: 120% 0; } 60%, 100% { background-position: -30% 0; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero::before { filter: invert(1) hue-rotate(180deg) brightness(.8) contrast(.9); opacity: .55; } }
:root[data-theme="dark"] .hero::before { filter: invert(1) hue-rotate(180deg) brightness(.8) contrast(.9); opacity: .55; }

/* ---- 프로젝트 카드 ---- */
.tiles { position: relative; z-index: 1; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.tiles .tile:not(.new) { overflow: hidden; isolation: isolate; gap: 10px; min-height: 270px; padding: 28px 28px 22px; border-radius: 16px; background: var(--bg-2);
  box-shadow: 0 1px 2px rgba(26,52,93,.06), 0 14px 32px -18px rgba(26,52,93,.28); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.tiles .tile:not(.new):hover { transform: translateY(-4px); background: var(--bg-2); box-shadow: 0 2px 4px rgba(26,52,93,.06), 0 24px 44px -20px rgba(26,52,93,.38); }
.tiles .tile:not(.new)::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, color-mix(in srgb, var(--brand-sky) 45%, transparent) 50%, transparent 70%) 0 0 / 250% 100% no-repeat;
  background-position: 130% 0; opacity: 0; }
.tiles .tile:not(.new):hover::after { opacity: 1; animation: nv-shine .9s var(--ease) forwards; }
.atile.big { width: 64px; height: 64px; border-radius: 17px; background: linear-gradient(180deg, color-mix(in srgb, var(--brand-sky) 45%, var(--bg-2)), color-mix(in srgb, var(--brand-sky) 80%, var(--bg-2)));
  box-shadow: 0 1px 2px rgba(26,52,93,.12), inset 0 1px 0 rgba(255,255,255,.7); color: var(--brand); transition: transform .4s var(--ease); }
.atile.big .ic { width: 30px; height: 30px; }
.tile:hover .atile.big { transform: translateY(-2px) rotate(-4deg); }
.tile-name { margin-top: 10px; font-size: 28px; letter-spacing: -.02em; color: var(--brand); }
.tile-text { color: var(--tx-2); font-size: 15.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-foot { padding-top: 14px; gap: 12px; }
.tile-state { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.tile-state .ic { width: 18px; height: 18px; flex: none; }
.tile-state.ok .ic { color: var(--added); } .tile-state.warn .ic { color: var(--warn); }
.tile-open, .tile.has-error .tile-open { color: var(--tx-3); font-size: 13px; }
.tile-go { font-size: 15px; }
.tile:hover .tile-go .ic { transform: translateX(4px); }
.tile.new { gap: 14px; padding: 8px 0; font-size: 17px; font-weight: 700; color: var(--brand); }
.tile.new .atile { width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 8px 18px -10px rgba(26,52,93,.8); transition: transform .3s var(--ease); }
.tile.new:hover { background: none; color: var(--brand); }
.tile.new:hover .atile { transform: rotate(90deg); }
@keyframes nv-shine { to { background-position: -40% 0; } }

/* ---- 화면 열기: 판이 차례로 떠오른다 ---- */
.page > *, .tiles > *, .rule-block, .people > *, .problems-view > *, .page-view > * { animation: nv-rise .55s var(--ease) both; }
.tiles > :nth-child(2), .people > :nth-child(2), .page > :nth-child(2) { animation-delay: .06s; }
.tiles > :nth-child(3), .people > :nth-child(3), .page > :nth-child(3) { animation-delay: .12s; }
.tiles > :nth-child(4), .people > :nth-child(4), .page > :nth-child(4) { animation-delay: .18s; }
.tiles > :nth-child(n+5), .people > :nth-child(n+5), .page > :nth-child(n+5) { animation-delay: .24s; }
.side:not(.hidden) { animation: nv-slide .35s var(--ease) both; }
.picker { animation: nv-open .28s var(--ease) both; transform-origin: top right; }
@keyframes nv-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes nv-slide { from { opacity: 0; transform: translateX(16px); } }
@keyframes nv-open { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
@keyframes nv-pop { from { transform: scale(.88); } 60% { transform: scale(1.04); } to { transform: none; } }

/* ---- 휴대폰: 아래 탭과 칸 고르개 ---- */
@media (max-width: 760px) {
  .tabbar { background: color-mix(in srgb, var(--bg-2) 82%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 -10px 30px -22px rgba(26,52,93,.45); }
  .tab { gap: 6px; color: var(--tx-2); font-weight: 600; justify-content: flex-start; padding-top: 9px; }
  .tab .ic { width: 20px; height: 20px; position: relative; z-index: 1; }
  .tab::after { content: ""; position: absolute; z-index: -1; top: 4px; left: 50%; width: 48px; height: 30px; margin-left: -24px; border-radius: 10px;
    background: var(--brand); transform: scale(.4); opacity: 0; transition: transform .3s var(--ease), opacity .2s; }
  .tab.cur::before { content: none; }
  .tab.cur { color: var(--brand); }
  .tab.cur .ic { color: var(--on-ink); }
  .tab.cur::after { transform: none; opacity: 1; }
  .tab:active .ic { transform: scale(.9); }
  .subnav { gap: 4px; padding: 0 var(--s3); }
  .subtab { border-radius: 10px; }
  .subtab.on { background: var(--brand); color: var(--on-ink); box-shadow: 0 6px 14px -8px rgba(26,52,93,.7); }
  .subtab.on .ic { color: var(--on-ink); }
  .hero { margin: 0 0 var(--s4); padding: 0; }
  .hero::before, .hero::after { display: none; }
  .hero .page-title { font-size: 32px; }
  .tiles .tile:not(.new) { min-height: 0; padding: 22px; }
  .tile-name { font-size: 22px; margin-top: 4px; }
  .atile.big { width: 52px; height: 52px; border-radius: 14px; }
  [data-tip]::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero::after { display: none; } }
:root[data-theme="dark"] .hero::after { display: none; }

/* ================= v10 "판화의 결" =================
   Alska 2026-11-29: "디자인 시스템도 이런 판화 느낌으로 전체적으로". 판화 표지처럼:
   a. 제목은 활자: Noto Serif KR(한글), EB Garamond(로마자, 번호). 본문과 조작 글은 Noto Sans KR 그대로.
   b. 종이: 바탕에 아주 옅은 종이 결(노이즈). 선이 아니라 면의 질감이다.
   c. 그림은 판화로만: 로그인은 바다 판화 위, 빈 상태는 판화 문장. 사진, 3D, 그러데이션 일러스트는 쓰지 않는다.
   d. 그림자는 잉크처럼 남색 기운. */
:root { --serif: "Noto Serif KR", "EB Garamond", Georgia, serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .2 0 0 0 0 .36 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
body, .rail { background-image: var(--grain); }
.page-title, .pv-title, .tile-name, .side-title, .sheet-title, .rule-name, .hero .page-title, .pp-name, .mm-head .pv-title {
  font-family: var(--serif); font-weight: 700; letter-spacing: -.015em; }
.hero .page-title { font-size: 66px; letter-spacing: -.02em; }
.tile-name { font-size: 27px; }
.wm { font-family: "EB Garamond", Georgia, serif; }
/* 빈 상태: 판화 문장 */
.calm .crest { width: 120px; height: 120px; opacity: .9; animation: nv-bob 6s ease-in-out infinite; }
/* 로그인: 바다 판화 위의 흰 판 */
.shell-page:has(.signin) { background: url("sea-full.jpg") 70% 60% / cover no-repeat fixed, var(--bg); }
.center:has(.signin) { min-height: 100vh; }
.sheet.signin { background: color-mix(in srgb, var(--bg-2) 88%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: 18px; box-shadow: 0 30px 60px -30px rgba(26,52,93,.45); animation: nv-rise .7s var(--ease) both; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .shell-page:has(.signin) { background: var(--bg); } }
:root[data-theme="dark"] .shell-page:has(.signin) { background: var(--bg); }
.btn.submit { width: 100%; min-height: 48px; border-radius: 12px; font-size: 16px; box-shadow: 0 10px 20px -12px rgba(26,52,93,.8); transition: filter .15s, transform .12s; } .btn.submit:hover { filter: brightness(1.15); }
/* 판화 아이콘: 메뉴 타일(30px)과 카드 타일(44px). 알파 마스크를 글자색으로 칠해 어두운 테마와 고른 상태에서도 같은 그림. 16 to 20px 자리는 면 아이콘을 쓴다 */
.eng { display: block; width: 30px; height: 30px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.rtile { width: 40px; height: 40px; } .rtile .eng { width: 32px; height: 32px; }
.atile.big .eng { width: 46px; height: 46px; }
.rail-item:hover .eng { animation: nv-bob 1.2s var(--ease); }
.e-projects { --m: url("eng-projects.png"); }
.e-members { --m: url("eng-members.png"); }
.e-skills { --m: url("eng-skills.png"); }
.e-concepts { --m: url("eng-concepts.png"); }
.e-expression { --m: url("eng-expression.png"); }
.e-canvas { --m: url("eng-canvas.png"); }
.e-matrix { --m: url("eng-matrix.png"); }
.e-problems { --m: url("eng-problems.png"); }
.e-changes { --m: url("eng-changes.png"); }
.e-connect { --m: url("eng-connect.png"); }
.e-account { --m: url("eng-account.png"); }

/* ================= v11 "휴대폰 먼저" =================
   Alska 2026-11-29 "우리 서비스를 모바일퍼스트로 디자인해줘". 휴대폰을 기준 화면으로 다시 잡는다:
   a. 엄지가 닿는 아래: 영역은 아래 탭, 화면은 위 칸 고르개, 상세는 아래에서 올라오는 판(손잡이 달린).
   b. 누르는 자리는 44px 이상, 적는 칸은 48px에 글자 16px(휴대폰이 확대하지 않게).
   c. 휴대폰에서도 작업 공간 첫 화면은 바다 판화와 세리프 제목으로 연다.
   d. 위 막대는 종이 위 반투명 유리, 안전 영역(노치)을 비운다. */
.rule-head:not(:has(.stile)) { display: flex; }
@media (max-width: 760px) {
  :root { --bar: 56px; --tabs: 64px; }
  .top { padding-top: env(safe-area-inset-top); height: calc(var(--bar) + env(safe-area-inset-top));
    background: color-mix(in srgb, var(--bg) 80%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .with-rail .appbar .brand, .with-rail .appbar select.act { font-family: var(--serif); font-size: 19px; letter-spacing: -.01em; }
  .appbar-mark svg { width: 30px; height: 30px; border-radius: 8px; }
  .subnav { top: calc(var(--bar) + env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 80%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  .subtab { min-height: 36px; padding: 0 14px; font-size: 15px; }
  /* 누르는 자리 */
  .ib, .act.ib { width: 44px; height: 44px; border-radius: 12px; }
  .ib .ic { width: 22px; height: 22px; }
  .act.next-problem { width: 44px; }
  /* 적는 칸 */
  .field, input.field, select.field, textarea.field, .invite input, .sheet input { min-height: 48px; font-size: 16px; border-radius: 12px; }
  .btn { min-height: 48px; border-radius: 12px; }
  .invite { flex-wrap: wrap; gap: 10px; }
  .invite > input { flex: 1 1 100%; }
  .invite .ib.primary { margin-left: auto; }
  /* 작업 공간 첫 화면: 바다 판화와 세리프 제목 */
  .hero { display: block; margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) -56px; padding: 36px var(--s4) 96px; min-height: 0; }
  .hero::before { display: block; background-position: 88% 60%; background-size: auto 118%; animation: none;
    -webkit-mask: linear-gradient(#000 55%, transparent); mask: linear-gradient(#000 55%, transparent); }
  .hero::after { display: none; }
  .app .hero .page-title, .hero .page-title, .shell-main .hero .page-title { display: block !important; font-size: 38px; line-height: 1.05; max-width: 62%; }
  .tiles { gap: 14px; }
  .tiles .tile:not(.new) { padding: 20px 20px 16px; border-radius: 18px; gap: 8px; }
  .tiles .tile:not(.new):hover { transform: none; }
  .tiles .tile:not(.new):active { transform: scale(.985); }
  .atile.big { width: 52px; height: 52px; border-radius: 14px; }
  .atile.big .eng { width: 40px; height: 40px; }
  .tile-name { font-size: 24px; }
  .tile-foot { padding-top: 8px; }
  .tile.new { padding: 12px 4px; }
  /* 아래 탭: 엄지 자리 */
  .tabbar { height: calc(var(--tabs) + env(safe-area-inset-bottom)); }
  .tab { padding-top: 10px; font-size: 11.5px; }
  .tab .ic { width: 22px; height: 22px; }
  .tab::after { top: 6px; width: 52px; height: 32px; margin-left: -26px; border-radius: 11px; }
  /* 아래에서 올라오는 판 */
  .side:not(.hidden), .picker { border-radius: 20px 20px 0 0; padding-top: 26px; animation: nv-sheet .35s var(--ease) both; }
  .side:not(.hidden)::before, .picker::before { content: ""; position: absolute; top: 9px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--bg-4); }
  .side .close { top: 14px; }
  /* 로그인 */
  .center:has(.signin) { padding: 0 var(--s4); }
  .sheet.signin { padding: 28px 22px 26px; }
  .shell-page:has(.signin) { background-attachment: scroll; background-position: 62% 100%; background-size: auto 70%; }
}
@keyframes nv-sheet { from { transform: translateY(40px); opacity: 0; } }
@media (max-width: 760px) {
  /* 검증에서 나온 것: 로고 링크는 44px 자리로, 글 속 참조 링크는 위아래로 넓혀 24px 이상(WCAG 2.5.8) */
  .appbar-mark { display: grid !important; place-items: center; width: 44px; height: 44px; margin-left: -7px; }
  .ref { padding-block: 3px; }
}
