/* devjar 도구 — 공용 스타일
   세계: 문구점 책상(공책 종이·모나미 파랑·형광펜). 시그니처는 결과에 긋는 형광펜 한 줄.
   글꼴: 제목·큰 숫자만 SUIT 서브셋(이름 바꿈, OFL — tools/build-font.py), 본문·입력은 시스템 글꼴. */

@font-face {
  font-family: "Devjar Display";
  src: url("fonts/display-800.woff2") format("woff2");
  font-weight: 800;
  font-display: optional; /* 늦게 오면 이번 방문은 시스템 글꼴 그대로 — 글꼴 교체로 줄이 밀리지 않게(CLS 0), preload 로 대개 제때 온다 */
}

:root {
  --paper: #f4f6f1;
  --surface: #ffffff;
  --surface-2: #eaede4;
  --ink: #1b2233;
  --ink-2: #4a5365;
  --line: #cfd4c7;
  --line-strong: #9aa294;
  --blue: #2346b8;
  --blue-press: #1a3590;
  --blue-soft: #e2e8f8;
  --on-blue: #ffffff;
  --mark: #f2df45;
  --mark-ink: #1b2233;
  --error: #b3261e;
  --ok: #1d6b45;
  --hl-h: 0.5em; /* 밝은 화면: 글자 아래 절반만 긋는다 */

  --font-body: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif;
  --font-display: "Devjar Display", var(--font-body);
  --ad-bg: rgba(27, 34, 51, 0.045);

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: 2rem;
  --step-4: 2.75rem;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --shadow: 0 1px 2px rgba(27, 34, 51, 0.06), 0 6px 18px -8px rgba(27, 34, 51, 0.18);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #162036;
    --surface: #1d2942;
    --surface-2: #24314d;
    --ink: #e8ebe3;
    --ink-2: #b2bacb;
    --line: #34425f;
    --line-strong: #5a6a8c;
    --blue: #93acf2;
    --blue-press: #b3c5f7;
    --blue-soft: #27365a;
    --on-blue: #121a2c;
    --mark: #e4d34c;
    --mark-ink: #162036;
    --error: #ff9e94;
    --ok: #86d6a9;
    --hl-h: 100%; /* 어두운 화면: 글자 전체를 칠하고 글자는 짙은 색 */
    --ad-bg: rgba(232, 235, 227, 0.05);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 22px -10px rgba(0, 0, 0, 0.55);
  }
}

/* 언어별 글꼴: 제목 글꼴(SUIT 서브셋)은 한글·라틴만 있어서 키릴·한자 쪽은 시스템 글꼴로 */
:lang(zh-CN) { --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
:lang(zh-TW) { --font-body: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; }
:lang(en), :lang(es), :lang(pt-BR), :lang(ru), :lang(uk) { --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
:lang(ru), :lang(uk), :lang(zh-CN), :lang(zh-TW) { --font-display: var(--font-body); }
:lang(zh-CN) body, :lang(zh-TW) body { word-break: normal; line-break: strict; }

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line-strong) var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  caret-color: var(--blue);
}

::selection { background: var(--mark); color: var(--mark-ink); }

a { color: var(--blue); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

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

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- 상단 ---------- */
.top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 20px; min-height: 60px;
}
.brand {
  font-family: var(--font-display); font-weight: 800; font-size: var(--step-1);
  color: var(--ink); text-decoration: none; white-space: nowrap; letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
}
.brand svg { width: 22px; height: 22px; flex: none; }
.tool-nav { min-width: 0; flex: 1; order: 1; display: flex; align-items: center; gap: 2px; }
.lang-menu { order: 2; position: relative; flex: none; }
/* 메뉴가 넘치면 common.js 가 뒤쪽 항목을 «더 보기» 아래로 접는다(스크립트가 없으면 옆으로 밀어 보기) */
.tool-nav .nav-main {
  list-style: none; margin: 0; padding: 0; flex: 0 1 auto; min-width: 0;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
.tool-nav .nav-main::-webkit-scrollbar { display: none; }
.nav-more { position: relative; flex: none; }
.nav-more > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px 0 12px;
  border-radius: var(--r-sm); cursor: pointer; color: var(--ink-2); font-size: var(--step--1); white-space: nowrap;
}
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary:hover, .nav-more[open] > summary { background: var(--surface-2); color: var(--ink); }
.nav-more .ic-chev { width: 16px; height: 16px; transition: transform 0.15s; }
.nav-more[open] .ic-chev { transform: rotate(180deg); }
.nav-more-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); min-width: 200px;
}
.nav-more-list a { color: var(--ink); }
.tool-nav a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--ink-2); text-decoration: none; white-space: nowrap; border-radius: var(--r-sm);
  font-size: var(--step--1);
}
.tool-nav a:hover { color: var(--ink); background: var(--surface-2); }
.tool-nav a { position: relative; }
.tool-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav-main a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 4px;
  border-radius: 2px; background: var(--mark);
}

@media (max-width: 720px) {
  .top-inner { flex-wrap: wrap; gap: 0; padding: 4px 8px 0; }
  .brand { padding-left: 8px; flex: 1; }
  .lang-menu { order: 0; }
  .tool-nav { flex-basis: 100%; order: 1; }
}

/* 아이콘 */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
label .ic { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; color: var(--ink-2); }

