/* 리뷰 할인 계산기 3.0 R2 (2026-11-15 FREETOOLS-1115 v3-R2) — 분홍 지면 위 짙은 결과판 한 장(반전 블록).
   결과판 = 탭 · 판정 · 시그니처 손익 막대(남는 돈 → 빠진 몫 색 전이) · 전표 · 손익분기 선 · 바닥 한 줄 꼬리. 입력은 판 아래 3열 띠(폰 = 덮개).
   정본 = han/디자인/DESIGN_ReviewDiscountCalc_v3.md 「R2 개정」. radius 14 하나 · 그림자 0 · 웨이트 200/600 · 행간 1.4 · 비율 1.5. */
@font-face {
  /* Orbit — SIL OFL 1.1 (fonts/OFL-Orbit.txt · 출처 fonts/출처.txt) · KS X 1001 2,350자 서브셋. 표제·판정 숫자 전용. */
  font-family: "RDC Orbit";
  src: url("fonts/Orbit-ksx1001.woff2") format("woff2");
  font-weight: 200 600; font-style: normal; font-display: swap; /* 한 면이 R2 웨이트 200~600 을 다 맡는다(가짜 굵기 합성 0) */
  /* 띄어쓰기(U+20)·쉼표(U+2C)는 뺀다 — Orbit 의 두 글리프가 고정폭이라 벌어져 읽힘. 두 글자만 시스템 서체로 떨어진다. */
  unicode-range: U+21-2B, U+2D-7E, U+B7, U+2014, U+2026, U+2212, U+AC00-D7A3;
}
:root {
  --ground: #ffcbc8;     /* 지면 — 분홍(R2 배정) */
  --accent: #8b3d99;     /* 강조 — 배정표 R3(분홍 지면과 다른 가족: 자주). 할인으로 빠진 몫·현재 점·초점(채움 전용) */
  --ink: #2b1211;        /* 지면 위 글자 — R8: 지면과 같은 hue 25(지면 가족) */
  --sub: #5b3232;        /* 지면 위 보조 글자(hue 25) */
  --field: #fff1f0;      /* 입력칸 바탕 */
  --field-line: #8c5756; /* 단추 테두리(hue 25) */
  --board: #2b1211;      /* 결과판(반전 블록) — 지면 가족 짙은 면 */
  --board-ink: #ffe9e7;  /* 판 위 글자 15.09 */
  --board-sub: #c8a2a0;  /* 판 위 보조 글자(hue 25) */
  --board-line: #774847; /* 판 안 구분선(장식 · hue 25) */
  --track: #482726;      /* 차트 손해 구역(hue 25) */
  --display: "RDC Orbit", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --t1: 16px; --t2: 24px; --t3: 36px; --t4: 54px; --tx: 14px;
  --lh: 1.4;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; line-height: var(--lh); }
