/*
  TOOLSITE — 스타일 하나. 시스템 글꼴만 쓰고 외부 글꼴·CDN·이미지가 없다.
  색은 아래 토큰 한 곳에서만 정한다(어두운 모드는 같은 토큰을 다시 정의).
  디자인 메모: 평평한 쿨 그레이 종이 위에 흰 작업판, 결과는 «판독창(readout)» — 짙은 청록 바탕에 큰 숫자 —
  으로 한 가지 시각 언어로 통일한다. 신호색(울트라마린)은 행동 요소에만 쓴다.
*/

:root {
  --paper: #eef2f1;
  --panel: #ffffff;
  --field: #f5f8f7;
  --ink: #11242b;
  --muted: #4f656c;
  --rule: #cdd8d7;
  --rule-strong: #8fa4a5;
  --signal: #2b3de0;
  --signal-ink: #ffffff;
  --signal-soft: #e4e7fd;
  --readout-bg: #12262d;
  --readout-ink: #e9f4f2;
  --readout-muted: #9dbbbb;
  --readout-line: rgba(233, 244, 242, 0.14);
  --readout-accent: #a9b6ff;
  --ok: #1d7a4b;
  --warn: #a85200;
  --warn-soft: #fff1de;
  --bad: #b3261e;
  --bad-soft: #fde8e6;
  --focus: #2b3de0;

  --font: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 14px;
  --radius-sm: 10px;
  --gutter: 1rem;
  --ad-gap: 2.5rem; /* 광고 자리와 도구 사이 최소 간격 — 검사 9번이 2rem 이상인지 본다 */
  --main-w: 46rem;
  --rail-w: 18.75rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1517;
    --panel: #152024;
    --field: #0f191c;
    --ink: #e6efef;
    --muted: #9db2b5;
    --rule: #263639;
    --rule-strong: #4b6569;
    --signal: #93a3ff;
    --signal-ink: #0b1020;
    --signal-soft: #1d2650;
    --readout-bg: #0a1215;
    --readout-ink: #e9f4f2;
    --readout-muted: #8fb0b0;
    --readout-line: rgba(233, 244, 242, 0.12);
    --readout-accent: #a9b6ff;
    --ok: #52c58a;
    --warn: #f0a24a;
    --warn-soft: #3a2a14;
    --bad: #ff8f86;
    --bad-soft: #3d1b19;
    --focus: #93a3ff;
  }
}

/* ── 바탕 ──────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

html[lang="ko"] body {
  word-break: keep-all;
  line-break: strict;
}

img,
svg,
canvas {
  max-width: 100%;
}

/* display 를 지정한 요소도 hidden 속성이 이기게 한다 */
[hidden] {
  display: none !important;
}

a {
  color: var(--signal);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1em;
}

code,
pre {
  font-family: var(--mono);
}

code {
  font-size: 0.9em;
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.05em 0.35em;
}

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

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
}

.skip:focus {
  top: 0.75rem;
}

#main:focus,
[tabindex="-1"]:focus {
  outline: none; /* 프로그램이 옮긴 포커스(제목·본문)에는 고리를 그리지 않는다 */
}

/* ── 미리보기 띠 · 머리 · 꼬리말 ───────────────────────── */
.preview-bar {
  margin: 0;
  padding: 0.35rem var(--gutter);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: center;
}

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.site-header__bar,
.site-nav ul,
.site-footer__inner,
.page {
  width: min(100% - 2 * var(--gutter), 69rem);
  margin-inline: auto;
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.01em;
  font-size: 1.1rem;
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 0.4rem;
  background:
    linear-gradient(#fff, #fff) 0.32rem 0.34rem / 0.8rem 0.15rem no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)) 0.32rem 0.64rem / 0.58rem 0.15rem no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)) 0.32rem 0.94rem / 0.7rem 0.15rem no-repeat,
    #2b3de0;
  flex: none;
}

.brand--lg {
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
}

.lang-switch {
  display: inline-flex;
  border: 1.5px solid var(--rule-strong);
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.9rem;
}

.lang-switch__item {
  padding: 0.4rem 0.85rem;
  color: var(--ink);
  text-decoration: none;
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
}

a.lang-switch__item:hover {
  background: var(--signal-soft);
}

.lang-switch__item[aria-current] {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}

.site-nav {
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  padding: 0 0 0.55rem;
  margin-block: 0;
  white-space: nowrap;
}

.site-nav a {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--ink);
  background: var(--rule);
}

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--rule);
  padding-block: 1.6rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.site-footer a {
  color: var(--ink);
}