/* 언어 선택: 지구 + 지금 언어 */
.lang-menu > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px;
  border-radius: var(--r-sm); cursor: pointer; color: var(--ink-2); font-size: var(--step--1); font-weight: 600; white-space: nowrap;
}
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary:hover, .lang-menu[open] > summary { background: var(--surface-2); color: var(--ink); }
.lang-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); min-width: 190px;
}
.lang-list a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm);
  color: var(--ink); text-decoration: none; font-size: var(--step--1);
}
.lang-list a:hover { background: var(--surface-2); }
.lang-list a[aria-current="true"] { font-weight: 700; background: var(--blue-soft); }

/* ---------- 본문 틀 ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; min-width: 0; }

/* ---------- 광고 자리: 크기를 먼저 잡아 두어 밀림(CLS) 없음. 설정이 없으면 자리를 안 그리고, 채워지지 않으면 접는다(.ad-off) ----------
   도구 위·옆·바로 아래에는 두지 않는다. 사용법 뒤(guide)는 위로 150px 를 비워 도구 조작부·접는 제목과 떨어뜨린다. 모바일 고정 앵커 없음. */
.ad { background: var(--ad-bg); border-radius: var(--r-md); overflow: hidden; }
.ad.ad-off { display: none; }
.ad ins { display: block; width: 100%; height: 100%; }
/* 위아래 160px(기준 150 + 여유): 앞뒤의 접는 제목·FAQ·관련 도구 링크·바닥 링크와 떨어뜨린다(형제 사이 여백은 겹쳐 150 하나가 된다) */
.ad-guide, .ad-faq { height: 250px; min-height: 250px; margin: 160px 0; }
.ad-bottom { max-width: 970px; height: 250px; min-height: 250px; margin: 160px 0 110px; } /* 아래 110 + main 아래 여백 64 = 바닥 링크까지 150 이상 */
.rail { display: none; }
/* 오른쪽 세로 광고가 설정된 쪽(body.has-rail)만 2열. 없으면 본문 1열(최대 1120px 가운데) */
@media (min-width: 1200px) {
  .has-rail .layout {
    display: grid; grid-template-columns: minmax(0, 1fr) 160px; column-gap: 160px;
    max-width: calc(1120px + 160px + 160px); margin: 0 auto; padding: 0 16px; align-items: start;
  }
  .has-rail .layout > main { max-width: none; width: 100%; padding-left: 0; padding-right: 0; }
  .has-rail .rail { display: block; height: 100%; padding-top: 160px; } /* 머리 메뉴·언어 단추와 150px 이상 */
  .ad-rail { position: sticky; top: 160px; width: 160px; height: 600px; min-height: 600px; }
  .has-rail .top-inner, .has-rail .foot-inner { max-width: calc(1120px + 160px + 160px); }
}
@media (min-width: 1440px) {
  .has-rail .top-inner, .has-rail .foot-inner { max-width: calc(1120px + 160px + 300px); }
  .has-rail .layout { grid-template-columns: minmax(0, 1fr) 300px; max-width: calc(1120px + 160px + 300px); }
  .ad-rail { width: 300px; }
}

.tool-head { margin: 8px 0 20px; max-width: 46rem; }
h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.875rem, 1.4rem + 2vw, var(--step-4));
  line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 8px; text-wrap: balance;
}
.lead { margin: 0; color: var(--ink-2); font-size: var(--step-0); max-width: 40rem; }

/* 도구 작업대: 무대(결과) + 입력판 */
.bench {
  display: grid; gap: 16px;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: start;
}
.bench.single { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 860px) { .bench { grid-template-columns: minmax(0, 1fr); } }

.stage, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  min-width: 0;
}
.stage { box-shadow: var(--shadow); }
.panel { background: var(--surface); }
@media (max-width: 480px) { .stage, .panel { padding: 16px; border-radius: var(--r-md); } }

.panel h2, .stage h2 {
  font-size: var(--step-0); font-weight: 700; margin: 0 0 10px; letter-spacing: -0.01em;
}

label, .label { display: block; font-weight: 600; font-size: var(--step--1); margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.hint { color: var(--ink-2); font-size: var(--step--1); margin: 6px 0 0; }
.restoring #main { visibility: hidden; animation: restore-show 0s 1.2s forwards; }
@keyframes restore-show { to { visibility: visible; } }
p.hint#count, p.hint#count-hint { min-height: 1.6em; } /* 처음 채워질 때 아래 단추가 밀리지 않게 */
.error-text { color: var(--error); font-size: var(--step--1); margin: 6px 0 12px; }
.error-text:empty { margin: 0; }

input[type="text"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; line-height: 1.55; }
textarea:disabled, input:disabled, select:disabled { opacity: 0.55; cursor: not-allowed; } /* 돌림판이 도는 동안 편집 잠금 */
input::placeholder, textarea::placeholder { color: var(--ink-2); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--blue); outline-offset: 0; border-color: var(--blue);
}
input[type="date"] { min-width: 0; }

.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; margin: 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); margin: 0; }

.seg { display: flex; gap: 4px; padding: 4px; margin: 0 0 16px; border: 0; background: var(--surface-2); border-radius: 10px; }
.seg legend { padding: 0; }
.seg label {
  flex: 1; margin: 0; min-height: 44px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-weight: 600; color: var(--ink-2); position: relative; border-radius: 7px;
}
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--ink); color: var(--paper); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: -3px; }

