/* 손글 — 웹 앱 틀. 라이트 · prefers-color-scheme 다크 · [data-theme] 강제.
   설계: docs/superpowers/specs/2026-10-11-desktop-ui-redesign-design.md(틀·색·글꼴) · 2026-11-20-web-mcp-pivot-design.md 8절(웹에 남긴 화면)
   미리보기(.post) 안은 테마와 무관하게 늘 흰 바탕 — 네이버 스마트에디터 뷰어 값을 옮긴다(아래 .post).
   글꼴은 앱에 들어 있는 Pretendard·나눔고딕(web/fonts, OFL) — 같은 출처 파일이라 외부 요청이 아니다 */
@font-face {
  font-family: 'Pretendard';
  font-weight: 45 920;
  font-style: normal;
  /* 로컬 파일이라 바로 온다 — 다른 글꼴로 그렸다가 바뀌는 깜박임을 막는다 */
  font-display: block;
  src: url('/web/fonts/PretendardVariable.woff2') format('woff2-variations'), url('/web/fonts/PretendardVariable.woff2') format('woff2');
}
/* 네이버 본문 기본 글꼴(se-nanumgothic)과 같은 나눔고딕 — 맥·대부분의 PC 에 깔려 있지 않아 앱에 넣는다.
   네이버 것은 한글 2,350자만 담은 축소판이지만 OFL 예약 이름(Nanum) 때문에 원본을 줄이지 않고 woff2 로만 바꿨다 */