.site-footer__note {
  margin: 0;
}

/* ── 페이지 틀 ─────────────────────────────────────────── */
.page {
  padding-block: 1.1rem 0;
}

.page__main {
  min-width: 0;
  max-width: var(--main-w);
}

.page__rail {
  display: none;
}

@media (min-width: 72rem) {
  .page--rail {
    display: grid;
    grid-template-columns: minmax(0, var(--main-w)) var(--rail-w);
    gap: 3rem;
    align-items: start;
  }
  .page--rail .page__rail {
    display: block;
    position: sticky;
    top: 1rem;
    padding-top: 4.2rem;
  }
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0;
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.crumbs li + li::before {
  content: "/";
  margin-inline: 0.5rem;
  color: var(--rule-strong);
}

.crumbs a {
  color: var(--muted);
}

.crumbs [aria-current] {
  color: var(--ink);
  font-weight: 600;
}

.tool-head h1,
.home-hero h1,
.page--root h1 {
  font-size: clamp(1.75rem, 6.2vw, 2.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.lead {
  margin: 0.55rem 0 1.15rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 40rem;
}

.tool-head__meta {
  margin: -0.55rem 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.home-hero {
  padding: 0.6rem 0 1.4rem;
}

.home-hero .tool-head__meta {
  margin: 0.7rem 0 0;
}

.home-hero .lead {
  font-size: 1.12rem;
  margin-bottom: 0;
}

.home-search {
  margin-top: 0.35rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.home-search__label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 750;
}

.home-search__field {
  position: relative;
}

.home-search__field input {
  width: 100%;
  min-height: 3.15rem;
  padding: 0.7rem 3rem 0.7rem 0.85rem;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--ink);
  font: inherit;
}

.home-search__field kbd {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  min-width: 1.7rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  color: var(--muted);
  background: var(--paper);
  font: 0.85rem var(--mono);
  text-align: center;
}

.home-search__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.search-empty {
  margin: 1rem 0 0;
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.language-suggestion {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 1rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.88rem;
}

.language-suggestion[hidden] {
  display: none;
}

.language-suggestion p {
  margin: 0;
}

.language-suggestion button {
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

/* ── 도구 영역 ─────────────────────────────────────────── */
.tool {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem;
}

@media (min-width: 40rem) {
  .tool {
    padding: 1.4rem;
  }
}

.tool__root:empty {
  display: none;
}

.tool__subtitle {
  font-size: 1.05rem;
  font-weight: 750;
  margin: 0 0 0.7rem;
}

.tool__trust {
  margin: 1.1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--rule);
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
}

.tool__trust:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* 표 정리 작업실 · 텍스트 파이프라인 */
.cleaner-source,
.cleaner-controls,
.pipeline-add {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.cleaner-options {
  min-width: 0;
}

.cleaner-preview,
.pipeline-output,
.pipeline-shell {
  margin-top: 1rem;
}

.cleaner-compare {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.cell-changed {
  background: var(--warn-soft);
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--warn);
}

.cleaner-warnings {
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}

.cleaner-warnings ul {
  margin: 0;
  padding-left: 1.25rem;
}

.tool-actions,
.pipeline-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.pipeline-cards {
  display: grid;
  gap: 0.8rem;
}

.pipeline-card {
  padding: 0.9rem;
  border: 1px solid var(--rule);
  border-left: 0.3rem solid var(--signal);
  border-radius: var(--radius-sm);
  background: var(--field);
}

.pipeline-card__head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
  margin-bottom: 0.7rem;
}

.pipeline-card__head h3 {
  font-size: 1rem;
}

.pipeline-card__count {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.pipeline-card__options {
  display: grid;
  gap: 0.6rem;
}

.pipeline-card__options .field {
  margin-bottom: 0;
}

.pipeline-output textarea {
  font-family: var(--mono);
}

.pipeline-shell summary {
  cursor: pointer;
  font-weight: 700;
}

.pipeline-shell pre {
  overflow-x: auto;
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--readout-bg);
  color: var(--readout-ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.pipeline-shell__code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

@media (min-width: 44rem) {
  .cleaner-source,
  .cleaner-controls,
  .pipeline-add {
    grid-template-columns: minmax(0, 1fr) minmax(10rem, auto);
    align-items: end;
  }

  .cleaner-source .drop {
    grid-column: 1 / -1;
  }

  .cleaner-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cleaner-options {
    grid-column: 1 / -1;
  }

  .cleaner-compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pipeline-card__options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── 입력 부품 ─────────────────────────────────────────── */
.field {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1rem;
}

.field__label {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0;
}

.field__hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.input {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.65rem 0.8rem;
  font: inherit;
  font-size: 1rem; /* 16px 미만이면 iOS 가 확대한다 */
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius-sm);
}

.input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.input:hover {
  border-color: var(--ink);
}

.input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}

.input--area {
  min-height: 11rem;
  line-height: 1.55;
  resize: vertical;
}

.input--select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.4rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.25rem) 50%, calc(100% - 0.9rem) 50%;
  background-size: 0.4rem 0.4rem, 0.4rem 0.4rem;
  background-repeat: no-repeat;
}

fieldset {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
  min-width: 0;
}

legend {
  padding: 0;
  margin-bottom: 0.4rem;
}

.seg__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.seg__item {
  position: relative;
}

.seg__input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.seg__label {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0.4rem 0.95rem;
  border: 1.5px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--field);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}

.seg__input:hover + .seg__label {
  border-color: var(--ink);
}

.seg__input:checked + .seg__label {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--signal-ink);
}

.seg__input:focus-visible + .seg__label {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.seg--chips .seg__label {
  min-height: 2.35rem;
  padding: 0.25rem 0.8rem;
  font-variant-numeric: tabular-nums;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding-right: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.check__input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--signal);
  margin: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.9rem;
  padding: 0.5rem 1.15rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
}

.button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.button--primary {
  background: var(--signal);
  color: var(--signal-ink);
}

.button--primary:hover:not(:disabled) {
  filter: brightness(1.1);
}

a.button {
  background: var(--signal);
  color: var(--signal-ink);
}

.button--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.button--ghost:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--field);
}