/* 버튼 */
.btn {
  font: inherit; font-weight: 700; font-size: var(--step--1);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; transition: background-color .15s ease, transform .1s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.btn-primary:hover { background: var(--blue-press); border-color: var(--blue-press); }
.btn-big { font-size: var(--step-1); min-height: 56px; padding: 0 28px; border-radius: var(--r-md); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row .btn { flex: 1 1 auto; }

/* 형광펜: 결과 강조 */
.hl {
  background-image: linear-gradient(var(--mark), var(--mark));
  background-repeat: no-repeat;
  background-position: 0 88%;
  background-size: 100% var(--hl-h);
  background-color: transparent;
  color: var(--mark-ink);
  padding: 0 0.12em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hl.swipe { animation: swipe .55s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes swipe { from { background-size: 0% var(--hl-h); } to { background-size: 100% var(--hl-h); } }

.result {
  margin: 16px 0 0; min-height: 2.4em; text-align: center;
  font-size: var(--step-2); font-weight: 800; letter-spacing: -0.02em; line-height: 1.3;
}
.result .sub { display: block; font-size: var(--step--1); font-weight: 500; color: var(--ink-2); letter-spacing: 0; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: var(--r-md);
  font-weight: 600; font-size: var(--step--1); opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .3s cubic-bezier(.16, 1, .3, 1); max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 숫자 표(글자수·나이) */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); margin: 0; }
.figures > div { background: var(--surface); padding: 12px 14px; }
.figures dt { font-size: var(--step--1); color: var(--ink-2); }
.figures dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.figures dd small { font-family: var(--font-body); font-size: var(--step--1); font-weight: 500; color: var(--ink-2); margin-left: 2px; }

.big-figure { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.75rem, 2rem + 4vw, 4.5rem); line-height: 1.05; letter-spacing: -0.035em; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }

/* ---------- 설명글 ---------- */
.guide { max-width: 44rem; margin: 56px 0 0; }
.guide h2 { font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); letter-spacing: -0.02em; margin: 40px 0 10px; line-height: 1.3; }
.guide h2:first-child { margin-top: 0; }
.guide h3 { font-size: var(--step-0); margin: 22px 0 4px; }
.guide p, .guide li { color: var(--ink); max-width: 68ch; }
.guide p { margin: 0 0 12px; }
.guide ol, .guide ul { padding-left: 1.3em; margin: 0 0 12px; }
.guide li + li { margin-top: 4px; }
.faq dt { font-weight: 700; margin-top: 18px; }
.faq dd { margin: 4px 0 0; }

/* 사용법·FAQ: 접어 두고(본문 가치는 그대로) 누르면 편다 */
.guide summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-left: auto; margin-right: 4px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg) translateY(-3px);
  transition: transform .2s ease;
}
.guide details[open] > summary::after { transform: rotate(225deg) translate(-2px, -1px); }
.howto { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 0; }
.howto > summary h2 { margin: 0; }
.howto[open] { padding-bottom: 12px; }
.howto ol { margin-top: 8px; }
.guide .faq-h { margin-top: 40px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item > summary { font-weight: 700; padding: 8px 0; line-height: 1.45; }
.faq-item > p { margin: 0 0 14px; color: var(--ink); }

.related { max-width: 44rem; margin: 48px 0 0; border-top: 1px solid var(--line); padding-top: 20px; }
.related h2 { font-size: var(--step-0); margin: 0 0 8px; }
.related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.related a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: var(--step--1); }
.related a:hover { background: var(--surface); }