body {
  background: var(--ground);
  color: var(--ink);
  font: 600 var(--t1)/var(--lh) "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  word-break: keep-all;           /* 한글 어절 중간 끊김 0 — 줄바꿈은 띄어쓰기에서만 */
  overflow-wrap: break-word;      /* 한 어절이 칸보다 길 때만 마지막 수단 */
  -webkit-text-size-adjust: 100%;
}
b, strong, h1, h2, h3, th, legend, summary { font-weight: 600; } /* 기본 굵기(700) 실물 0 — R2 웨이트 200/600 */
a { color: inherit; text-decoration: underline; text-underline-offset: 4px; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.board :focus-visible { outline-color: var(--board-ink); }
[hidden] { display: none !important; }

.page {
  max-width: 1440px; margin: 0 auto; padding: 24px 32px 16px;
  min-height: 100vh; display: flex; flex-direction: column; gap: 16px;
}

/* ── 머리: 표제 한 줄(탭은 결과판 안) ── */
.mast { display: flex; align-items: baseline; gap: 16px; }
.title { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 0; min-width: 0; }   /* R3: 머리 = 위 머리말(먹 600) + 아래 표제 — 「H1 + 같은 줄 회색 부제」는 RSB 만 */
h1 { margin: 0; font: 200 var(--t3)/1 var(--display); }   /* R3: 머리말을 위에 얹은 만큼 표제 줄 상자를 글자 크기로(한 화면 유지) */
.title .sub { margin: 0; color: var(--ink); font-weight: 600; }
.open-inputs { display: none; }

/* ── 결과판(반전 블록) ── */
.board {
  background: var(--board); color: var(--board-ink); border-radius: 14px;
  padding: 16px 24px; display: grid; gap: 16px; min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}
.tabs { display: flex; gap: 8px; }
.tabs button {
  font: inherit; min-height: 44px; padding: 0 4px; border: 0; border-bottom: 3px solid transparent;
  background: transparent; color: var(--board-sub); cursor: pointer;
}
.tabs { gap: 24px; }
.tabs button[aria-selected="true"] { color: var(--board-ink); border-bottom-color: var(--board-ink); }   /* R4: 탭 = 글자 + 밑줄(알약 0) */

.result { display: grid; gap: 16px 32px; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.lower { display: contents; }
.head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-items: start; }
.head .ex { justify-self: start; }
.ex { margin: 0 0 4px; color: var(--board-sub); }   /* R3: 알약·동작 문구 제거 — 평문 표지(감사 R2 합격 조건 2) */
.vh { margin: 0; display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; font-size: var(--t1); }
.vh span { color: var(--board-sub); }
.vh b { font: 600 var(--t4)/1.1 "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif; white-space: nowrap; }
body[data-verdict="loss"] .vh b, body[data-verdict="loss_each"] .vh b, body[data-verdict="base_loss"] .vh b { text-decoration: underline 3px var(--accent); text-underline-offset: 8px; }
.vline { margin: 4px 0 0; }
.sums { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 8px 0 0; }
.sums:empty { display: none; }
.sums div { display: flex; gap: 8px; align-items: baseline; }
.sums dt { color: var(--board-sub); }
.sums dd { margin: 0; white-space: nowrap; }

/* 시그니처 — 손익 막대(R4): 얇은 직사각 막대(입력칸과 다른 형태) + 값 글자를 막대 끝에 붙임. 할인으로 빠진 몫 = 강조 칸(범례 1곳) */
.bars { margin: 0; }
.bars figcaption { display: flex; flex-wrap: wrap; gap: 0 16px; color: var(--board-sub); margin-bottom: 8px; }
.key-cut { display: inline-flex; align-items: center; gap: 8px; color: var(--board-ink); }
.key-cut i, .lines li.hot span::before { display: inline-block; width: 12px; height: 12px; background: var(--accent); outline: 1px solid var(--board-ink); }
.bar-list { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 8em minmax(0, 1fr); align-items: center; gap: 16px; }
.bl { color: var(--board-sub); white-space: nowrap; }
.bar-row.on .bl { color: var(--board-ink); }
.track { display: flex; align-items: center; min-height: 32px; }
.track .fill { display: block; flex: none; height: 12px; background: var(--board-ink); }
.track .cut { display: block; flex: none; height: 12px; background: var(--accent); outline: 1px solid var(--board-ink); outline-offset: -1px; }   /* 짙은 판 위 자주(2.7:1)는 밝은 테로 경계를 세운다 */
.bv { margin-left: 8px; white-space: nowrap; }

/* 전표 */
.slip { min-width: 0; }
.slip h3 { margin: 0 0 4px; font-size: var(--t1); padding-bottom: 4px; border-bottom: 1px solid var(--board-line); }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; justify-content: space-between; gap: 8px; line-height: var(--lh); }
.lines li span { color: var(--board-sub); }
.lines li b { white-space: nowrap; }
.lines li.void { color: var(--board-sub); }
.lines li.hot span { color: var(--board-ink); }
.lines li.hot span { display: inline-flex; align-items: center; gap: 8px; }
.lines li.hot span::before { content: ''; }   /* R4: 빠진 몫 줄 = 막대 범례와 같은 강조 칸(알약 0) */
.total { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--board-ink); }
.total b { font: 600 var(--t3)/1.1 "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif; white-space: nowrap; }
.slip.neg .total b { text-decoration: underline 3px var(--accent); text-underline-offset: 6px; }
.slip.neg .total b::before { content: "손해 "; font-size: var(--t1); }
.then { margin: 4px 0 0; color: var(--board-sub); }
.then:empty { display: none; }

/* 손익분기 선 */
.chart { margin: 0; min-width: 0; display: flex; flex-direction: column; }
.chart svg { display: block; width: 100%; flex: 1 1 auto; height: 200px; min-height: 120px; }
.chart figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* R4: 축 설명 문장 대신 축에 직접 이름(읽기 도구용으로만 남김) */
.c-axis, .c-zone { fill: var(--board-sub); font-size: 16px; font-weight: 600; }
.c-loss { fill: var(--track); }
.c-grid { stroke: var(--board-line); stroke-width: 1; }
.c-zero { stroke: var(--board-sub); stroke-width: 1.5; }
.c-line { stroke: var(--board-ink); stroke-width: 3; }
.c-line.c-now { stroke-width: 2; stroke-dasharray: 6 5; }
.c-cross { stroke: var(--board-ink); stroke-width: 2; }
.c-guide { stroke: var(--board-ink); stroke-width: 1; stroke-dasharray: 3 4; }
.c-mark { fill: var(--accent); stroke: var(--board-ink); stroke-width: 2; }
.c-tick, .c-tag, .c-crosslabel { fill: var(--board-ink); font-size: 16px; font-weight: 600; }
.c-tick { fill: var(--board-sub); }

.rule { display: none; }
.copybox { display: flex; margin-left: auto; }
.copytext { display: none; }
.grab, .open-inputs, .close, .chip {
  font: inherit; min-height: 44px; padding: 0 16px; border: 1px solid var(--ink); border-radius: 14px;
  background: var(--ink); color: var(--field); cursor: pointer;
}
.board .grab { background: var(--board-ink); color: var(--board); border-color: var(--board-ink); }
.chip { background: transparent; color: var(--ink); border-color: var(--ink); padding: 0 8px; white-space: nowrap; }
.grab:disabled { opacity: 0.5; cursor: default; }

/* ── 꼬리 = 결과판 바닥 한 줄: 법률 문장 1개(14px) · 자사 한 줄 · 출처 접힘 ── */
.foot { display: flex; flex-wrap: wrap; gap: 0 24px; align-items: center; border-top: 1px solid var(--board-line); padding-top: 8px; position: relative; }
.foot p { margin: 0; }
.foot .law { font-size: var(--tx); color: var(--board-sub); }
.foot .promo a, .foot .promo span { color: var(--board-ink); }
.colophon summary { cursor: pointer; min-height: 44px; line-height: 44px; color: var(--board-sub); }   /* list-item 유지(▶ 표지) + 높이 44 */
.colophon[open] { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 0 16px 8px; background: var(--board); border: 1px solid var(--board-line); border-radius: 14px; }
.colophon p { margin: 4px 0; max-width: 72ch; color: var(--board-sub); }

/* ── 입력 띠(지면 위 — 판 없음) ──
   R8(블라인드 R5 「입력 세 열이 한 격자를 안 따름」 3/3): 모든 입력 = 「이름 한 줄 + 44px 칸」 한 꼴의 칸(.cell).
   묶음마다 2칸 격자 · 칸마다 밑줄은 칸 폭 전체(같은 열 x 시작/끝 같음) · 알약을 칸 줄에 섞지 않음 · 빈 칸 0(넓은 칸은 두 칸을 다 채운다). */
.inputs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px 32px; min-width: 0; align-content: start; }
.sheet-head, .sheet-copy { display: none; }
.grp { margin: 0; padding: 0; border: 0; min-width: 0; }
.grp legend { padding: 0; margin-bottom: 8px; font-size: var(--t1); line-height: var(--lh); white-space: nowrap; }
.cells { --cg: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px var(--cg); }
.cell { display: grid; grid-template-rows: auto 46px; row-gap: 4px; min-width: 0; margin: 0; }
.cell > label, .cell > .lab { color: var(--sub); white-space: nowrap; line-height: var(--lh); }
.cell--w2 { grid-column: 1 / -1; }
.cell--q { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.cell--q > label { grid-column: 1 / -1; }
.cell--q input[type=range] { width: 100%; min-width: 0; height: 44px; margin: 0; accent-color: var(--ink); }
.cell--note { display: block; color: var(--sub); align-self: start; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.unit { display: flex; align-items: center; min-width: 0; border-bottom: 2px solid var(--ink); }   /* 칸 = 먹 밑줄 한 줄, 숫자와 단위는 붙여 쓴다(「35%」) */
.unit input {
  flex: 1 1 auto; width: 100%; min-width: 0; font: inherit; text-align: right; padding: 0; min-height: 44px;
  border: 0; background: transparent; color: var(--ink);
}
.unit .u { flex: none; font-style: normal; color: var(--sub); padding: 0 4px 0 1px; pointer-events: none; }
.unit:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.unit input:focus-visible { outline: none; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cell .chip { width: 100%; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.seg--cell { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--field-line); border-radius: 14px; }
.seg--cell span { display: flex; padding: 0 8px; }
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--field); }   /* R8: 고른 칸 = 강조 채움(지면과 다른 가족 · 글자 대비 5.9) */
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.tog { display: flex; gap: 8px; align-items: center; min-height: 44px; cursor: pointer; }
.tog input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; margin: 0; }
/* 정액이면 방식 칸이 두 칸 폭(단추 둘 = 열 둘에 맞춤) · 정률이면 칸 하나(최대 할인 칸이 늘어남) — 어느 쪽이든 빈 칸 0 */
.cells:has(input[name=rdMode][value=fixed]:checked) .cell--seg { grid-column: 1 / -1; }
.cells:has(input[name=rdMode][value=fixed]:checked) .cell--seg .seg--cell { column-gap: var(--cg); }
.assume { position: relative; min-width: 0; }
.assume summary { cursor: pointer; min-height: 44px; line-height: 44px; color: var(--ink); border-bottom: 2px solid var(--ink); white-space: nowrap; }   /* list-item 유지(▶ 표지) */
.assume .note { margin: 0 0 8px; color: var(--sub); }
.assume__pop .row { display: grid; grid-template-rows: auto 46px; row-gap: 4px; margin-bottom: 8px; }
.assume__pop .row label { color: var(--sub); }
.assume__pop .seg { margin: 8px 0 0; }
.assume[open] .assume__pop { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 3; width: 22em; max-width: 90vw; padding: 16px; background: var(--ground); border: 2px solid var(--ink); border-radius: 14px; }
.nb { white-space: nowrap; }