.button--quiet {
  background: transparent;
  color: var(--signal);
  min-height: 2.6rem;
  padding-inline: 0.7rem;
}

.button--quiet:hover:not(:disabled) {
  background: var(--signal-soft);
}

.button--quiet[data-state="done"] {
  color: var(--ok);
}

.button--quiet[data-state="fail"] {
  color: var(--bad);
}

.button--choice {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: var(--field);
  color: var(--ink);
  border-color: var(--rule-strong);
  font-weight: 600;
  min-height: 3.4rem;
  padding: 0.7rem 1rem;
}

.button--choice:hover,
.button--choice.is-picked {
  border-color: var(--signal);
  background: var(--signal-soft);
}

.copy {
  display: inline-flex;
}

.notice {
  margin: 0 0 1rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--signal-soft);
  border-left: 4px solid var(--signal);
  font-size: 0.95rem;
  line-height: 1.55;
}

.notice--warn {
  background: var(--warn-soft);
  border-left-color: var(--warn);
}

.notice--error {
  background: var(--bad-soft);
  border-left-color: var(--bad);
}

/* ── 판독창(readout): 결과는 모두 이 모양 ──────────────── */
.readout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  margin: 0 0 1rem;
  padding: 0;
  background: var(--readout-bg);
  border-radius: var(--radius);
  overflow: hidden;
}

.readout__item {
  background: var(--readout-bg);
  color: var(--readout-ink);
  padding: 0.85rem 1rem 0.95rem;
  min-width: 0;
  box-shadow: inset -1px -1px 0 var(--readout-line);
}

.readout__item--wide {
  grid-column: span 2;
}

.readout__label {
  font-size: 0.82rem;
  color: var(--readout-muted);
  font-weight: 600;
  line-height: 1.35;
}