/* ---------- 바닥 ---------- */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-inner { max-width: 1120px; margin: 0 auto; padding: 20px 16px 28px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; color: var(--ink-2); font-size: var(--step--1); }
.foot a { color: var(--ink-2); display: inline-flex; min-height: 44px; min-width: 44px; justify-content: center; align-items: center; }
.foot p { margin: 0; flex-basis: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- 줄 입력(돌림판·제비뽑기·팀 나누기·사다리): 한 줄 = 한 칸, 줄마다 −, 아래 + ---------- */
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.field-head label, .field-head .label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.field-head .ic { width: 16px; height: 16px; margin: 0; vertical-align: 0; }
.count-pill {
  min-width: 2.2em; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink);
  font-size: var(--step--1); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; line-height: 1.5;
}
.count-pill:empty { visibility: hidden; }
/* 8줄 넘으면 목록 안에서 스크롤(초점 테가 잘리지 않게 안쪽 여백 3px) */
.le-rows { list-style: none; margin: -3px; padding: 3px; display: grid; gap: 6px; max-height: calc(8 * 50px + 6px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.le-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 6px; align-items: center; }
.has-dot .le-row { grid-template-columns: 14px minmax(0, 1fr) 44px; gap: 8px; }
.le-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); }
.le-dot.on { border-width: 1.5px; } /* 바탕색과 비슷한 칸 색(짙은 남색·연회색)도 테로 보이게 */
.le-row.over .le-input { color: var(--ink-2); text-decoration: line-through; } /* 최대 개수 밖 줄(판에 안 들어감) */
.le-rm { color: var(--ink-2); }
.le-rm:disabled, .list-ed.locked .le-rm { opacity: 0.45; cursor: not-allowed; }
.le-rm .ic, .le-add .ic { stroke-width: 2.4; }
.le-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.le-add { flex: 1 1 auto; border-style: dashed; color: var(--ink); }
.le-bulk { flex: 0 1 auto; border-color: transparent; background: transparent; color: var(--ink-2); font-weight: 600; }
.le-bulk:hover { color: var(--ink); }
.le-bulk[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.list-ed > textarea { display: none; margin-top: 0; }
.list-ed.bulk > textarea { display: block; }
.list-ed.bulk > .le-rows { display: none; }
.list-ed + p.hint#count:empty { display: none; } /* 돌림판: 고칠 것이 있을 때만 안내 줄(개수는 이름표 옆 숫자) */

/* ---------- 돌림판 ---------- */
.wheel-stage { position: relative; display: flex; flex-direction: column; align-items: center; }
/* 넓은 화면: 판과 항목 열을 반씩 — 항목 줄이 좁게 몰리지 않게, 줄 사이도 조금 더 */
@media (min-width: 861px) {
  .roulette-bench { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
  .roulette-bench .panel { padding: 24px; }
  .roulette-bench .le-rows { gap: 8px; max-height: calc(8 * 52px + 6px); }
}
/* 예시·공유·초기화: 셋이 한 줄에 안 들어가면 같은 폭으로 둘째 줄에(한 단추만 길게 늘지 않게) */
.btn-row.btn-trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr)); }
.wheel-box { position: relative; width: min(100%, 460px); aspect-ratio: 1; margin: 4px auto 8px; }
.wheel { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; -webkit-tap-highlight-color: transparent; user-select: none; }
.wheel.grabbing { cursor: grabbing; }
.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.mute { position: absolute; top: 12px; right: 12px; z-index: 3; }
.mute[aria-pressed="true"] .ic-off, .mute[aria-pressed="false"] .ic-on { display: none; }
.fs-btn { position: absolute; top: 12px; right: 64px; z-index: 3; }
.fs-btn[hidden] { display: none; }
.fs-btn[aria-pressed="true"] .ic-on, .fs-btn[aria-pressed="false"] .ic-off { display: none; }
/* 전체 화면: 무대만 화면 가득, 판은 화면 높이에 맞춘다 */
.wheel-stage.is-full { background: var(--paper); border-radius: 0; border: 0; justify-content: center; overflow: auto; padding: 24px; }
.wheel-stage.is-full .wheel-box { width: min(92vw, calc(100vh - 240px)); }
.wheel-stage.is-full .result mark { font-size: var(--step-4, var(--step-3)); }
.tip { opacity: 0.85; }