@font-face { font-family: 'Songeul Nanum'; font-weight: 400; font-display: block; src: url('/web/fonts/NanumGothic-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Songeul Nanum'; font-weight: 700; font-display: block; src: url('/web/fonts/NanumGothic-Bold.woff2') format('woff2'); }
:root {
  --bg:#F6F4EF; --surface:#FFFFFF; --surface-2:#F1EEE7; --line:#DCD7CC; --line-strong:#B9B3A6;
  --ink:#1C1F1D; --ink-2:#474C48; --ink-3:#636863;
  --primary:#1D6B50; --on-primary:#FFFFFF; --primary-soft:#E3F0EA;
  --block:#B3261E; --block-soft:#FBE9E7; --warn:#8A5300; --warn-soft:#FBF0DC;
  --check:#1E4FB8; --check-soft:#E6EDFB; --unverified:#A87300; --focus:#1E4FB8;
  /* 입력칸 테두리 — 바탕(흰 칸 3.53:1 · 페이지 3.21:1)과 3:1 이상(WCAG 1.4.11). 장식 선(--line-strong)보다 진하다 */
  --field-line:#8E8879;
  --paper:#FFFFFF; --paper-ink:#222222;
  --canvas:#E9E5DD; --chrome:#EFECE5; --paper-edge:rgba(0,0,0,.10); --paper-shadow:0 8px 28px rgba(0,0,0,.10);
  --font:'Pretendard','Apple SD Gothic Neo','Malgun Gothic',sans-serif;
  --fs-title:24px; --fs-h2:18px; --fs-body:15px; --fs-sub:14px; --fs-min:13px;
  --r-card:12px; --r-btn:8px; --h-btn:36px; --h-btn-main:40px; --h-ctl:32px;
  --tb:48px; --sb:240px; --rail:52px; --insp:clamp(340px, 24vw, 440px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg:#161817; --surface:#1F2220; --surface-2:#2A2E2B; --line:#3A3F3B; --line-strong:#5A605B;
  --ink:#ECEDE9; --ink-2:#B9BDB7; --ink-3:#959A94;
  --primary:#5CC79C; --on-primary:#0E1B15; --primary-soft:#1E3A2F;
  --block:#FF8A80; --block-soft:#3A1F1D; --warn:#F2B655; --warn-soft:#3A2E17;
  --check:#8AB0FF; --check-soft:#1D2A44; --focus:#8AB0FF; --unverified:#E0A82E; --field-line:#7A807B;
  --canvas:#2A2E2B; --chrome:#1B1D1C; --paper-edge:rgba(255,255,255,.10); --paper-shadow:none;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg:#161817; --surface:#1F2220; --surface-2:#2A2E2B; --line:#3A3F3B; --line-strong:#5A605B;
  --ink:#ECEDE9; --ink-2:#B9BDB7; --ink-3:#959A94;
  --primary:#5CC79C; --on-primary:#0E1B15; --primary-soft:#1E3A2F;
  --block:#FF8A80; --block-soft:#3A1F1D; --warn:#F2B655; --warn-soft:#3A2E17;
  --check:#8AB0FF; --check-soft:#1D2A44; --focus:#8AB0FF; --unverified:#E0A82E; --field-line:#7A807B;
  --canvas:#2A2E2B; --chrome:#1B1D1C; --paper-edge:rgba(255,255,255,.10); --paper-shadow:none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* 클래스의 display 가 hidden 속성을 이기지 못하게 — 화면 전환(검토 ↔ 복사 완료)이 hidden 으로 한다 */
[hidden] { display: none !important; }
/* 문서는 스크롤하지 않는다 — 앱 틀이 고정되고 영역마다 따로 스크롤한다(설계 2.1) */
html, body { height: 100%; overflow: hidden; }
html { -webkit-text-size-adjust: 100%; }
/* 한국어는 낱말(어절) 단위로 줄을 바꾼다 — 글자 가운데서 끊지 않게. 미리보기(.post)는 네이버 뷰어대로 break-word */
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--fs-body)/1.6 var(--font); word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: var(--fs-title); line-height: 1.35; font-weight: 700; letter-spacing: -0.4px; text-wrap: balance; }
h1.hero { font-size: 28px; }
h2, .h2 { font-size: var(--fs-h2); font-weight: 700; line-height: 1.4; letter-spacing: -0.2px; }
h3, .h3 { font-size: 16px; font-weight: 700; }
.h4 { font-size: var(--fs-min); color: var(--ink-3); font-weight: 400; margin: 0; }
a { color: var(--primary); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* 화면이 코드로 옮긴 초점(제목) — 화면 읽기 프로그램용이라 테두리를 그리지 않는다 */
[tabindex="-1"]:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lead { font-size: 16px; color: var(--ink-2); }
.note { font-size: var(--fs-sub); color: var(--ink-2); }
.note:empty { margin: 0; }
/* 업종 기본값을 더할지 묻는 자리 — 묻지 않을 때 빈 칸이 stack 간격을 한 번 더 만들지 않게 */
.offer:empty { display: none; }
.muted { color: var(--ink-2); font-size: var(--fs-sub); }
.small { font-size: var(--fs-min); }
.strong { font-weight: 600; }
.accent { color: var(--primary); font-weight: 600; }
.bad { color: var(--block); }
.good { color: var(--primary); font-weight: 600; }
.pre { white-space: pre-wrap; }
kbd { font: inherit; font-size: 13px; padding: 0 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
/* 버튼 안 단축키 글자 — ⌘↵ */
.key { font-size: var(--fs-min); font-weight: 500; opacity: .75; letter-spacing: 0; }

/* ─── 앱 틀 ─── */
/* 화면 가장자리 — 폰 앱(mobile/)은 웹뷰가 상태 바·홈 표시줄 뒤까지 그린다(viewport-fit=cover). Android 는 Capacitor 가
   --safe-area-inset-* 를 심는다(옛 웹뷰의 env() 가 틀려서). 브라우저에선 대개 0 이다 */
:root { --sat: var(--safe-area-inset-top, env(safe-area-inset-top, 0px)); --sar: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
  --sab: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)); --sal: var(--safe-area-inset-left, env(safe-area-inset-left, 0px)); }
.app { padding: var(--sat) var(--sar) var(--sab) var(--sal); }
.app { height: 100vh; height: 100dvh; transition: grid-template-columns 150ms ease-out; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: var(--tb) minmax(0, 1fr) auto; grid-template-areas: "tb tb" "sb view" "tab tab"; }
.toolbar { grid-area: tb; }
/* 폰 바닥 탭 바 — 맨 위 화면에서만(ui.js renderTabbar). 홈 표시줄 자리까지 탭 바 색으로 칠한다 */
.tabbar { grid-area: tab; display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 0 var(--sab); margin-bottom: calc(-1 * var(--sab)); background: var(--chrome); border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; color: var(--ink-3); font-size: var(--fs-min); font-weight: 600; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.tab[aria-current="page"] { color: var(--primary); }
.sidebar { grid-area: sb; }
.view { grid-area: view; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; position: relative; }
/* 검토 화면 — 영역마다 따로 스크롤하니 내용 영역 자체는 고정 */
.view.panes { overflow: hidden; }

/* 툴바 — 이동·상태만 */
.toolbar { display: flex; align-items: center; gap: 4px; padding: 0 12px; background: var(--chrome); border-bottom: 1px solid var(--line); min-width: 0; }
.toolbar .tb-title { min-width: 0; margin-left: 8px; font-size: var(--fs-sub); font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar .tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.tbtn { display: inline-flex; align-items: center; justify-content: center; width: var(--h-ctl); height: var(--h-ctl); flex: none; padding: 0; color: var(--ink-2); background: none; border: 0; border-radius: var(--r-btn); cursor: pointer; }
.tbtn:hover { background: var(--surface-2); color: var(--ink); }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; letter-spacing: -0.3px; color: var(--ink); text-decoration: none; padding: 0 4px; }
.logo img { width: 22px; height: 22px; border-radius: 6px; }
.steps { list-style: none; margin: 0 0 0 8px; padding: 0; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-sub); color: var(--ink-3); white-space: nowrap; }
.steps li { display: flex; align-items: center; gap: 6px; }
.steps .sep { color: var(--line-strong); }
.steps .done { color: var(--ink-2); }
.steps .done svg { color: var(--primary); }
.steps .now { color: var(--primary); font-weight: 700; }
.steps .count { display: none; }

/* 사이드바 — 펼침 240 · 레일 52 · 없음. 규칙은 ui.js sidebarMode() */
.app[data-sb="none"] { grid-template-columns: 0 minmax(0, 1fr); }
.app[data-sb="none"] .sidebar { display: none; }
.app[data-sb="rail"] { grid-template-columns: var(--rail) minmax(0, 1fr); }
.app[data-sb="open"] { grid-template-columns: var(--sb) minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; min-height: 0; background: var(--chrome); border-right: 1px solid var(--line); overflow: hidden; }
.sb-full { display: flex; flex-direction: column; gap: 4px; min-height: 0; height: 100%; padding: 10px 8px; width: var(--sb); }
.sb-rail { display: none; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; height: 100%; }
.app[data-sb="rail"]:not(.sb-over) .sb-full { display: none; }
.app[data-sb="rail"]:not(.sb-over) .sb-rail { display: flex; }
/* 레일에서 ☰ 로 열면 내용 위에 겹쳐 연다 — 폭을 뺏지 않는다 */
.app.sb-over .sidebar { position: fixed; z-index: 30; top: calc(var(--tb) + var(--sat)); bottom: var(--sab); left: var(--sal); width: var(--sb); box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.sb-scrim { position: fixed; z-index: 29; inset: calc(var(--tb) + var(--sat)) 0 0 0; background: rgba(0,0,0,.18); }
.sb-item { display: flex; align-items: center; gap: 10px; min-height: var(--h-ctl); padding: 0 10px; color: var(--ink); font: inherit; font-size: var(--fs-sub); text-decoration: none; background: none; border: 0; border-radius: var(--r-btn); cursor: pointer; text-align: left; width: 100%; }
.sb-item:hover { background: var(--surface-2); }
.sb-item[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sb-item svg { flex: none; color: var(--ink-3); }
.sb-item[aria-current="page"] svg { color: var(--primary); }
.sb-new { color: var(--primary); font-weight: 600; }
.sb-new svg { color: var(--primary); }
.sb-head { margin: 12px 10px 4px; font-size: var(--fs-min); font-weight: 600; color: var(--ink-3); }
.sb-list { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 1px; }
.sb-doc { display: flex; flex-direction: column; gap: 0; padding: 6px 10px; color: var(--ink); text-decoration: none; border-radius: var(--r-btn); line-height: 1.4; }
.sb-doc:hover { background: var(--surface-2); }
.sb-doc[aria-current="page"] { background: var(--primary-soft); }
.sb-doc b { font-size: var(--fs-sub); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-doc[aria-current="page"] b { font-weight: 700; color: var(--primary); }
.sb-doc small { font-size: var(--fs-min); color: var(--ink-3); }
/* 글 지우기 — 줄에 올리거나 초점이 오면 보인다. 묻는 줄은 그 글 아래에 */
.sb-li { position: relative; }
.sb-del { position: absolute; top: 6px; right: 4px; min-height: 26px; padding: 0 8px; font: inherit; font-size: var(--fs-min); color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer; opacity: 0; }
.sb-li:hover .sb-del, .sb-del:focus-visible { opacity: 1; }
/* 터치 화면엔 올릴 마우스가 없다 — 늘 보인다 */
@media (hover: none) { .sb-del { opacity: 1; } }
.sb-li > .ask { padding: 4px 10px 8px; font-size: var(--fs-min); }
.sb-foot { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.sb-rail .tbtn { width: 36px; height: 36px; }
.sb-rail .tbtn[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.sb-rail .grow { flex: 1; }

/* ─── 배치 ─── */
.page { max-width: 960px; margin: 0 auto; padding: 32px 32px 24px; }
.page.narrow { max-width: 720px; }
.page.mid { max-width: 960px; }
.page.wide { max-width: 1240px; }
.page.center { max-width: 640px; min-height: 100%; display: flex; flex-direction: column; justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 8px; }
.stack.loose { gap: 32px; }
.stack.none { gap: 2px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.row.nowrap { flex-wrap: nowrap; }
.row.baseline { align-items: baseline; }
.row.end { align-items: flex-end; }
.push { margin-left: auto; }
.grow { flex: 1 1 auto; min-width: 0; }
.split { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.split > :first-child { flex: 999 1 480px; min-width: 0; }
.split > :last-child:not(:first-child) { flex: 1 1 300px; min-width: 0; }
/* 첫 글 도우미 카드 — 강조색 왼쪽 띠로 다른 카드와 구별 */
.card.guide { border-left: 3px solid var(--primary); }
.card.guide > summary { cursor: pointer; }
.split.inner { gap: 24px; }
.split.inner > :first-child { flex-basis: 420px; }
.split.inner > :last-child { flex-basis: 300px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px 16px; }
.sticky { position: sticky; top: 16px; }
.rule { padding-top: 16px; border-top: 1px solid var(--line); }
ul.plain, ol.plain { list-style: none; margin: 0; padding: 0; }

/* 하단 액션 바 — 폼의 제출 줄. 내용 영역 바닥에 붙어 늘 보인다(설계 0절 "다음 행동은 작업 영역 바닥") */
.actionbar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; padding: 12px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.actionbar .grow { color: var(--ink-2); font-size: var(--fs-sub); }
.card .actionbar { background: color-mix(in srgb, var(--surface) 88%, transparent); }

/* ─── 버튼 · 입력 ─── */
button, input, select, textarea { font: inherit; color: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--h-btn); padding: 0 16px; font-size: var(--fs-body); font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-btn); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { min-height: var(--h-btn-main); padding: 0 20px; font-size: 15px; font-weight: 700; color: var(--on-primary); background: var(--primary); border-color: var(--primary); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small { min-height: var(--h-ctl); padding: 0 12px; font-size: var(--fs-sub); }
.btn.primary.small { min-height: var(--h-ctl); padding: 0 14px; font-size: var(--fs-sub); }
.btn.tiny { min-height: 28px; padding: 0 10px; font-size: var(--fs-min); font-weight: 500; }
.btn.icon { min-width: var(--h-ctl); min-height: var(--h-ctl); padding: 0; font-size: 18px; }
.btn.wide { justify-content: flex-start; width: 100%; }
.btn.outline { color: var(--primary); border-color: var(--primary); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn[aria-disabled="true"] { color: var(--ink-3); background: var(--surface-2); border-style: dashed; border-color: var(--line-strong); cursor: not-allowed; filter: none; }
.btn.toggle[aria-pressed="false"] svg { display: none; }
.btn.toggle[aria-pressed="true"] { color: var(--on-primary); background: var(--ink-2); border-color: var(--ink-2); font-weight: 700; }
.link { min-height: 28px; padding: 0 2px; font-size: var(--fs-sub); font-weight: 600; color: var(--primary); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; }
.row > .link { align-self: center; }
.input { width: 100%; min-height: var(--h-btn); padding: 6px 12px; font-size: var(--fs-body); color: var(--ink); background: var(--surface); border: 1px solid var(--field-line); border-radius: var(--r-btn); }
.input:focus { border-color: var(--primary); }
.input.big { min-height: 44px; font-size: 16px; }
textarea.input { resize: vertical; line-height: 1.6; }
textarea.input.line { field-sizing: content; resize: none; line-height: 1.5; }
textarea.input.big { padding: 10px 14px; }
.input.auto { width: auto; max-width: 100%; }
/* 줄 안의 칸 — width:100% 그대로면 flex 기준 폭이 줄 전체라 옆 버튼이 다음 줄로 밀린다 */
:is(.row, .qrow) > .input { flex: 1 1 240px; width: auto; min-width: 0; }
.input.small { width: auto; min-height: var(--h-ctl); padding: 4px 8px; font-size: var(--fs-sub); }
.input.mono { font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.input:disabled { color: var(--ink-3); background: var(--surface-2); border-color: var(--line); }
select.input { padding-right: 28px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); flex: none; }
input[type=color] { width: 36px; height: 36px; padding: 2px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--surface); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label { font-size: var(--fs-sub); font-weight: 600; }
.check { display: flex; gap: 10px; align-items: center; min-height: var(--h-ctl); cursor: pointer; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
.group { display: flex; flex-direction: column; gap: 8px; }
.group > legend { margin-bottom: 8px; font-size: 16px; font-weight: 700; }
/* 글 종류 폼의 고르기 — 섹션 제목보다 한 단계 아래, 칸 이름(.field > label)과 같은 크기 */
.tform .group > legend { margin-bottom: 4px; font-size: var(--fs-sub); font-weight: 600; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.seg span { display: flex; align-items: center; min-height: var(--h-btn); padding: 0 14px; border: 1px solid var(--field-line); border-radius: var(--r-btn); background: var(--surface); font-size: var(--fs-sub); }
.seg input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.segbox { display: flex; gap: 2px; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; }
.segbtn { min-height: 28px; padding: 0 12px; font-size: var(--fs-min); font-weight: 600; color: var(--ink-2); background: transparent; border: 0; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.segbtn[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.swatch { width: 36px; height: 36px; border-radius: 8px; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--primary); }

/* ─── 카드 · 칩 · 알림 ─── */
.card { padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
details.card > summary { cursor: pointer; font-size: 15px; font-weight: 700; min-height: 24px; }
details.card[open] > summary { margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sub); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; }
.chip.on { background: var(--primary-soft); color: var(--primary); }
.chip.off { border: 1px dashed var(--line-strong); color: var(--ink-2); }
.chip.soft { background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-min); padding: 1px 8px; }
.chip.btn { min-height: var(--h-ctl); padding: 0 12px; font-size: var(--fs-sub); font-weight: 500; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; }
.chip.btn[aria-pressed="true"] { color: var(--on-primary); background: var(--primary); border-color: var(--primary); font-weight: 700; }
.chip.tag { padding: 1px 2px 1px 12px; background: var(--surface-2); font-size: var(--fs-sub); }
.chip .x { width: 28px; height: 28px; margin: -4px 0; font-size: 18px; color: var(--ink-2); background: none; border: 0; cursor: pointer; }
.btn.chipbtn { min-height: var(--h-ctl); padding: 0 14px; font-size: var(--fs-sub); color: var(--primary); border-color: var(--primary); border-radius: 999px; }
.badge { display: inline-block; padding: 0 7px; font-size: var(--fs-min); font-weight: 600; color: var(--primary); border: 1px solid var(--primary); border-radius: 999px; }
.badge.off { color: var(--ink-2); border-color: var(--line-strong); }
details summary .badge { margin-left: 8px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; background: var(--warn-soft); border-radius: 10px; font-size: var(--fs-sub); }
.notice .mark, .alert .mark, .mark.bad { flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--warn); }
.notice p + p { margin-top: 4px; }
.alert { display: flex; flex-direction: column; gap: 12px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; }
.alert-head { display: flex; align-items: center; gap: 12px; }
.alert-head h1 { font-size: 22px; }
.alert .mark { width: 30px; height: 30px; background: var(--block); color: #fff; }
.alert pre { white-space: pre-wrap; font-size: var(--fs-min); max-height: 240px; overflow: auto; }
.mark.bad { background: var(--block); }
.busy { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.spinner { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2.5px solid var(--primary-soft); border-top-color: var(--primary); animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── 메뉴(블로그 바꾸기) ─── */
.menu { position: relative; }
.menu summary { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; font-weight: 700; font-size: var(--fs-sub); border-radius: var(--r-btn); cursor: pointer; list-style: none; }
.menu summary:hover { background: var(--surface-2); }
.menu summary > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu summary::-webkit-details-marker { display: none; }
.menu ul { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; min-width: 200px; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.14); }
.menu li > * { display: flex; width: 100%; min-height: var(--h-ctl); align-items: center; padding: 0 10px; font: inherit; font-size: var(--fs-sub); color: var(--ink); background: none; border: 0; border-radius: 6px; text-align: left; cursor: pointer; text-decoration: none; }
.menu li > :hover { background: var(--surface-2); }
.menu [aria-current="true"] { font-weight: 700; }

/* ─── 순서 안내 ─── */
.howto { list-style: none; counter-reset: n; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 10px; }
.howto li { counter-increment: n; display: flex; flex-direction: column; gap: 6px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.howto li::before { content: counter(n); width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.howto b { font-size: 15px; }
.howto.mini li { flex-direction: row; align-items: center; gap: 10px; padding: 0; background: none; border: 0; }
.howto.mini li::before { flex: none; width: 24px; height: 24px; background: var(--primary-soft); color: var(--primary); }
/* 좁은 열(검사 패널) 안의 올리는 순서 — 한 줄에 하나 */
.howto.list { grid-template-columns: 1fr; }
.howto.list li { flex-direction: row; align-items: flex-start; gap: 10px; padding: 10px 12px; }
.howto.list li::before { flex: none; }
.howto.list li > div { display: flex; flex-direction: column; gap: 2px; }

/* ─── 홈 ─── */
.resume { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--primary); border-radius: var(--r-card); }
.recent { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.recent li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 16px; border-bottom: 1px solid var(--surface-2); }
.recent li:last-child { border-bottom: 0; }
.recent a { flex: 1 1 320px; min-height: 24px; color: var(--ink); font-weight: 600; text-decoration: none; }
.recent a:hover { text-decoration: underline; }

/* ─── 사진 ─── */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: var(--fs-sub); color: var(--ink-2); }
.thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); gap: 10px; }
.thumbs:empty { display: none; }
.thumbs li { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-min); }
.thumbs img, .thumbs .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--line); }
.thumbs .ph { display: flex; align-items: center; justify-content: center; color: var(--ink-2); }
.thumbs .btn { align-self: flex-start; }

/* ─── 물어본 것 ─── */
.qlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.qcard { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }

/* AI가 내린 결정 — 검토 화면에서 접힌 카드 안에 */
.decisions { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sub); color: var(--ink-2); }

/* ─── 검토 — 미리보기 무대 + 검사 패널(설계 3.5) ─── */
.review { display: grid; grid-template-columns: minmax(0, 1fr) var(--insp); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "stage insp" "stage copy"; height: 100%; }
.stage { grid-area: stage; }
.inspector { grid-area: insp; }
.copybar { grid-area: copy; border-left: 1px solid var(--line); }
/* 시트 장치(손잡이·닫기·상태 줄·가림막)는 폰에서만 — 넓은 화면은 오른쪽 패널이 늘 보인다 */
.sheet-head, .sheet-btn, .sheet-scrim { display: none; }
/* 쿠폰 이름 — 넓은 화면은 긴 이름, 폰 독은 짧은 이름 */
.lbl-short { display: none; }
.stage { min-width: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 22px 48px; background: var(--canvas); }
.stage-hint { font-size: var(--fs-min); color: var(--ink-2); }
.inspector { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); }
.insp-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.copybar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.copybar .btn { justify-content: center; }
/* 본문 복사(주 버튼)는 한 줄 전체 — 첫 자식은 폰 시트 손잡이(넓은 화면에선 감춤)라 :first-child 로 고르지 않는다 */
.copybar > [data-primary], .copybar > .ask { grid-column: 1 / -1; }
.copybar .note { grid-column: 1 / -1; font-size: var(--fs-min); }
.copybar .note:empty { display: none; }
.copybar .tagrow { grid-column: 1 / -1; }
.chip.btn.did { color: var(--primary); border-color: var(--primary); }
.todo { gap: 12px; }
.state { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; }
.state b { font-size: 16px; }
.state span { font-size: var(--fs-sub); color: var(--ink-2); }
.state.bad { background: var(--block-soft); }
.state.bad b { color: var(--block); }
.state.good { background: var(--primary-soft); }
.state.good b { color: var(--primary); }
/* 확인할 것이 남았다 — 막지도 않고 다 됐다고도 하지 않는다 */
.state.neutral { background: var(--surface-2); }
.must, .recheck { border: 1.5px solid var(--block); }
.recheck { border-style: dashed; }
.must h2, .recheck h2 { font-size: 15px; color: var(--block); }
:is(.must, .recheck) .item + .item { padding-top: 12px; border-top: 1px solid var(--line); }
.inspector .card { padding: 14px; }
.inspector h2 { font-size: 15px; }
.inspector blockquote { margin: 0; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; font-size: var(--fs-sub); }
.inspector summary { font-size: var(--fs-sub); font-weight: 600; }
.inspector .thumbs { grid-template-columns: 1fr; }
.inspector .thumbs li { flex-direction: row; gap: 10px; align-items: flex-start; }
.inspector .thumbs img { width: 72px; flex: none; }
.g.block, b.block { color: var(--block); }
.warn { color: var(--warn); }
/* .row.ask 는 화면 안 확인(askInline) 줄이다 — 글자색을 물려받지 않게 */
.ask:not(.row) { color: var(--check); }
.refs { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-sub); }
.refs li { display: flex; gap: 8px; }
.bad.small { font-size: var(--fs-min); }
.bigcheck { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; flex: none; }
.uv { text-decoration: underline wavy var(--unverified); text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-skip-ink: none; }

/* 미리보기 — 테마와 무관하게 흰 바탕. 값은 네이버 스마트에디터 뷰어 CSS 실측(editor-static.pstatic.net se.viewer.css 1.78.1, 2026-10-12).
   휴대폰 폭(.narrow) = 뷰어 768px 미만: 본문 16px, 제목 26px. 넓게 = PC: 본문 15px, 제목 32px. 둘 다 줄간격 1.8·글자 #000 */
.post {
  width: 700px; max-width: 100%; flex: none; padding: 24px 20px 32px; color: #000000; background: #FFFFFF; color-scheme: light;
  font: 15px/1.8 'Songeul Nanum', arial, 'Nanum Gothic', NanumGothic, sans-serif; word-break: break-word; overflow-wrap: break-word;
  /* 다크에선 그림자 대신 1px 테두리만 — 어두운 바탕 위 흰 종이가 번져 보이지 않게(설계 6.2) */
  border-radius: 12px; box-shadow: 0 0 0 1px var(--paper-edge), var(--paper-shadow);
  /* 모델이 쓴 position:fixed 같은 스타일이 미리보기 밖으로 못 나오게 */
  contain: layout paint;
}
/* 390px = 흔한 휴대폰 폭. 좌우 20px 를 빼면 본문 350px — 16px 한글 21자 남짓(rules/platform.md 4절) */
.post.narrow { width: 390px; font-size: 16px; }
.post :focus-visible { outline-color: #1E4FB8; }
.phead { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid #EEEEEE; line-height: 1.35; }
.phead > span:last-child { display: flex; flex-direction: column; }
.phead b { font-size: 14px; }
.phead small { font-size: 12px; color: #6B6B6B; } /* 미리보기 머리 — 네이버 뷰어 재현이라 앱 최소 글자(13px) 규칙 밖 */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #D9DED9; }
/* 네이버 제목은 굵지 않다 — 크기로만 구분하고 아래 옅은 선 */
.ptitle { margin: 0 0 40px; padding-bottom: 29px; font-size: 32px; line-height: 48px; font-weight: 400; color: #000000; border-bottom: 1px solid rgba(0, 0, 0, 0.1); }
.narrow .ptitle { margin-bottom: 26px; font-size: 26px; line-height: 37px; }
/* 글자 크기 — 2026-10-12 스마트에디터 붙여넣기 실측. 에디터는 font-size:Npx 를 크기 목록(11·13·15·16·19·24·28·30·34·38) 중
   가장 가까운 값으로 붙인다(한가운데면 작은 쪽, 38 넘으면 38). 휴대폰 뷰어는 그 크기를 다시 매긴다(se.viewer.css se-fs-fsN, 768px 미만).
   규칙은 8~60px 를 표로 펼친 것이다 — 목록을 바꾸면 다시 만든다 */
.post .pbody :is([style*="font-size:8px"], [style*="font-size: 8px"], [style*="font-size:9px"], [style*="font-size: 9px"], [style*="font-size:10px"], [style*="font-size: 10px"], [style*="font-size:12px"], [style*="font-size: 12px"]) { font-size: 11px !important; }
.post .pbody :is([style*="font-size:14px"], [style*="font-size: 14px"]) { font-size: 13px !important; }
.post .pbody :is([style*="font-size:17px"], [style*="font-size: 17px"]) { font-size: 16px !important; }
.post .pbody :is([style*="font-size:18px"], [style*="font-size: 18px"], [style*="font-size:20px"], [style*="font-size: 20px"], [style*="font-size:21px"], [style*="font-size: 21px"]) { font-size: 19px !important; }
.post .pbody :is([style*="font-size:22px"], [style*="font-size: 22px"], [style*="font-size:23px"], [style*="font-size: 23px"], [style*="font-size:25px"], [style*="font-size: 25px"], [style*="font-size:26px"], [style*="font-size: 26px"]) { font-size: 24px !important; }
.post .pbody :is([style*="font-size:27px"], [style*="font-size: 27px"], [style*="font-size:29px"], [style*="font-size: 29px"]) { font-size: 28px !important; }
.post .pbody :is([style*="font-size:31px"], [style*="font-size: 31px"], [style*="font-size:32px"], [style*="font-size: 32px"]) { font-size: 30px !important; }
.post .pbody :is([style*="font-size:33px"], [style*="font-size: 33px"], [style*="font-size:35px"], [style*="font-size: 35px"], [style*="font-size:36px"], [style*="font-size: 36px"]) { font-size: 34px !important; }
.post .pbody :is([style*="font-size:37px"], [style*="font-size: 37px"], [style*="font-size:39px"], [style*="font-size: 39px"], [style*="font-size:40px"], [style*="font-size: 40px"], [style*="font-size:41px"], [style*="font-size: 41px"], [style*="font-size:42px"], [style*="font-size: 42px"], [style*="font-size:43px"], [style*="font-size: 43px"], [style*="font-size:44px"], [style*="font-size: 44px"], [style*="font-size:45px"], [style*="font-size: 45px"], [style*="font-size:46px"], [style*="font-size: 46px"], [style*="font-size:47px"], [style*="font-size: 47px"], [style*="font-size:48px"], [style*="font-size: 48px"], [style*="font-size:49px"], [style*="font-size: 49px"], [style*="font-size:50px"], [style*="font-size: 50px"], [style*="font-size:51px"], [style*="font-size: 51px"], [style*="font-size:52px"], [style*="font-size: 52px"], [style*="font-size:53px"], [style*="font-size: 53px"], [style*="font-size:54px"], [style*="font-size: 54px"], [style*="font-size:55px"], [style*="font-size: 55px"], [style*="font-size:56px"], [style*="font-size: 56px"], [style*="font-size:57px"], [style*="font-size: 57px"], [style*="font-size:58px"], [style*="font-size: 58px"], [style*="font-size:59px"], [style*="font-size: 59px"], [style*="font-size:60px"], [style*="font-size: 60px"]) { font-size: 38px !important; }
.post.narrow .pbody :is([style*="font-size:8px"], [style*="font-size: 8px"], [style*="font-size:9px"], [style*="font-size: 9px"], [style*="font-size:10px"], [style*="font-size: 10px"], [style*="font-size:11px"], [style*="font-size: 11px"], [style*="font-size:12px"], [style*="font-size: 12px"]) { font-size: 13px !important; }
.post.narrow .pbody :is([style*="font-size:13px"], [style*="font-size: 13px"], [style*="font-size:14px"], [style*="font-size: 14px"]) { font-size: 15px !important; }
.post.narrow .pbody :is([style*="font-size:15px"], [style*="font-size: 15px"]) { font-size: 16px !important; }
.post.narrow .pbody :is([style*="font-size:16px"], [style*="font-size: 16px"], [style*="font-size:17px"], [style*="font-size: 17px"]) { font-size: 17px !important; }
.post.narrow .pbody :is([style*="font-size:18px"], [style*="font-size: 18px"], [style*="font-size:19px"], [style*="font-size: 19px"], [style*="font-size:20px"], [style*="font-size: 20px"], [style*="font-size:21px"], [style*="font-size: 21px"]) { font-size: 20px !important; }
.post.narrow .pbody :is([style*="font-size:22px"], [style*="font-size: 22px"], [style*="font-size:23px"], [style*="font-size: 23px"], [style*="font-size:24px"], [style*="font-size: 24px"], [style*="font-size:25px"], [style*="font-size: 25px"], [style*="font-size:26px"], [style*="font-size: 26px"]) { font-size: 22px !important; }
.post.narrow .pbody :is([style*="font-size:27px"], [style*="font-size: 27px"], [style*="font-size:28px"], [style*="font-size: 28px"], [style*="font-size:29px"], [style*="font-size: 29px"]) { font-size: 23px !important; }
.post.narrow .pbody :is([style*="font-size:30px"], [style*="font-size: 30px"], [style*="font-size:31px"], [style*="font-size: 31px"], [style*="font-size:32px"], [style*="font-size: 32px"]) { font-size: 26px !important; }
.post.narrow .pbody :is([style*="font-size:33px"], [style*="font-size: 33px"], [style*="font-size:34px"], [style*="font-size: 34px"], [style*="font-size:35px"], [style*="font-size: 35px"], [style*="font-size:36px"], [style*="font-size: 36px"]) { font-size: 27px !important; }
.post.narrow .pbody :is([style*="font-size:37px"], [style*="font-size: 37px"], [style*="font-size:38px"], [style*="font-size: 38px"], [style*="font-size:39px"], [style*="font-size: 39px"], [style*="font-size:40px"], [style*="font-size: 40px"], [style*="font-size:41px"], [style*="font-size: 41px"], [style*="font-size:42px"], [style*="font-size: 42px"], [style*="font-size:43px"], [style*="font-size: 43px"], [style*="font-size:44px"], [style*="font-size: 44px"], [style*="font-size:45px"], [style*="font-size: 45px"], [style*="font-size:46px"], [style*="font-size: 46px"], [style*="font-size:47px"], [style*="font-size: 47px"], [style*="font-size:48px"], [style*="font-size: 48px"], [style*="font-size:49px"], [style*="font-size: 49px"], [style*="font-size:50px"], [style*="font-size: 50px"], [style*="font-size:51px"], [style*="font-size: 51px"], [style*="font-size:52px"], [style*="font-size: 52px"], [style*="font-size:53px"], [style*="font-size: 53px"], [style*="font-size:54px"], [style*="font-size: 54px"], [style*="font-size:55px"], [style*="font-size: 55px"], [style*="font-size:56px"], [style*="font-size: 56px"], [style*="font-size:57px"], [style*="font-size: 57px"], [style*="font-size:58px"], [style*="font-size: 58px"], [style*="font-size:59px"], [style*="font-size: 59px"], [style*="font-size:60px"], [style*="font-size: 60px"]) { font-size: 28px !important; }
.pbody p { margin: 0; }
/* 사진 자리 — 사진 없이 붙여넣으면 자리 표시와 캡션이 그냥 문단 두 줄이 된다(실측). 사진은 사용자가 그 자리에 올린다 */
.pbody figure { margin: 0; }
/* 인용 — 붙여넣으면 기본 인용구(가운데·나눔명조 기울임·PC 19px/휴대폰 20px·위아래 회색 따옴표·위아래 PC 40px/휴대폰 30px). 나눔명조는 앱에 없어 명조 계열로 비슷하게 */
.pbody blockquote { margin: 40px 0; padding: 0; text-align: center; font: italic 19px/1.8 'Nanum Myeongjo', NanumMyeongjo, AppleMyungjo, serif; }
.narrow .pbody blockquote { margin: 30px 0; font-size: 20px; }
.pbody blockquote::before, .pbody blockquote::after { display: block; font: 700 30px/1 Georgia, serif; color: #C8C8C8; }
.pbody blockquote::before { content: '\201C'; margin-bottom: 12px; }
.pbody blockquote::after { content: '\201D'; margin-top: 4px; }
/* 본문 서식 — 네이버 뷰어(.se-module-text·.se-text-list 기본 모양)와 같게. <s>·line-through span 은 붙여넣기에서 서식이 빠진다(실측) */
.pbody u { text-decoration: underline; text-decoration-skip-ink: none; }
.pbody :is(del, strike) { text-decoration: line-through; }
.pbody s, .pbody [style*="line-through"] { text-decoration: none !important; }
.pbody a { color: #608CBA; text-decoration: underline; text-decoration-skip-ink: none; word-break: break-all; }
.pbody :is(ul, ol) { margin: 0 0 0 -14px; padding-left: 30px; }
.pbody li { padding-left: 0; }
.pbody ul li::marker { font-size: 17px; line-height: 0; }
.pbody ol li::marker { font-family: 'Songeul Nanum', arial, sans-serif; font-size: 15px; font-weight: 700; line-height: 0; color: #333333; }
/* 표 — 붙여넣으면 테두리 없음(셀에 border-style:none 이 박힌다)·칸 너비 같게·칸 높이 40px·머리칸은 굵게 가운데·위아래 PC 30px/휴대폰 20px(실측) */
.pbody table { margin: 30px 0; width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; text-align: left; }
.pbody td, .pbody th { height: 40px; box-sizing: border-box; padding: 10px; line-height: 1.6; vertical-align: middle; }
.pbody th { text-align: center; font-weight: 700; }
.narrow .pbody table { margin: 20px 0; }
.ptags { margin: 20px 0 0; font-size: 14px; color: #1A5BD6; }
.post.sample { width: auto; font-size: 15px; padding: 22px 18px; }
/* 판정기 표시 — 복사본에서는 cleanHTML 이 class 를 지운다.
   background·color 를 쓰지 않는다 — 문단을 합치면 크롬이 계산된 배경·글자색을 style="background-color:…" span 으로
   구워 본문에 박는다(표시가 내용이 된다). outline·box-shadow·text-decoration 은 굽지 않는다.
   근거 없는 문장은 물결 밑줄(글 속 노랑 형광과 겹치지 않게), 지금 보는 문장은 안쪽 그림자로 칠한다 */
/* △ 자리(긴 문단·긴 형광)는 '참고 △' 칸을 열었을 때만(.show-warn) — 닫힌 채로는 설명 없는 테두리가 본문을 덮는다 */
.show-warn .pbody .long { outline: 2px dashed #B06000; outline-offset: 2px; }
.show-warn .pbody .hl-long { outline: 2px dashed #B06000; }
.pbody .spot { outline: 2px solid #B3261E; outline-offset: 2px; }
.pbody .unsourced { text-decoration: underline wavy #A87300; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-skip-ink: none; }
.pbody .unsourced.now { box-shadow: inset 0 0 0 100vmax #FFF1A8; box-decoration-break: clone; -webkit-box-decoration-break: clone; border-radius: 2px; }

/* ─── 복사 완료 ─── */
.howto span { font-size: var(--fs-sub); color: var(--ink-2); }

/* ─── 설정 ─── */
.settings { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.tabs { flex: 0 1 200px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.tabs a { display: flex; flex-direction: column; padding: 8px 12px; color: var(--ink); text-decoration: none; border-radius: var(--r-btn); line-height: 1.4; }
.tabs a:hover { background: var(--surface-2); }
.tabs a b { font-size: var(--fs-sub); }
.tabs a span { font-size: var(--fs-min); color: var(--ink-3); }
.tabs a[aria-current="page"] { background: var(--primary-soft); }
.tabs a[aria-current="page"] b { color: var(--primary); }
/* 설정 첫 화면(폰)·더보기 — 항목 목록. 줄 하나 = 한 화면으로 가는 길 */
.settings-index { max-width: 640px; }
.settings-index .tabs { position: static; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.settings-index .tabs > :is(a, .tablink) { position: relative; display: flex; flex-direction: column; justify-content: center; width: 100%; min-height: 56px; padding: 8px 40px 8px 16px; font: inherit; color: var(--ink); text-align: left; text-decoration: none; background: none; border: 0; border-bottom: 1px solid var(--surface-2); border-radius: 0; cursor: pointer; }
.settings-index .tabs > :last-child { border-bottom: 0; }
.settings-index .tabs > :is(a, .tablink)::after { content: '›'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--ink-3); }
.settings-index .tabs > [aria-current] b { color: var(--primary); }
.settings-index .tabs b { font-size: var(--fs-body); }
.settings-index .tabs-group { margin: 0; padding: 14px 16px 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--surface-2); background: var(--surface-2); }
/* 고급 묶음 — 위 항목들과 선으로 떼어 맨 아래에 */
.tabs-group { margin: 12px 0 0; padding: 10px 12px 2px; border-top: 1px solid var(--line); font-size: var(--fs-min); font-weight: 600; color: var(--ink-3); }
.setmain { flex: 999 1 480px; min-width: 0; }
.setmain h1 { font-size: 22px; }
.lockbox { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; font-size: var(--fs-sub); color: var(--ink-2); }
.danger { padding-top: 16px; border-top: 1px solid var(--line); }
.paste { min-height: 140px; max-height: 420px; overflow: auto; padding: 12px; color: #222222; background: #FFFFFF; border: 1px solid var(--field-line); border-radius: var(--r-btn); contain: layout paint; font-size: 15px; }
.paste:empty::before { content: attr(data-hint); color: #777777; }
.avoid { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.avoidrow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
label.mini { display: flex; flex-direction: column; gap: 2px; flex: 0 1 150px; min-width: 120px; }
label.mini.grow { flex: 1 1 200px; }
label.mini.wide { flex: 2 1 260px; }
label.mini > span { font-size: var(--fs-min); color: var(--ink-3); }
.typerow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
/* 지우기 전 화면 안 확인 — 줄 맨 아래 한 줄로 */
.typerow > .ask { flex-basis: 100%; }
.qrow, .orow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.orow b { width: 22px; }
.orow.locked { color: var(--ink-2); background: var(--surface-2); border: 0; }
.firstbtn { flex: none; min-width: 48px; min-height: var(--h-ctl); font-size: var(--fs-sub); font-weight: 600; color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 8px; cursor: pointer; }
.firstbtn.on { font-weight: 700; color: var(--on-primary); background: var(--primary); border: 1px solid var(--primary); }

/* ─── 좁은 화면(브라우저를 아주 좁게 줄였을 때) — 가로 스크롤 없이 쌓는다 ─── */
@media (max-width: 720px) {
  .page, .page.mid, .page.wide { padding: 20px 16px 16px; }
  .review { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto auto; grid-template-areas: "stage" "insp" "copy"; }
  .copybar { border-left: 0; }
  .inspector { border-left: 0; border-top: 1px solid var(--line); max-height: 45vh; }
  .stage { padding: 12px 8px; }
  .post, .post.narrow { width: 100%; }
  .sticky, .tabs { position: static; }
  /* 미리보기가 이미 화면 폭이다 — 폭 전환은 뜻이 없다 */
  .widthpick { display: none; }
}
/* 단축키 안내(⌘↵)는 키보드가 있는 넓은 화면에서만 — 휴대폰 폭·터치 화면에서는 누를 키가 없다 */
@media (max-width: 720px), (pointer: coarse) {
  .key { display: none; }
}
/* 900px(최소 창) 근처 — 단계 표시는 지금 단계와 n/4 만 */
@media (max-width: 1000px) {
  .steps li:not(.now), .steps .sep { display: none; }
  .steps .count { display: inline; color: var(--ink-3); font-weight: 500; }
}
/* ─── 폰 검토 — 복사 지갑(.impeccable/surfaces/mobile-app.md 2절) ─── */
/* 종이가 화면을 다 쓰고, 바닥 독 = 상태 한 줄(시트 손잡이) + 쿠폰 세 장. 검사 패널은 아래 시트 */
@media (max-width: 719px) {
  .app:has(.review) { padding-bottom: 0; }
  .review { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "copy"; position: relative; }
  .stage { padding: 8px 0 24px; gap: 8px; background: var(--paper); }
  .stage-hint { padding: 0 16px; align-self: stretch; }
  /* 폰 폭 = 네이버 휴대폰 뷰어 폭 — 종이 테두리·둥근 모서리 없이 화면에 바로 */
  .post, .post.narrow { width: 100%; border-radius: 0; box-shadow: none; padding: 12px 16px 32px; }
  .copybar { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 8px 12px calc(10px + var(--sab)); border-left: 0; box-shadow: 0 -6px 20px rgba(0,0,0,.06); }
  .copybar > .sheet-btn, .copybar > .ask, .copybar .note, .copybar .tagrow { grid-column: 1 / -1; }
  .copybar > [data-primary] { grid-column: auto; min-height: 48px; }
  .copybar .btn.small { min-height: 48px; padding: 0 14px; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .copybar .tagrow { max-height: 30dvh; overflow: auto; }
  .copybar .tagrow .chip.btn { min-height: 44px; }
  /* 상태 한 줄 — 누르면 시트가 열린다. 색은 판정 상태와 같다 */
  .sheet-btn { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; font: inherit; font-size: var(--fs-sub); font-weight: 600; text-align: left; color: var(--ink); background: var(--surface-2); border: 0; border-radius: 10px; cursor: pointer; }
  .sheet-btn.bad { color: var(--block); background: var(--block-soft); }
  .sheet-btn.good { color: var(--primary); background: var(--primary-soft); }
  .sheet-more { display: inline-flex; align-items: center; gap: 4px; flex: none; font-weight: 700; }
  /* 시트 — 화면 아래에서 올라온다. 닫혀 있으면 화면 밖 + visibility 로 Tab·화면 읽기에서 빠진다 */
  .inspector { position: fixed; z-index: 41; left: var(--sal); right: var(--sar); bottom: 0; max-height: 88dvh; border: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -12px 40px rgba(0,0,0,.22); transform: translateY(100%); visibility: hidden; transition: transform 220ms cubic-bezier(.2,.8,.2,1), visibility 0s linear 220ms; }
  .review.sheet-open .inspector { transform: none; visibility: visible; transition: transform 220ms cubic-bezier(.2,.8,.2,1); }
  .insp-scroll { padding: 4px 16px calc(24px + var(--sab)); }
  .sheet-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 6px 4px 2px; position: relative; }
  .sheet-head h2 { grid-column: 2; text-align: center; font-size: 16px; }
  .sheet-x { grid-column: 3; }
  .sheet-grip { position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-strong); }
  .sheet-scrim { position: fixed; z-index: 40; inset: 0; background: rgba(0,0,0,.32); }
  .review.sheet-open .sheet-scrim { display: block; }
  .inspector .card { padding: 14px 16px; }
}
@media (max-width: 719px) and (prefers-reduced-motion: reduce) {
  .inspector, .review.sheet-open .inspector { transition: none; }
}

/* ─── 폰(< 720px) — 터치 밀도. ui.js phone 과 같은 분기점(.impeccable/surfaces/mobile-app.md 5절) ─── */
@media (max-width: 719px) {
  /* 탭 영역 44px · 주 버튼 48px · 입력 글자 16px(iOS 는 16px 미만 칸에 초점이 가면 화면을 확대한다) */
  :root { --h-ctl: 44px; --h-btn: 44px; --h-btn-main: 48px; --fs-body: 16px; --tb: 52px; }
  .toolbar { padding: 0 4px; }
  .tbtn { width: 44px; height: 44px; }
  .toolbar .tb-title { margin-left: 2px; font-size: 16px; color: var(--ink); }
  .btn.tiny, .segbtn, .link, .menu li > *, .menu summary, .logo { min-height: 44px; }
  /* 접는 칸 제목 — 글줄 높이(24px)라 손가락에 작다. 위아래로 늘린다 */
  details > summary { padding-block: 10px; }
  details.card[open] > summary { margin-bottom: 2px; }
  .btn.small, .btn.primary.small { font-size: 15px; }
  .chip .x { width: 44px; height: 44px; margin: -10px -6px -10px 0; }
  .check { min-height: 44px; }
  .input.small { min-height: 44px; }
  .input, .input.small, .input.mono, .paste, select.input { font-size: 16px; }
  h1 { font-size: 22px; }
  h1.hero { font-size: 26px; }
  .page, .page.mid, .page.wide, .page.narrow { padding: 16px 16px 32px; }
  .page.center { justify-content: flex-start; padding-top: 40px; }
  .stack.loose { gap: 28px; }
  /* 설정 — 목록(#/settings) → 상세. 상세에서는 왼쪽 항목 목록을 감춘다(위 바 ‹ 가 목록으로 돌아간다) */
  .settings { display: block; }
  .settings > .tabs { display: none; }
  .setmain h1 { font-size: 20px; }
  /* 글 목록 — 줄 전체가 링크(64px). 지우기는 글 화면 안에서 한다 */
  .recent li { position: relative; min-height: 64px; padding: 10px 16px; gap: 2px 8px; }
  .recent a { flex-basis: 100%; }
  .recent a::after { content: ''; position: absolute; inset: 0; }
  .recent li > .btn { display: none; }
  .resume { padding: 14px 16px; }
  .resume .row { width: 100%; }
  .resume .row > .btn.primary { flex: 1; }
  /* 줄 안 버튼 묶음은 줄바꿈 — 폰 폭을 넘지 않게 */
  .row.nowrap:not(.ask) { flex-wrap: wrap; }
  .btn { white-space: normal; text-align: center; line-height: 1.3; }
  .actionbar { padding: 10px 0 calc(10px + var(--sab)); }
  .actionbar > .btn.primary { flex: 1 1 100%; }
  .thumbs { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .app { transition: none; }
  .spinner { animation: none; }
}


/* ─── 폰: 설정·연결·올리기·단계 화면 ─── */
/* 폰 전용 손잡이(글 모양 미리보기 접기)는 넓은 화면에 없다 */
.pv-toggle { display: none; }
@media (max-width: 719px) {
  /* hover 로만 보이던 설명(title)을 글자로 — 있으면 좋은 것의 예시 */
  .chip.tag[title]:not([title=""])::after { content: attr(title); color: var(--ink-3); font-size: var(--fs-min); }
  .chip .x { flex: none; }
  .chip.tag[title]:not([title=""]) { flex-wrap: wrap; column-gap: 6px; border-radius: 12px; }
  .chip.tag[title]:not([title=""])::after { flex: 1 1 100%; order: 2; padding-bottom: 6px; }
  /* 색 고르기 — 띠 색 견본·직접 고르기 칸도 엄지 크기 */
  .swatch, .setmain input[type="color"] { width: 44px; height: 44px; }
  /* 한 글자 고르기(‘띠’)도 44px 폭 */
  .seg span { min-width: 44px; justify-content: center; }

  /* 글 종류 목록 — 이름·설명·버튼을 각 줄로. 버튼은 줄 폭을 나눠 쓴다(줄바꿈돼도 카드 밖으로 나가지 않게) */
  .typerow { padding: 12px; }
  .typerow > .check, .typerow > .muted, .typerow > .row { flex: 1 1 100%; }
  .typerow > .row > .btn.small { flex: 1 1 auto; }

  /* 피할 말 — [표현 | ×] [등급 | 대신 쓸 말] [이유] 세 줄 카드 */
  .avoidrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; align-items: end; gap: 10px 8px; padding: 12px; }
  .avoidrow > label.mini { min-width: 0; }
  .avoidrow > label.mini:first-of-type { grid-column: 1 / 3; }
  .avoidrow > label.mini.grow:not(:first-of-type) { grid-column: 1 / -1; }
  .avoidrow > label.mini:nth-of-type(3) { grid-column: 2 / -1; }
  .avoidrow > .btn.icon { grid-row: 1; grid-column: 3; }

  /* 글 모양 — 미리보기는 폼 맨 아래가 아니라 화면 바닥에 붙어, 조절값을 바꾸는 동안 결과가 보인다. 손잡이로 접는다 */
  .lookpv.sticky { position: sticky; top: auto; bottom: 0; z-index: 5; gap: 0; margin: 0 -16px -32px; padding: 0 16px 12px; background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgb(0 0 0 / .08); }
  .lookpv .pv-label { display: none; }
  .lookpv .pv-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 0; font: inherit; font-size: var(--fs-sub); font-weight: 700; color: var(--ink-2); background: none; border: 0; cursor: pointer; }
  .lookpv .pv-toggle svg { transition: transform 150ms; }
  .lookpv.shut .pv-toggle svg { transform: rotate(180deg); }
  .lookpv .post.sample { max-height: 26dvh; overflow: auto; }
  .lookpv.shut .post.sample { display: none; }

  /* 글 종류 고치기 — 질문 줄은 [먼저 | 질문 | ×] 한 줄, 순서 줄은 [번호 · 부분 · ↑ ↓ ×] 위에 [무엇을] 아래 */
  .qrow { flex-wrap: nowrap; align-items: flex-start; }
  .qrow > .input { flex: 1 1 0; }
  .orow:not(.locked) { display: grid; grid-template-columns: 22px minmax(0, 1fr) repeat(3, 44px); align-items: end; gap: 8px 6px; }
  .orow:not(.locked) > label.mini { min-width: 0; }
  .orow:not(.locked) > label.mini.wide { grid-row: 2; grid-column: 1 / -1; }
  .orow:not(.locked) > b { align-self: center; }

  /* 연결 — 카드 테두리·안쪽 여백을 걷어 글 폭을 돌려준다. 주소 칸은 전체 폭, 복사는 큰 버튼 */
  .cn-card { padding: 0; background: none; border: 0; }
  .cn-url .row { flex-wrap: wrap; }
  .cn-url .input { flex: 1 1 100%; min-width: 0; }
  .cn-url .btn { flex: 1 1 100%; min-height: var(--h-btn-main); }

  /* 사진 올리기 — 지우기 버튼도 엄지 크기 */
  .thumbs .btn.tiny { min-width: 64px; }
}