/* ── 넓은 화면(≥1100): 결과판(위) 3열 = 판정·막대 | 전표 | 손익분기 선 · 입력 띠(아래) 3묶음 × 2칸 ── */
@media (min-width: 1100px) {
  .board { grid-template-columns: minmax(0, 1.25fr) minmax(0, 320px) minmax(0, 1fr); column-gap: 32px; }
  .tabs { grid-column: 1; grid-row: 1; align-self: start; position: relative; z-index: 1; }
  /* 결과(tabpanel)는 판 격자를 그대로 물려받는다(subgrid) — 탭 칸 오른쪽부터 전표·선이 판 위 끝까지 */
  .result { grid-column: 1 / -1; grid-row: 1 / 4; display: grid; grid-template-columns: subgrid; grid-template-rows: subgrid; gap: 16px 32px; }
  .head { grid-column: 1; grid-row: 2; }
  .foot { grid-column: 1 / -1; grid-row: 4; }
  .bars { grid-column: 1; grid-row: 3; align-self: end; }
  .slip { grid-column: 2; grid-row: 1 / 4; display: flex; flex-direction: column; }
  .chart { grid-column: 3; grid-row: 1 / 4; }
  .chart { min-height: 0; }
  .chart svg { height: 0; flex: 1 1 0; min-height: 0; } /* 선 그림은 판 높이를 정하지 않는다 — 왼쪽 열(판정·막대)이 정한 높이를 채운다 */
  .inputs { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; align-items: start; }   /* R8: 세 묶음 × 2칸 — 묶음 안 줄 높이가 모두 같아 묶음끼리 줄 y 가 같다 */
  /* R5: 전표 줄을 판 높이에 고르게 펼친다 — 전표 열 바닥 = 막대·선 열 바닥(열 안 빈 띠 0) */
  .slip .lines { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; padding: 4px 0; }
}
/* 1100~1279 폭: 칸이 좁아 열 간격을 한 단계 줄인다(이름 한 줄 유지) */
@media (min-width: 1100px) and (max-width: 1279px) {
  .inputs { column-gap: 24px; }
  .cells { --cg: 12px; }
  .board { column-gap: 24px; }
}
/* 낮은 넓은 화면 — 높이 단계 셋(R8: 한 단계로 모두 줄이면 800 높이에서 바닥 빈 띠 140) */
@media (min-width: 1100px) and (max-height: 859px) {
  .page { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .board { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
}
@media (min-width: 1100px) and (max-height: 790px) {
  .vh b { font-size: var(--t3); }
}
@media (min-width: 1100px) and (max-height: 760px) {
  h1 { font-size: var(--t2); }
  .cells { row-gap: 4px; }
  .cell { row-gap: 0; }
  .grp legend { margin-bottom: 4px; }
  .track { min-height: 24px; }
  .bars figcaption { margin-bottom: 4px; }
}
/* R8: 키 큰 넓은 화면(≥860) — 남는 높이를 칸 줄 간격·판 여백에 나눠 화면 바닥 빈 띠를 줄인다(묶음 셋 모두 같은 값이라 줄 y 그대로) */
@media (min-width: 1100px) and (min-height: 860px) {
  .page { gap: 24px; }
  .board { padding-top: 24px; padding-bottom: 24px; }
  .cells { row-gap: 16px; }
  .grp legend { margin-bottom: 12px; }
}
/* R8: 아주 큰 화면(1920×1080 등) — 1440×900 판을 통째로 1.2배(빈 띠 대신 같은 짜임을 키움) */
@media (min-width: 1700px) and (min-height: 1000px) {
  .page { zoom: 1.2; min-height: calc(100vh / 1.2); }
}


/* ── 좁은 화면(폰): 첫 화면 = 결과판 한 장(탭 · 판정 · 막대 · 전표 · 선 · 꼬리), 입력판은 덮개 ── */
@media (max-width: 1099px) {
  .page { padding: 8px 16px; gap: 8px; height: 100vh; height: 100dvh; min-height: 0; }
  .mast { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
  .title { flex-direction: column; gap: 0; }
  h1 { font-size: var(--t2); }
  .title .sub { display: none; }
  .board { flex: 1; min-height: 0; padding: 8px 16px; gap: 8px; grid-template-rows: auto minmax(0, 1fr) auto; }
  .tabs button { flex: 1; padding: 0 8px; }
  .result { gap: 16px; min-height: 0; }
  .head { grid-template-columns: minmax(0, 1fr); }
  .copybox, .chart { display: none; }
  .result { align-content: space-between; grid-template-rows: none; }
  .board { padding: 16px; }
  .vh b { font-size: var(--t3); }
  .bar-row { grid-template-columns: 7.5em minmax(0, 1fr); gap: 8px; }
  .track { min-height: 28px; }   /* R4: 폰 막대도 얇게(12px) · 이름과 한 줄 — 숫자보다 크지 않게 */
  .lines li { padding: 2px 0; }
  .rule { display: block; position: relative; height: 60px; margin-top: 4px; }
  .rule__bar { position: absolute; left: 0; right: 0; top: 28px; display: flex; height: 8px; }
  .rule__bar i { display: block; height: 100%; }
  .rule__loss { background: var(--track); }
  .rule__gain { background: var(--board-ink); }
  .rule__cross, .rule__now { position: absolute; transform: translateX(-50%); white-space: nowrap; line-height: 1.4; }
  .rule__cross { top: 0; color: var(--board-ink); }
  .rule__cross::after { content: ''; position: absolute; left: 50%; top: 100%; height: 14px; border-left: 2px solid var(--board-ink); }
  .rule__now { top: 40px; color: var(--board-ink); padding-top: 2px; border-top: 3px solid var(--accent); }
  .rule__end { position: absolute; top: 0; color: var(--board-sub); }
  .rule__end--0 { left: 0; }
  .rule__end--x { right: 0; }
  .total b { font-size: var(--t2); }
  .then { font-size: var(--tx); }
  .foot { gap: 0 16px; }
  .foot .law { flex-basis: 100%; }
  html.js .open-inputs { display: inline-flex; align-items: center; grid-column: 2; grid-row: 1; }
  html.js .inputs { display: none; }
  .inputs { grid-template-columns: minmax(0, 1fr); }
  html.js body.sheet-open .inputs {
    display: grid; position: fixed; inset: 0; z-index: 10; overflow-y: auto; overscroll-behavior: contain;
    background: var(--ground); padding: 16px 16px 24px; align-content: start;
  }
  html.js body.sheet-open .sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
  html.js body.sheet-open .sheet-copy { display: block; margin-top: 8px; }
  html.js body.sheet-open .close { display: inline-flex; align-items: center; margin-left: auto; }
}

/* R8: 중간 폭(700~1099, 1024×768 등) — 폰 한 줄 쌓기 대신 판 두 열: 왼쪽 판정·손익 선 / 오른쪽 전표·막대 */
@media (min-width: 700px) and (max-width: 1099px) {
  .result { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 32px; row-gap: 16px; align-content: stretch; }
  .head { grid-column: 1; grid-row: 1; }
  .chart { display: flex; grid-column: 1; grid-row: 2 / 4; min-height: 0; }
  .chart svg { height: 0; flex: 1 1 0; min-height: 0; }
  .bars { grid-column: 2; grid-row: 3; }
  .slip { grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column; }
  .slip .lines { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; padding: 4px 0; }
  .rule { display: none !important; }
}
/* R8: 키 작은 폰(360×740 등) — 한 달 차이 나눠 보기(합계 두 줄)를 접고 전표 줄 여백 0: 판 바닥 글자 겹침 0 */
@media (max-width: 699px) and (max-height: 780px) {
  .sums { display: none; }
  .lines li { padding: 0; }
  .result { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .open-inputs, .grab, .tabs, .chips { display: none; } }

/* 없는 주소(404.html) — 같은 판 한 장 */
.nf { justify-content: center; align-items: center; }
.nf .board { padding: 32px 48px; text-align: center; }
.nf .board a { display: inline-flex; align-items: center; min-height: 44px; }