/* 결과 기록 한 줄(돌림판·제비뽑기): 높이 고정, 칩은 옆으로 흐른다 */
.hist { display: flex; align-items: center; gap: 8px; margin-top: 12px; min-height: 44px; }
.hist-ic { flex: none; display: inline-flex; color: var(--ink-2); }
.hist-list { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 34px; margin: 0; padding: 0; list-style: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.hist-list li { flex: none; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: var(--step--1); font-weight: 600; }
.hist-list li.new { background: var(--mark); color: var(--mark-ink); }
.hist-list:empty::before { content: "—"; color: var(--ink-2); }
.hist-clear { flex: none; }
.hist-list:empty + .hist-clear { visibility: hidden; }
.spin-row { display: flex; justify-content: center; width: 100%; }
.spin-row .btn-big { min-width: min(100%, 240px); }
#remove-winner { margin-top: 8px; }
#remove-winner[hidden] { display: inline-flex !important; visibility: hidden; } /* 자리는 늘 잡아 둔다 — 멈춘 뒤 나타나며 아래(광고)를 밀지 않게(CLS 0) */
.wheel-stage .result { min-height: 3.2em; align-self: stretch; } /* 폭 고정 — 글자가 바뀌어도 상자가 옆으로 움직이지 않게 */
.wheel-stage .result mark { font-size: var(--step-3); font-family: var(--font-display); letter-spacing: -0.03em; }
.win-pop { display: inline-block; animation: win-pop .5s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes win-pop { from { transform: scale(.82); opacity: 0; } to { transform: none; opacity: 1; } }
.hl.swipe.win-pop { animation: swipe .55s cubic-bezier(.16, 1, .3, 1) both, win-pop .5s cubic-bezier(.22, 1, .36, 1) both; }

/* ---------- 사다리 ---------- */
.ladder-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px 6px; }
.ladder { --n: 4; min-width: calc(var(--n) * 50px); max-width: calc(var(--n) * 130px); margin: 0 auto; }
.ladder-names, .ladder-results { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; }
.ladder-name {
  font: inherit; font-weight: 700; font-size: var(--step--1); min-height: 44px; padding: 4px 2px;
  border: 2px solid var(--c); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.ladder-name:disabled { cursor: default; border-color: var(--line); }
.ladder-name:not(:disabled):hover { background: var(--surface-2); }
.ladder-name.done { background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.ladder-svg { display: block; width: 100%; height: clamp(240px, 46vh, 400px); margin: 4px 0; }
.ladder-svg .poles line { stroke: var(--ink); stroke-width: 3; }
.ladder-svg .rungs line { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.ladder-svg.grow .rungs line { animation: rung .35s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes rung { from { opacity: 0; } to { opacity: 1; } }
.ladder-svg .paths polyline { stroke-width: 6; stroke-linejoin: round; stroke-linecap: round; opacity: 0.92; }
.ladder-result {
  font-size: var(--step--1); font-weight: 600; text-align: center; min-height: 44px; padding: 4px 2px;
  display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm);
  background: var(--surface-2); overflow: hidden; text-overflow: ellipsis; min-width: 0; line-height: 1.25;
}
.ladder-result.hit { outline: 2px solid var(--c); outline-offset: -2px; background: var(--surface); }
.ladder-status { text-align: center; min-height: 1.6em; }
.pairs { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 16px; }
.pairs li { font-weight: 700; min-width: 0; display: grid; } /* 이름 한 줄 + 결과 한 줄 고정 — «?» 가 결과로 바뀌어도 높이 같음 */
.pairs li > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; justify-self: start; max-width: 100%; }
.pairs .who { font-weight: 600; color: var(--ink-2); }
.pairs .pending .q { color: var(--ink-2); font-weight: 600; }
.pairs .who::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }
.entries-head { display: grid; grid-template-columns: 28px 1fr 1fr 44px; gap: 8px; font-size: var(--step--1); color: var(--ink-2); margin: 0 0 6px; font-weight: 600; }
.entries-head span:first-child { grid-column: 2; }
.entries { display: grid; gap: 6px; min-height: calc(4 * 44px + 3 * 6px); align-content: start; } /* 기본 4명 칸을 미리 잡아 처음 그릴 때 밀림 없게 */
.entry { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
.ladder-foot { margin-bottom: 16px; }
@media (max-width: 480px) { .entry, .entries-head { grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 6px; } }
.entry-no { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: var(--step--1); text-align: right; }
.run-row { margin-bottom: 8px; }

/* ---------- 제비뽑기 ---------- */
.k-field input { max-width: 160px; }
.run-btn { width: 100%; margin-bottom: 8px; }
.picker-stage { min-height: 280px; }
.out:focus { outline: none; }
.out .empty { color: var(--ink-2); margin: 0; max-width: 32rem; }
.out-head { color: var(--ink-2); font-size: var(--step--1); margin: 0 0 8px; }
.picked { margin: 0; padding: 0; list-style: none; counter-reset: pick; display: grid; gap: 4px; }
.picked li { counter-increment: pick; font-size: var(--step-2); font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 12px; animation: pop .4s cubic-bezier(.16, 1, .3, 1) both; }
.picked li::before { content: counter(pick); font-family: var(--font-display); font-size: var(--step-0); color: var(--ink-2); min-width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; }
.teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 20px; }
.team { animation: pop .4s cubic-bezier(.16, 1, .3, 1) both; min-width: 0; }
.team h3 { margin: 0 0 6px; font-size: var(--step-1); display: flex; align-items: baseline; gap: 8px; }
.team-size { font-size: var(--step--1); font-weight: 500; color: var(--ink-2); }
.team ul { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.team li { padding: 6px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
fieldset.seg { min-width: 0; }

/* ---------- 글자수 ---------- */
.count-bench { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.text-panel textarea { min-height: 300px; margin-bottom: 12px; font-size: var(--step-0); }
.figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.figures .fig-main dd { font-size: var(--step-3); }
.count-stage .figures > div:last-child:nth-child(odd) { grid-column: 1 / -1; } /* 칸 수가 홀수(다른 언어 9칸)면 마지막 칸을 넓혀 빈 칸을 안 남긴다 */
.limit { margin: 0 0 12px; }
.limit-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px; align-items: center; }
.limit-out { grid-column: 1 / -1; font-weight: 700; font-variant-numeric: tabular-nums; min-height: 1.6em; }
.limit-out.over { color: var(--error); }
.sub-row .btn { flex: 1 1 auto; }
@media (max-width: 860px) {
  .count-bench { grid-template-columns: minmax(0, 1fr); }
  .count-stage { order: -1; padding: 12px; }
  .count-stage .figures dd { font-size: var(--step-1); }
  .count-stage .figures .fig-main dd { font-size: var(--step-2); }
  .count-stage .figures > div { padding: 8px 12px; }
  .text-panel textarea { min-height: 220px; }
}

/* ---------- 나이·D-day ---------- */
.date-bench { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
@media (max-width: 860px) { .date-bench { grid-template-columns: minmax(0, 1fr); } }
.date-row { display: flex; gap: 8px; }
.date-row input { flex: 1; }
.date-row .btn { flex: none; }
.empty-state { color: var(--ink-2); margin: 0; }
.sentence { margin: 0 0 16px; font-weight: 600; }
.span-figs { margin: 0 0 16px; }
.span-figs dd { font-size: var(--step-1); }
.figures .fig-wide { grid-column: 1 / -1; }
.date-bench .checks { gap: 0 16px; }
.anniv { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: var(--step--1); }
.anniv caption { text-align: left; font-weight: 700; font-size: var(--step-0); margin-bottom: 6px; }
.anniv th, .anniv td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.anniv thead th { color: var(--ink-2); font-weight: 600; border-bottom: 2px solid var(--ink); }
.anniv tbody th { font-weight: 700; white-space: nowrap; }
.anniv .num { text-align: right; white-space: nowrap; }
.anniv tr.past { color: var(--ink-2); }
.anniv tr.past th { font-weight: 500; }
.anniv tr.next td { font-weight: 700; }
@media (max-width: 860px) { .ladder-bench .panel { order: -1; } }

/* ---------- 허브 ---------- */
.hub-head { margin-bottom: 32px; }
.hub-head h1 { max-width: 16ch; }
.hub-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 40px; }
@media (max-width: 760px) { .hub-groups { grid-template-columns: minmax(0, 1fr); } }
.hub-group h2 { font-size: var(--step--1); font-weight: 700; color: var(--ink-2); margin: 0 0 8px; }
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tool-list a {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 16px;
  align-items: center; padding: 14px 16px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color .15s ease, background-color .15s ease;
}
.tool-list a:hover { border-color: var(--blue); }
.tool-list .pict { grid-row: 1 / span 2; width: 48px; height: 48px; fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.tool-list .pict .fill { fill: var(--mark); stroke: none; }
.t-name { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); letter-spacing: -0.02em; line-height: 1.3; }
.t-desc { color: var(--ink-2); font-size: var(--step--1); line-height: 1.5; }
.brand[aria-current="page"] { color: var(--ink); }
.doc { margin-top: 16px; }
.doc h1 { margin-bottom: 12px; }
.doc .lead { margin-bottom: 24px; }

/* ---------- 랜덤 숫자 뽑기 ---------- */
.range-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: end; }
.range-sep { padding-bottom: 26px; color: var(--ink-2); font-weight: 700; }
.checks { display: flex; flex-wrap: wrap; gap: 0 20px; }
.draw-stage { min-height: 280px; display: flex; flex-direction: column; justify-content: center; }
.balls .empty { color: var(--ink-2); margin: 0; text-align: center; }
.ball-list { list-style: none; margin: 0; padding: 8px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.ball {
  min-width: 64px; height: 64px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--mark); color: var(--mark-ink); border: 2px solid var(--ink);
  box-shadow: inset -5px -6px 0 rgba(27, 34, 51, 0.12);
  font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
  animation: ball-drop .48s cubic-bezier(.3, 1.4, .5, 1) both;
}
.ball.wide { padding: 0 16px; font-size: var(--step-1); }
.ball-list:has(> :nth-child(13)) { gap: 8px; } /* 많이 뽑으면 공을 작게 */
.ball-list:has(> :nth-child(13)) .ball { min-width: 46px; height: 46px; font-size: var(--step-0); }
@keyframes ball-drop {
  0% { opacity: 0; transform: translateY(-56px) scale(.7) rotate(-90deg); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
.draw-head { text-align: center; min-height: 1.6em; margin-top: 12px; }

/* ---------- 팀 나누기 ---------- */
.teams-stage .out { min-height: 120px; }
.out-actions { margin-top: 16px; }

/* ---------- 동전·주사위 ---------- */
.coin-stage { position: relative; display: flex; flex-direction: column; align-items: center; }
.toss-seg { width: min(calc(100% - 112px), 300px); } /* 오른쪽 위 소리 단추(44px)와 겹치지 않게 양쪽에 자리를 둔다 */
.arena { width: 100%; height: 240px; display: flex; align-items: center; justify-content: center; perspective: 900px; }
.coin-wrap { position: relative; width: 168px; height: 168px; }
.coin-wrap::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: -26px; height: 10px; border-radius: 50%;
  background: var(--line); transition: transform .2s ease;
}
.coin-wrap.tossing::after { animation: coin-shadow 1s ease-in-out both; }
@keyframes coin-shadow { 50% { transform: scale(.45); opacity: .5; } }
.coin { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.coin-face {
  position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  font-family: var(--font-display); font-weight: 800; font-size: var(--step-3); letter-spacing: -0.03em; border: 3px solid var(--ink);
}
.coin-h { background: var(--mark); color: var(--mark-ink); box-shadow: inset 0 0 0 10px var(--mark), inset 0 0 0 12px var(--ink); }
.coin-t { background: var(--blue); color: var(--on-blue); transform: rotateX(180deg); box-shadow: inset 0 0 0 10px var(--blue), inset 0 0 0 12px var(--on-blue); }
.dice { display: grid; grid-template-columns: repeat(3, auto); gap: 14px; justify-content: center; align-content: center; }
.dice[data-n="1"] { grid-template-columns: auto; }
.dice[data-n="2"], .dice[data-n="4"] { grid-template-columns: repeat(2, auto); }
.die {
  width: 76px; height: 76px; padding: 10px; border-radius: 16px; background: var(--surface); border: 2px solid var(--ink);
  box-shadow: inset -4px -5px 0 var(--surface-2); display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); place-items: center;
}
.dice[data-n="1"] .die { width: 112px; height: 112px; padding: 16px; border-radius: 22px; }
.dice[data-n="5"] .die, .dice[data-n="6"] .die { width: 64px; height: 64px; padding: 8px; border-radius: 13px; }
.die i { width: 78%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); visibility: hidden; }
.die i.on { visibility: visible; }
.die[data-v="1"] i.on { background: var(--error); width: 92%; }
.die.rolling { animation: die-roll .72s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes die-roll {
  0% { transform: translateY(-40px) rotate(-200deg) scale(.8); }
  55% { transform: translateY(6px) rotate(20deg); }
  75% { transform: translateY(-6px) rotate(-6deg); }
  100% { transform: none; }
}
.coin-stage .result { min-height: 3.2em; align-self: stretch; }
.coin-stage .result mark { font-size: var(--step-3); font-family: var(--font-display); letter-spacing: -0.03em; }
.toss-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 10px; }
.toss-figs dd small { white-space: nowrap; }
.ratio { height: 10px; border-radius: 5px; background: var(--blue); overflow: hidden; margin: 0 0 16px; }
.ratio span { display: block; height: 100%; background: var(--mark); border-right: 2px solid var(--ink); transition: width .3s ease; }
.ratio.empty { background: var(--surface-2); }
.ratio.empty span { background: transparent; border: 0; }
.faces { list-style: none; margin: 8px 0 16px; padding: 0; display: grid; gap: 6px; }
.faces li { display: grid; grid-template-columns: 1.4em minmax(0, 1fr) 7.5em; gap: 10px; align-items: center; font-variant-numeric: tabular-nums; font-size: var(--step--1); }
.face-n { font-family: var(--font-display); font-weight: 800; font-size: var(--step-0); text-align: center; }
.face-bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.face-bar span { display: block; height: 100%; background: var(--ink); border-radius: 5px; }
.face-c { text-align: right; color: var(--ink-2); white-space: nowrap; }
.dice-field select { max-width: 160px; }
@media (max-width: 480px) {
  .arena { height: 200px; }
  .coin-wrap { width: 144px; height: 144px; }
  .die { width: 64px; height: 64px; padding: 8px; }
  .dice[data-n="5"] .die, .dice[data-n="6"] .die { width: 56px; height: 56px; }
  .dice { gap: 10px; }
  .toss-figs dd { font-size: var(--step-1); }
}

/* ---------- 부가세 ---------- */
.vat-opts { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
@media (max-width: 480px) { .vat-opts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .vat-opts .field:first-child { grid-column: 1 / -1; } }
.suffix-box { position: relative; }
.suffix-box input { padding-right: 32px; }
.suffix-box span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-2); font-weight: 700; pointer-events: none; }
#amount { font-size: var(--step-1); font-weight: 700; font-variant-numeric: tabular-nums; }
.receipt-rows { margin: 0; }
.receipt-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line-strong); }
.receipt-rows dt { color: var(--ink-2); font-weight: 600; }
.receipt-rows dt span { font-weight: 500; }
.receipt-rows dd { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; text-align: right; min-width: 0; }
.receipt-rows .receipt-total { border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 4px; }
.receipt-rows .receipt-total dd { font-size: var(--step-3); }
.receipt-rows .given dd { color: var(--ink-2); }
.receipt .hint { margin-top: 8px; }