.readout__value {
  margin: 0.15rem 0 0;
  font-size: clamp(1.45rem, 5.4vw, 2rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.readout__value--mono {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
}

.readout__hint {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--readout-muted);
}

@media (max-width: 40rem) {
  .readout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .readout__item--wide {
    grid-column: 1 / -1;
  }
}

/* 막대 */
.meter {
  width: 100%;
}

.meter__track {
  height: 0.65rem;
  background: var(--rule);
  border-radius: 999px;
  overflow: hidden;
}

.meter__fill {
  height: 100%;
  width: calc(var(--w, 0) * 1%);
  background: var(--signal);
  border-radius: 999px;
}

.meter[data-state="warn"] .meter__fill {
  background: var(--warn);
}

.meter[data-state="over"] .meter__fill {
  background: var(--bad);
}

@media (prefers-reduced-motion: no-preference) {
  .meter__fill {
    transition: width 0.18s ease-out, background-color 0.18s;
  }
}

/* 파일 놓는 곳 */
.drop {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 2rem 1rem;
  text-align: center;
  border: 2px dashed var(--rule-strong);
  border-radius: var(--radius);
  background: var(--field);
  cursor: pointer;
}

.drop:hover,
.drop.is-over,
.drop:focus-within {
  border-color: var(--signal);
  background: var(--signal-soft);
}

.drop__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.drop__title {
  font-weight: 750;
  font-size: 1.15rem;
}

.drop__hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.drop__name {
  font-family: var(--mono);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.drop__name:empty {
  display: none;
}

/* 표 */
.table-wrap {
  overflow: auto;
  max-height: 22rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.table {
  border-collapse: collapse;
  font-size: 0.88rem;
  width: max-content;
  min-width: 100%;
}

.table th,
.table td {
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  text-align: left;
  white-space: nowrap;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table th {
  position: sticky;
  top: 0;
  background: var(--field);
  color: var(--muted);
  font-weight: 650;
  font-size: 0.78rem;
}

.table tbody tr:first-child td {
  font-weight: 650;
}

/* 탭 */
.tabs__list {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1.5px solid var(--rule);
  margin-bottom: 1rem;
}

.tabs__tab {
  font: inherit;
  font-weight: 700;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1.5px;
  padding: 0.7rem 1.1rem;
  min-height: 2.9rem;
  color: var(--muted);
  cursor: pointer;
}

.tabs__tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--signal);
}

.tabs__tab:hover {
  color: var(--ink);
}

/* 공유 막대 */
.share-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── 광고 자리: 도구 입력·버튼과 --ad-gap 이상 떨어지고, 높이를 미리 잡아 화면이 밀리지 않는다 ── */
.ad-slot {
  margin-block: var(--ad-gap);
}

.ad-slot__label {
  margin: 0 0 0.3rem;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--muted);
}

.ad-slot--flow {
  min-height: 17.5rem;
}

.ad-slot--side {
  min-height: 37.5rem;
  margin-block: 0;
}

.ad-slot__box {
  min-height: 15.5rem;
  border: 2px dashed var(--rule-strong);
  border-radius: var(--radius);
}

.ad-slot--side .ad-slot__box {
  min-height: 36rem;
}

.ad-slot ins {
  display: block;
  min-height: 15.5rem;
}

/* ── 본문(사용법·예시·설명·FAQ) ────────────────────────── */
.guide,
.faq,
.related,
.refs,
.affiliate {
  margin-top: 2.6rem;
}

.guide > .prose:first-child {
  margin-top: 0;
}

.prose {
  max-width: 40rem;
}

.guide .prose + .prose {
  margin-top: 2.2rem;
}

.prose h2,
.related h2,
.refs h2,
.affiliate h2 {
  font-size: clamp(1.25rem, 4.5vw, 1.5rem);
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.prose p {
  line-height: 1.8;
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.8rem;
  line-height: 1.7;
}

.steps__text {
  min-width: 0;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-weight: 750;
  font-size: 0.95rem;
  margin-top: 0.1rem;
}

.example {
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid var(--signal);
  margin-bottom: 1.4rem;
}

.example h3 {
  font-size: 1.05rem;
  font-weight: 750;
  margin-bottom: 0.4rem;
}

.example p {
  margin-bottom: 0.7rem;
}

.example__io {
  display: grid;
  gap: 0.6rem;
  margin: 0;
}

.example__io dt {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 650;
  margin-bottom: 0.15rem;
}

.example__io dd {
  margin: 0;
}

.example__io pre {
  margin: 0;
  padding: 0.7rem 0.9rem;
  background: var(--readout-bg);
  color: var(--readout-ink);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.faq__item {
  border-top: 1px solid var(--rule);
  padding: 1rem 0 0.3rem;
}

.faq__item:last-child {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.3rem;
}

.faq__item h3 {
  font-size: 1.05rem;
  font-weight: 750;
  margin-bottom: 0.4rem;
}

.faq__item p {
  line-height: 1.75;
}

.affiliate {
  padding: 1.1rem 1.2rem;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius);
}

.affiliate ul {
  margin: 0 0 0.8rem;
  padding-left: 1.2rem;
}

.affiliate__note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.refs ul {
  padding-left: 1.2rem;
  overflow-wrap: anywhere;
}

.refs__disclaimer {
  padding: 0.8rem 1rem;
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

/* ── 목록 행(홈·분류·관련 도구) ────────────────────────── */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1.5px solid var(--ink);
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name tag" "lead lead";
  gap: 0.1rem 1rem;
  padding: 0.95rem 0.4rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}

.row:hover {
  background: var(--panel);
}

.row:hover .row__name {
  color: var(--signal);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.row__name {
  grid-area: name;
  font-size: 1.12rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.row__lead {
  grid-area: lead;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 38rem;
}

.row__tag {
  grid-area: tag;
  align-self: start;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}

.listing {
  margin-top: 1.8rem;
}

.listing h2,
.listing h3,
.listing-group__title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.7rem;
}

.listing-group {
  margin-top: 2.6rem;
}

.listing-group__title {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 650;
  margin-bottom: 0;
}

.listing__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.listing__head h3 {
  margin-bottom: 0.7rem;
}

.listing__head a {
  font-size: 0.9rem;
  margin-bottom: 0.7rem;
}

.listing__count {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.info .prose {
  margin-top: 2rem;
}

.info .prose ul {
  padding-left: 1.2rem;
}

.info .prose li {
  margin-bottom: 0.45rem;
  line-height: 1.75;
}

/* 루트(언어 선택)·404 */
.is-root .page {
  padding-top: 4rem;
}

.lang-chooser {
  list-style: none;
  display: grid;
  gap: 0.9rem;
  padding: 0;
  margin: 1.8rem 0 0;
  max-width: 28rem;
}

.lang-chooser a {
  display: grid;
  gap: 0.15rem;
  padding: 1.1rem 1.3rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
}

.lang-chooser a:hover {
  border-color: var(--signal);
  background: var(--signal-soft);
}

.lang-chooser__name {
  font-size: 1.35rem;
  font-weight: 800;
}

.lang-chooser__sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.notfound {
  margin-top: 1.6rem;
}

.notfound h2 {
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
}

/* ══ 도구별 배치 — 공용 부품을 어떻게 놓는지만 정한다 ═══════ */

/* 해시 생성기 */
.hash-tool > * + * {
  margin-top: 1.1rem;
}

.hash-input .input--area {
  min-height: 7.5rem;
}

.opts {
  display: grid;
  gap: 0 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .opts {
    grid-template-columns: 1fr auto;
  }
}

.opts__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
}

.opts .field__label {
  font-weight: 700;
  font-size: 0.95rem;
}

.hashes {
  display: grid;
  gap: 0.55rem;
}

.hash {
  background: var(--readout-bg);
  color: var(--readout-ink);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem 0.8rem;
}

.hash__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 2.2rem;
}

.hash__algo {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--readout-accent);
}

.hash__value {
  display: block;
  margin-top: 0.15rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--readout-ink);
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.hash__value.is-pending {
  color: var(--readout-muted);
}

.hash .button--quiet {
  color: var(--readout-accent);
  min-height: 2.2rem;
  padding-inline: 0.6rem;
}

.hash .button--quiet:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.hash .button--quiet[data-state="done"] {
  color: #7fe0ad;
}

.hash-file__info {
  margin: 0.7rem 0 0;
  font-family: var(--mono);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.hash-file__info:empty {
  display: none;
}

.hash-file__progress {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.hash-file__status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.compare__status {
  margin: -0.4rem 0 0;
  min-height: 1.5rem;
  font-weight: 700;
}

.compare__status[data-kind="ok"] {
  color: var(--ok);
}

.compare__status[data-kind="bad"] {
  color: var(--bad);
}

/* 글자수 세기 */
.cc-input__tools {
  display: flex;
  justify-content: flex-end;
  margin: -0.4rem 0 0.9rem;
}

.cc-note {
  margin: -0.4rem 0 1rem;
  font-size: 0.88rem;
  color: var(--warn);
}

.cc-tool .readout__item:nth-child(-n + 2) .readout__value {
  font-size: clamp(2rem, 9vw, 2.8rem);
}

.cc-tool .readout__item:last-child {
  grid-column: 1 / -1;
}

@media (min-width: 40rem) {
  .cc-tool .readout {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }
  .cc-tool .readout__item {
    grid-column: span 2;
  }
  .cc-tool .readout__item:nth-child(-n + 2) {
    grid-column: span 5;
  }
  .cc-tool .readout__item:last-child {
    grid-column: span 2;
  }
}

.cc-limit {
  border-top: 1px solid var(--rule);
  padding-top: 1.2rem;
}

.cc-limit__grid {
  display: grid;
  gap: 0 1.2rem;
  grid-template-columns: 1fr;
  align-items: end;
}

@media (min-width: 40rem) {
  .cc-limit__grid {
    grid-template-columns: 1fr 11rem;
  }
}

.cc-limit__modes {
  display: grid;
  gap: 0 1.5rem;
}

.cc-status {
  margin-top: 0.4rem;
  padding: 0.9rem 1rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--field);
  border: 1px solid var(--rule);
}

.cc-status[data-state="over"] {
  border-color: var(--bad);
  background: var(--bad-soft);
}

.cc-status[data-state="warn"] {
  border-color: var(--warn);
}

.cc-verdict {
  margin: 0 0 0.6rem;
  font-size: clamp(1.45rem, 5vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.cc-status[data-state="over"] .cc-verdict {
  color: var(--bad);
}

.cc-status[data-state="warn"] .cc-verdict {
  color: var(--warn);
}

.cc-status[data-state="ok"] .cc-verdict {
  color: var(--ok);
}

.cc-items {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.cc-item {
  padding: 0.8rem 1rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--field);
  display: grid;
  gap: 0.45rem;
}

.cc-item[data-state="over"] {
  border-color: var(--bad);
  background: var(--bad-soft);
}

.cc-item__head {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  min-width: 0;
}

.cc-item__name {
  font-weight: 800;
  flex: none;
}

.cc-item__preview {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.cc-item__nums {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
}

.cc-item__count {
  font-size: 1.3rem;
  font-weight: 800;
}

.cc-item__verdict {
  font-weight: 700;
  font-size: 0.95rem;
}

.cc-item[data-state="over"] .cc-item__verdict {
  color: var(--bad);
}

.cc-item[data-state="ok"] .cc-item__verdict {
  color: var(--ok);
}

.cc-item[data-state="warn"] .cc-item__verdict {
  color: var(--warn);
}

.cc-item__limit {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.cc-item__limit .input {
  max-width: 8rem;
  min-height: 2.4rem;
  padding-block: 0.3rem;
}

.cc-actions {
  margin-top: 1.1rem;
}

/* CSV 복구기 */
.csv-status:empty {
  display: none;
}

.csv-status {
  margin-top: 0.9rem;
}

.csv-result {
  margin-top: 1.2rem;
  display: grid;
  gap: 0.2rem;
}

.csv-why {
  margin: -0.3rem 0 1rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.csv-settings {
  display: grid;
  gap: 0 1.2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .csv-settings {
    grid-template-columns: 1fr 1fr;
  }
}

.csv-preview {
  margin-bottom: 1.2rem;
}

.csv-output {
  border-top: 1px solid var(--rule);
  padding-top: 1.2rem;
}

.csv-output .field__hint {
  margin: -0.3rem 0 1rem;
}

@media (min-width: 40rem) {
  .csv-info .readout {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .csv-info .readout__item {
    grid-column: span 2;
  }
  .csv-info .readout__item:nth-child(-n + 2) {
    grid-column: span 3;
  }
}

.csv-output__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.csv-done {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ok);
  font-weight: 650;
}

/* 테스트(quiz)·카드 틀 */
.quiz__head {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.quiz__count {
  font-size: 0.88rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.quiz__q {
  font-size: clamp(1.25rem, 4.6vw, 1.6rem);
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.quiz__options {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.6rem;
}

.quiz__result-title {
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.quiz__result-text {
  font-size: 1.08rem;
}

.quiz__card,
.cardmaker__preview {
  margin: 1rem 0;
}

.card-canvas {
  display: block;
  width: min(100%, 24rem);
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
}

.quiz__actions,
.cardmaker__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.cardmaker {
  display: grid;
  gap: 1.2rem;
}

.cardmaker__preview-panel {
  order: -1;
}

.cardmaker__form > summary {
  font-weight: 700;
  cursor: pointer;
  padding-block: 0.7rem;
}

/* 세계 시간 격자 */
.tg-controls,
.tg-map-section {
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}

.tg-title {
  margin: 0 0 0.8rem;
  font-size: 1.08rem;
}

.tg-city-results,
.tg-columns,
.tg-column-actions,
.tg-fill,
.tg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tg-city-results { margin-block: 0.5rem; }
.tg-columns { margin-top: 0.8rem; }
.tg-column-card {
  display: grid;
  gap: 0.25rem;
  min-width: 9.5rem;
  padding: 0.65rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.tg-column-card > span,
.tg-map-section .field__hint,
.tg-source { color: var(--muted); font-size: 0.82rem; }
.tg-column-actions .button { padding: 0.3rem 0.48rem; }
.tg-add > summary { cursor: pointer; font-weight: 750; padding-block: 0.45rem; }
.tg-add[open] > summary { margin-bottom: 0.8rem; }
.tg-date-row { display: grid; gap: 0.7rem; grid-template-columns: 1fr 1fr; }
.tg-fill { align-items: center; margin-top: 0.8rem; }
.tg-fill .input { width: auto; }
.tg-grid { margin-block: 1rem; }
.tg-table { min-width: 56rem; }
.tg-table th,
.tg-table td { vertical-align: top; }
.tg-table thead th small { display: block; margin-top: 0.25rem; color: var(--muted); font-weight: 500; }
.tg-table tbody th { min-width: 8rem; }
.tg-table tbody th > span { display: block; margin-block: 0.35rem; }
.tg-table tbody th .button { padding: 0.25rem; }
.tg-table tr.is-selected > * { box-shadow: inset 0 2px var(--accent); }
.tg-cell { min-width: 10.5rem; border-left: 0.25rem solid transparent; }
.tg-cell--work { background: color-mix(in srgb, var(--ok) 11%, transparent); border-left-color: var(--ok); }
.tg-cell--evening { background: color-mix(in srgb, #c97600 12%, transparent); border-left-color: #c97600; }
.tg-cell--night { background: color-mix(in srgb, #5965a8 13%, transparent); border-left-color: #5965a8; }
.tg-cell-time,
.tg-relative span { display: block; }
.tg-day-delta { color: var(--danger); font-weight: 750; }
.tg-relative { min-width: 11rem; }
.tg-relative span { margin-top: 0.3rem; color: var(--muted); font-size: 0.82rem; }
.tg-legend,
.tg-status,
.tg-source { margin-top: 0.7rem; }
.tg-status:empty { display: none; }
.tg-map { overflow: hidden; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: #b9ddec; }
.tg-map svg { display: block; width: 100%; height: auto; }
.tg-ocean { fill: #b9ddec; }
.tg-land { fill: #e9e5d3; stroke: #8e958e; stroke-width: 0.7; }
.tg-night { fill: #17213d; opacity: 0.56; pointer-events: none; }
.tg-dot { stroke: #fff; stroke-width: 1.3; cursor: pointer; }
.tg-dot--work { fill: #177a55; }
.tg-dot--evening { fill: #db7d00; }
.tg-dot--night { fill: #5965a8; }
.tg-point.is-column .tg-dot { stroke: #e73562; stroke-width: 3; }
.tg-point:focus { outline: none; }
.tg-point:focus .tg-dot { stroke: #111; stroke-width: 3; }
.tg-map-label { fill: #101522; stroke: #fff; stroke-width: 3; paint-order: stroke; font: 700 13px system-ui, sans-serif; pointer-events: none; }

@media (max-width: 32rem) {
  .tg-date-row { grid-template-columns: 1fr; }
  .tg-map-label { font-size: 16px; }
}

@media (min-width: 40rem) {
  .cardmaker {
    grid-template-columns: 1fr minmax(0, 20rem);
    align-items: start;
  }

  .cardmaker__preview-panel {
    order: 0;
    position: sticky;
    top: 1rem;
  }

  .cardmaker__form > summary {
    display: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .ad-slot,
  .preview-bar {
    display: none;
  }
}