/* ---------- 돈·계산(금융 계산기, src/finance.mjs) ----------
   입력판 왼쪽·영수증 오른쪽. 맨 위 큰 숫자 하나에만 형광펜, 나머지는 영수증 줄. 입력을 바꾸면 바로 다시 센다. */
.fin-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.suffix-box.no-suffix input { padding-right: 12px; }
.fin-bench input[data-k] { font-variant-numeric: tabular-nums; }
.fin-seg label { text-align: center; line-height: 1.25; padding: 4px 6px; font-size: var(--step--1); hyphens: auto; overflow-wrap: break-word; }
/* 긴 한 낱말(ru «Дифференцированный» 등)이 낱말 가운데서 끊기지 않게: 셋 칸은 글 길이만큼 폭을 나눈다 */
.fin-seg.seg-3 label { flex: 1 1 auto; }
.fin-main { margin: 0 0 12px; display: flex; flex-direction: column; gap: 2px; }
.fin-main-l { color: var(--ink-2); font-weight: 600; font-size: var(--step--1); }
.fin-main .hl {
  align-self: flex-start; font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em;
  font-size: clamp(2rem, 1.5rem + 2.4vw, 3rem); line-height: 1.1; font-variant-numeric: tabular-nums;
}
.fin-stage .receipt-rows dd { font-size: var(--step-1); }
.fin-stage .receipt-rows .receipt-total dd { font-size: var(--step-2); }
.fin-stage [data-row][hidden] { display: none !important; }
.fin-table { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 4px; }
.fin-table > summary {
  min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; list-style: none;
}
.fin-table > summary::-webkit-details-marker { display: none; }
.fin-table > summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line-strong); border-radius: 6px; font-weight: 700; }
.fin-table[open] > summary::before { content: "−"; }
.table-scroll { max-height: 420px; overflow: auto; overscroll-behavior: contain; }
.fin-table .anniv th, .fin-table .anniv td { text-align: right; white-space: nowrap; }
.fin-table .anniv th:first-child, .fin-table .anniv td:first-child { text-align: left; }
.fin-table thead th { position: sticky; top: 0; background: var(--surface); }
/* 퍼센트: 세 칸 */
.pct-bench { grid-template-columns: minmax(0, 1fr); }
.pct-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .pct-cards { grid-template-columns: minmax(0, 1fr); } }
.pct-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
.pct-card h2 { font-size: var(--step-0); margin: 0 0 12px; }
.pct-out { margin: 0; min-height: 3.2rem; }
.pct-out .hl { font-family: var(--font-display); font-weight: 800; font-size: var(--step-3); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pct-actions { max-width: 560px; }
.fin-note { margin-top: 12px; text-wrap: pretty; } /* 마지막 줄에 한 낱말만 남지 않게 */
/* 허브: 넓은 분야 묶음(돈·계산)은 두 칸을 다 쓰고 안에서 두 줄로 */
.hub-wide { grid-column: 1 / -1; }
.hub-wide .tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
@media (max-width: 760px) { .hub-wide .tool-list { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 개발자 도구(12개, K-471 X3) ---------- */
.mono, .code-out, .re-box input, .diff { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.875rem; }
textarea.mono { line-height: 1.5; tab-size: 2; }
.dev-bench { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dev-bench.single { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 860px) { .dev-bench { grid-template-columns: minmax(0, 1fr); } }
.dev-seg label { padding: 4px 8px; text-align: center; line-height: 1.25; }
.dev-opts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px 16px; align-items: end; }
.dev-opts .field { margin-bottom: 8px; }
.dev-opts .checks { padding-bottom: 8px; }
@media (max-width: 420px) { .dev-opts { grid-template-columns: minmax(0, 1fr); } }
.dev-bench .checks { margin: 0 0 12px; }
.out-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; min-height: 44px; }
.out-bar h2, .out-bar h3 { margin: 0; font-size: var(--step-0); font-weight: 700; }
.dev-stage h3 { font-size: var(--step--1); font-weight: 700; margin: 16px 0 6px; color: var(--ink-2); }
.dev-stage .out-bar h3 { margin: 0; }
.copy-btn { flex: none; }
.code-out {
  display: block; margin: 0; padding: 12px; min-height: 120px; max-height: 60vh; overflow: auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; line-height: 1.5; tab-size: 2; color: var(--ink);
}
.code-out:empty::before { content: "—"; color: var(--ink-2); }
.dev-status { min-height: 1.6em; }
.dev-status.ok { color: var(--ok); font-weight: 600; }
.dev-rows { margin: 0 0 8px; }
.dev-rows > div { flex-wrap: wrap; padding: 10px 0; }
.dev-rows dd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; font-size: 0.875rem; letter-spacing: 0; text-align: right; overflow-wrap: anywhere; }
.dev-rows .bad dd { color: var(--error); }
.dev-stage .code-out + .code-out { margin-top: 8px; }
.dev-stage .code-out + .out-bar { margin-top: 16px; }
.sig-out { min-height: 0; color: var(--ink-2); }
/* 해시: 한 줄씩(값은 상자 안에서 줄바꿈) */
.hash-row + .hash-row { margin-top: 12px; }
.hash-out { min-height: 0; }
/* UUID·Lorem */
.uuid-out { min-height: 160px; }
.prose-out { font-family: var(--font-body); font-size: var(--step-0); word-break: normal; overflow-wrap: break-word; min-height: 200px; }
/* 타임스탬프 */
.now-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 0 0 16px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.now-l { color: var(--ink-2); font-weight: 600; font-size: var(--step--1); }
.now-v { font-size: var(--step-1); font-weight: 700; font-variant-numeric: tabular-nums; flex: 1; }
.ts-bench input[type="datetime-local"] { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 10px 12px; min-height: 44px; min-width: 0; }
/* 색 */
input[type="color"] { width: 100%; height: 56px; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--paper); cursor: pointer; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; }
.color-field input[aria-invalid="true"] { border-color: var(--error); }
.swatch { height: 180px; border-radius: var(--r-md); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 32px; margin: 0 0 12px; background: #2346b8; }
.swatch span { font-family: var(--font-display); font-weight: 800; font-size: var(--step-4); letter-spacing: -0.03em; }
.sw-w { color: #ffffff; }
.sw-b { color: #000000; }
/* 정규식 */
.re-box { display: flex; align-items: center; gap: 6px; }
.re-box span { color: var(--ink-2); font-weight: 700; font-family: ui-monospace, Menlo, monospace; }
.re-box input { flex: 1; min-width: 0; }
.flags { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 0 14px; min-width: 0; }
.flags legend { font-weight: 600; font-size: var(--step--1); padding: 0; margin: 0 0 2px; }
.flag { gap: 6px; font-size: var(--step--1); }
.flag code { font-weight: 700; font-size: var(--step-0); }
.flag span { color: var(--ink-2); }
.re-hl mark { background: var(--mark); color: var(--mark-ink); border-radius: 2px; box-shadow: 0 0 0 1px rgba(27, 34, 51, 0.25); }
.re-hl mark.empty { display: inline-block; width: 2px; height: 1.1em; vertical-align: -0.15em; background: var(--blue); padding: 0; }
.re-table { margin-top: 12px; }
.re-table td, .re-table th { font-family: ui-monospace, Menlo, monospace; font-size: 0.8125rem; vertical-align: top; overflow-wrap: anywhere; }
.re-table th { white-space: nowrap; overflow-wrap: normal; }
.re-table tbody:empty { display: none; }
.re-table:has(tbody:empty) { display: none; }
#rep-box { margin-top: 16px; }
.table-scroll { overflow-x: auto; }
/* 비교 */
.diff-ins { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; }
@media (max-width: 720px) { .diff-ins { grid-template-columns: minmax(0, 1fr); } }
.diff-scroll { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); min-height: 120px; }
.diff { width: 100%; border-collapse: collapse; }
.diff td { padding: 1px 8px; vertical-align: top; line-height: 1.5; }
.diff .ln { width: 1%; color: var(--ink-2); text-align: right; user-select: none; white-space: nowrap; font-size: 0.75rem; padding-top: 3px; }
.diff .sg { width: 1%; user-select: none; font-weight: 700; }
.diff .tx { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; }
.diff tr.del { background: color-mix(in srgb, var(--error) 12%, transparent); }
.diff tr.add { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.diff tr.del .sg { color: var(--error); }
.diff tr.add .sg { color: var(--ok); }
.diff mark.d { background: color-mix(in srgb, var(--error) 32%, transparent); color: inherit; border-radius: 2px; }
.diff mark.a { background: color-mix(in srgb, var(--ok) 34%, transparent); color: inherit; border-radius: 2px; }
.diff tbody:empty::after { content: "—"; display: block; padding: 12px; color: var(--ink-2); }
/* 저장된 입력으로 비동기 첫 결과(해시·정규식)를 기다리는 동안 — 1.2초 뒤엔 무조건 보임 */
.dev-wait #main { visibility: hidden; animation: restore-show 0s 1.2s forwards; }
