/* freepngconverter.com — 시스템 폰트만 씁니다.
   🔴 웹폰트를 넣지 않습니다: 첫 화면 무게 목표가 30 KB 이고,
      경쟁사 최경량(imagecompressor.com)이 23.8 KB 입니다. */
:root {
  --bg: #fff; --fg: #16181d; --dim: #5b6270; --line: #dfe3ea;
  --acc: #1f6feb; --good: #15803d; --bad: #b91c1c; --warn: #a16207; --card: #f7f8fa;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1115; --fg: #e6e8ee; --dim: #99a1b3; --line: #262b36;
          --acc: #4c8dff; --good: #4ade80; --bad: #f87171; --warn: #fbbf24; --card: #161a21; }
}
/* 🔴 `color-scheme` — **네이티브 위젯의 테마**입니다 [운영자 스샷 실측 2026-08-15].
   이게 없으면 페이지는 다크인데 `<select>` 드롭다운·스크롤바·날짜 선택기만 **밝게** 뜹니다.
   일본어 모바일 화면에서 PNG 드롭다운만 하얗게 보인 것이 정확히 이 증상이었습니다.
   `light dark` 로 두면 OS 설정을 따라가고, 아래 `prefers-color-scheme` 팔레트와 짝이 맞습니다. */
:root { color-scheme: light dark; }

* { box-sizing: border-box; }

/* 🔴 **움직임을 줄여달라는 설정을 존중합니다.** 전정기관 질환이 있는 사용자에게 애니메이션은
   실제로 어지럼증을 일으킵니다. 우리 transition 은 장식이라 꺼도 기능이 그대로입니다. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 🔴 모바일 조작 기본값 — 셋 다 「없으면 어색한」 것이라 눈에 잘 안 띕니다.
   touch-action: 더블탭 확대를 끄면 탭 반응이 **300ms 빨라집니다**(브라우저가 두 번째 탭을 안 기다림).
   tap-highlight: 안 주면 안드로이드에서 누를 때 **회색 사각형**이 번쩍입니다.
   overscroll-behavior: 목록 끝에서 계속 당길 때 페이지 전체가 따라 늘어나는 것을 막습니다. */
button, a, label, summary, [role="button"] { touch-action: manipulation; }
:root { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
body { overscroll-behavior-y: contain; }

/* 🔴 **버튼 글자는 절대 쪼개지지 않습니다** [운영자 실측 2026-08-15 · 모바일 일본어].
   좁은 화면에서 flex 가 버튼을 짜부라뜨리면 라벨이 **한 글자씩 세로로** 쌓입니다:
       詳細 | 大ア | 変換済 | すべ
            | イコ | みを消 | て消
   라벨 길이는 언어마다 다르므로 「짧게 쓰자」는 규율로 못 막습니다.
   🔴 규칙을 버튼마다 붙이면 새 버튼에서 또 빠집니다 — **여기 한 곳**에서 전부 막습니다.
   버튼이 줄에 안 들어가면 글자를 쪼개는 대신 **버튼째로** 다음 줄에 갑니다(아래 flex-wrap). */
button { white-space: nowrap; }
body {
  /* 🔴 노치·홈 인디케이터 기기에서 좌우·하단이 잘립니다. `env()` 는 그 기기에서만 값이 있고
     데스크톱에서는 0 이라, 조건 없이 더해도 안전합니다. */
  margin: 0 auto; max-width: 720px;
  padding: 24px calc(16px + env(safe-area-inset-right)) calc(48px + env(safe-area-inset-bottom))
           calc(16px + env(safe-area-inset-left));
  background: var(--bg); color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
}
/* 🔴 `balance` 는 제목이 2줄이 될 때 **줄 길이를 고르게** 나눕니다 — 언어마다 길이가 달라
   16개 언어에서 「한 줄에 한 단어만 남는」 모양이 나오는 것을 막습니다. */
h1 { font-size: 1.5rem; margin: 0 0 4px; text-wrap: balance; }
h2, h3, dt { text-wrap: balance; }

/* 🔴 숫자가 바뀌는 자리는 **폭이 고정**돼야 합니다. 안 그러면 % 가 오르내릴 때 글자가 흔들립니다. */
.est, .vstat, #qv, .list .s { font-variant-numeric: tabular-nums; }
.lead { margin: 0 0 20px; color: var(--dim); }

/* 🔴 드롭존 + 옵션을 감싸는 한 장의 카드.
   따로 떨어져 있으면 파일을 넣고 옵션으로 갈 때 시선이 두 번 움직입니다. */
.panel {
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); padding: 12px; margin: 0 0 14px;
}

.drop {
  border: 2px dashed var(--line); border-radius: 12px;
  padding: 40px 16px; text-align: center; cursor: pointer;
  background: var(--bg);
  transition: border-color .15s, background .15s, padding .15s;
}
.drop.on { border-color: var(--acc); background: var(--card); }
.drop label { cursor: pointer; display: block; }
/* 🔴 파일이 들어오면 접습니다. 넣은 뒤에도 같은 크기로 남아 있으면
   모바일에서 결과 목록이 화면 아래로 밀립니다. */
.drop.has { padding: 16px; }
.pick { color: var(--acc); text-decoration: underline; }

.opts {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: end;
  /* 🔴 카드(.panel) 안이므로 배경·테두리를 다시 그리지 않습니다 — 겹치면 액자 속 액자가 됩니다. */
  margin: 12px 0 0; padding: 2px;
}
.opts label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--dim); }
.opts select, .opts input[type=number] {
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--fg); font: inherit; font-size: .95rem;
}
.opts input[type=number] { width: 110px; }
#q { width: 150px; }
/* 품질 숫자가 무슨 뜻인지 알려주는 줄. 값이 바뀌어도 줄이 안 흔들리게 높이를 잡아둡니다. */
.qhint { font-size: .78rem; color: var(--dim); min-height: 1.15em; }

/* 크기 규격을 글자로 남기는 문단. 링크가 아니라 **읽는 글**입니다 —
   페이지를 늘리지 않고 「무엇을 할 수 있는가」를 검색·생성엔진에 알리는 자리입니다. */
.sizes { margin: 24px 0 0; }
.sizes h2 { font-size: 1rem; margin: 0 0 8px; }
.sizes p { margin: 0; color: var(--dim); font-size: .9rem; }
.szlist { margin-top: 6px !important; font-variant-numeric: tabular-nums; }

/* 다른 변환으로 가는 목록 — 크롤러의 통로이자 방문자의 다음 걸음입니다.
   🔴 광고 자리(#list 아래 글 영역)와 겹치지 않게 faq 뒤에 둡니다. */
.more { margin: 28px 0 0; }
.more h2 { font-size: 1rem; margin: 0 0 10px; }
.more ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.more li a {
  display: inline-block; padding: 7px 12px; border: 1px solid var(--line);
  border-radius: 8px; text-decoration: none; color: var(--dim); font-size: .86rem;
}
.more li a:hover { border-color: var(--acc); color: var(--acc); }

/* 크기 지정 — 규격 셀렉트 + 가로 × 세로 + 비율 유지를 한 덩어리로 */
.sizegrp { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.sizegrp .mul { align-self: end; padding-bottom: 8px; color: var(--dim); }
#preset { max-width: 15rem; }
.opts .wh input { width: 84px; }
/* 🔴 다른 라벨은 세로(제목 위, 입력 아래)인데 체크박스만 가로입니다.
   같은 규칙을 쓰면 「비율 유지」 글씨가 체크박스 위로 올라가 짝이 안 맞습니다. */
.opts label.chk {
  flex-direction: row; align-items: center; gap: 6px;
  align-self: end; padding-bottom: 7px; color: var(--fg); font-size: .85rem;
}
.opts label.chk input { accent-color: var(--acc); }
/* 비율(%)을 고르면 치수 입력이 잠깁니다 — 잠긴 것이 보이게 흐려 둡니다. */
.opts input:disabled, .opts label.chk input:disabled { opacity: .4; cursor: default; }
#run, .run {
  /* 🔴 논리 속성입니다 — RTL(아랍어·우르두어)에서 좌우가 뒤집혀야 합니다.
     `margin-left` 로 두면 RTL 에서 버튼이 반대쪽에 붙습니다. */
  margin-inline-start: auto; padding: 9px 22px; border: 0; border-radius: 8px;
  background: var(--acc); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
#run:disabled, .run:disabled { opacity: .45; cursor: default; }

progress { width: 100%; height: 6px; margin-bottom: 10px; }
.note { color: var(--bad); font-size: .9rem; }

/* 예상 결과 한 줄 — 🔴 변환 버튼을 누르기 **전에** 결과 크기를 보여주는 자리입니다.
   .warn 은 「이 설정은 아무것도 바꾸지 않는다」를 알리는 상태입니다(오류가 아니므로 빨강이 아님). */
.est { margin: -6px 0 10px; font-size: .9rem; color: var(--dim); }
.est.warn { color: var(--warn); }
.est.bad { color: var(--bad); }
.est .dim { color: var(--dim); font-size: .85em; }

/* 🔴 `hidden` 속성이 CSS 에 지는 것을 막습니다 [운영자 화면 실측 2026-08-14].
   `.view { display:flex }` 가 UA 스타일시트의 `[hidden]{display:none}` 을 **덮어써서**,
   파일이 하나도 없는데 「자세히 · 큰 아이콘」 버튼이 첫 화면에 보였습니다.
   🔴 JS 로 `hidden` 을 켜는 요소가 늘 때마다 같은 사고가 나므로 **전역으로 못 박습니다** —
      규율(“display 를 주지 말 것”)이 아니라 틀릴 수 없는 물건으로 만듭니다.
   🔴 내 headless 검증은 `el.view.hidden` **속성값**만 봐서 이것을 통과시켰습니다.
      속성이 켜진 것과 화면에서 사라진 것은 다릅니다 — 판정은 화면으로 해야 합니다. */
[hidden] { display: none !important; }

/* 보기 전환 — 자세히(행) · 큰 아이콘(격자)
   🔴 `flex-wrap` 이 빠져 있어 좁은 화면에서 버튼 4개를 한 줄에 밀어넣다가
      글자가 **한 글자씩 세로로 쪼개졌습니다** [운영자 실측 2026-08-15 · 모바일 일본어].
      `.tabs` 에는 있는데 여기만 없었습니다. */
.view { display: flex; gap: 6px; margin: 10px 0 0; flex-wrap: wrap; }
.view button {
  padding: 5px 10px; font: inherit; font-size: .82rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--dim);
  /* 🔴 줄바꿈을 허용해도 **버튼 안에서** 글자가 쪼개지면 같은 증상입니다.
     길이가 언어마다 다르므로 「짧게 쓰자」는 규율로는 못 막습니다 — 여기서 못 박습니다. */
  white-space: nowrap;
}
.view button[aria-pressed=true] { background: var(--card); color: var(--fg); border-color: var(--acc); }
/* 🔴 보기 전환과 목록 정리는 **다른 일**입니다. 사이를 벌려 실수로 누르지 않게 합니다. */
.vsep { flex: 1 1 auto; }
.view .vclr:disabled, .view .vget:disabled { opacity: .4; cursor: default; }
/* 「모두 받기」는 이 줄에서 유일하게 무언가를 **얻는** 버튼이라 색으로 갈라 둡니다.
   나머지(보기 전환·지우기)는 중립이거나 잃는 쪽입니다. */
.view .vget { border-color: var(--acc); color: var(--acc); font-weight: 600; }
.view .vget:disabled { border-color: var(--line); color: var(--dim); font-weight: 400; }
@media (max-width: 520px) { .vsep { flex-basis: 100%; height: 0; } }

.list { list-style: none; padding: 0; margin: 12px 0 0; }
.list li {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: .92rem;
}
/* 🔴 한 줄을 **고정 칸**으로 나눕니다: 썸네일 / 이름·크기 / 증감률 / 저장 / 지우기.
   예전처럼 크기·증감률·저장을 한 덩어리(.s)로 두면 언어마다 글자 길이가 달라
   16개 언어에서 저장 버튼 위치가 줄마다 흔들립니다. */
.list .nm { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.list .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .sz { font-size: .82rem; color: var(--dim); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.list .pct { flex: none; min-width: 4.5ch; text-align: end; font-weight: 600; font-size: .88rem; }
.list .dl {
  flex: none; padding: 5px 12px; border: 1px solid var(--line); border-radius: 7px;
  color: var(--fg); text-decoration: none; font-size: .85rem; white-space: nowrap;
}
.list .dl:hover { border-color: var(--acc); color: var(--acc); }
.list .dl.got { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
/* 아직 변환 전인 줄. 크기만 오른쪽에 둡니다. */
.list .s { flex: none; color: var(--dim); }
/* 🔴 썸네일에 고정 크기를 줍니다. 안 주면 그림이 도착하는 순간 줄 높이가 튀어 목록이 흔들립니다. */
.list img.t {
  flex: none; width: 34px; height: 34px; object-fit: cover;
  border-radius: 5px; background: var(--card);
}
.x {
  flex: none; width: 26px; height: 26px; padding: 0; line-height: 1;
  border: 0; border-radius: 50%; background: transparent; color: var(--dim);
  font: inherit; font-size: 1.1rem; cursor: pointer;
}
.x:hover:not(:disabled) { background: var(--card); color: var(--bad); }
.x:disabled { opacity: .3; cursor: default; }

/* 큰 아이콘 보기 — 결과를 눈으로 확인하러 오는 사람을 위한 배치입니다. */
.list.grid { display: flex; flex-wrap: wrap; gap: 10px; }
.list.grid li {
  position: relative; flex-direction: column; align-items: stretch; gap: 6px;
  width: 158px; padding: 8px; border: 1px solid var(--line); border-radius: 10px;
}
.list.grid img.t { width: 100%; height: 118px; object-fit: contain; border-radius: 6px; }
.list.grid .n { font-size: .82rem; }
.list.grid .s { font-size: .8rem; white-space: normal; overflow-wrap: anywhere; }
/* 큰 아이콘 보기에서는 고정 칸을 풀고 세로로 쌓습니다 — 카드 폭이 158px 뿐입니다. */
.list.grid .sz { white-space: normal; overflow: visible; }
.list.grid .pct { text-align: start; }
.list.grid .dl { text-align: center; }

.good { color: var(--good); }
.bad  { color: var(--bad); }
a { color: var(--acc); }

/* SEO 본문 — 🔴 변환기 아래에 둡니다. 위에 두면 도구를 쓰러 온 사람이 글부터 봅니다. */
.why, .faq { margin-top: 34px; }
.fmts { margin-top: 34px; }
.fmts h2 { font-size: 1.05rem; margin: 0 0 10px; }
.fmts h3 { font-size: .95rem; margin: 16px 0 6px; }
.fmts p { margin: 0 0 6px; color: var(--dim); font-size: .95rem; }
.fmts ul { margin: 0; padding-inline-start: 18px; color: var(--dim); font-size: .95rem; }
.fmts li { margin: 4px 0; }
.why h2, .faq h2 { font-size: 1.05rem; margin: 0 0 10px; }
.why ul { margin: 0; padding-inline-start: 18px; color: var(--dim); }
.why li { margin: 4px 0; }
.faq dt { font-weight: 600; margin-top: 12px; }
.faq dd { margin: 4px 0 0; color: var(--dim); }

/* 방문자 수 — 조용히 둡니다. 도구를 쓰러 온 사람의 시선을 뺏으면 안 됩니다. */
.vstat { margin: 6px 0 0; font-size: .8rem; color: var(--dim); opacity: .8; }

footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line);
         color: var(--dim); font-size: .85rem; }
.langs { margin-top: 8px; line-height: 2; }
.langs a { text-decoration: none; }
.langs a:hover { text-decoration: underline; }
.langs [aria-current] { color: var(--fg); font-weight: 600; }

/* 루트(언어 선택) 페이지 — JS 가 꺼져 있어도 이 목록이 유효한 페이지입니다. */
.langs-list { list-style: none; padding: 0; }
.langs-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* 🔴 화면이 좁으면 버튼이 옵션 아래로 내려가게 합니다 — 겹치면 누를 수 없습니다. */
@media (max-width: 520px) {
  #run, .run { margin-inline-start: 0; width: 100%; }
  .opts label { flex: 1 1 100%; }
}

/* 🔴 삭제 버튼 — 빨강 배경 + 흰 글씨 [운영자 지시 2026-08-14].
   전에는 색이 없어 목록에 있어도 눈에 안 띄었습니다(있는 기능을 못 찾는 것은 없는 것과 같습니다).
   변환 중에는 disabled 가 되어 결과가 엉뚱한 파일에 붙는 것을 막습니다(app.js §removeAt). */
.list .x {
  flex: none;
  min-width: 30px; height: 30px;
  padding: 0 8px;
  background: #d93025; color: #fff;
  border: 0; border-radius: 6px;
  font-size: 16px; line-height: 1; font-weight: 700;
  cursor: pointer;
}
.list .x:hover { background: #b3261e; }
.list .x:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.list .x:disabled { background: #6b3a36; color: #cbb; cursor: default; }
.list.grid .x { position: absolute; top: 5px; inset-inline-end: 5px; background: #d93025; }

/* ── 도구 탭 ─────────────────────────────────────────────
   🔴 현재 탭은 링크가 아니라 aria-current 로 표시합니다 —
      자기 자신으로 가는 링크는 클릭 낭비이고 크롤러에도 의미가 없습니다. */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.tabs a, .tabs span {
  padding: 9px 14px; border-radius: 8px; text-decoration: none;
  border: 1px solid var(--line); color: var(--dim); font-size: .95rem;
}
.tabs a:hover { color: var(--fg); border-color: var(--acc); }
.tabs [aria-current] { background: var(--card); color: var(--fg); border-color: var(--acc); font-weight: 600; }

/* ── 편집기 ─────────────────────────────────────────────── */
#eWrap { position: relative; display: inline-block; max-width: 100%; margin-top: 12px; }
#eCanvas { display: block; max-width: 100%; border-radius: 8px; cursor: crosshair; touch-action: none; }
#eSel {
  position: absolute; display: none; border: 2px dashed #fff;
  background: rgba(0, 206, 209, .18); pointer-events: none;
}
.egroup { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.egroup h3 { margin: 0 8px 0 0; font-size: .9rem; color: var(--dim); font-weight: 600; }
.egroup button {
  background: var(--card); color: var(--fg); border: 1px solid var(--line);
  border-radius: 7px; padding: 8px 12px; cursor: pointer; font-size: .9rem;
}
.egroup button:hover { border-color: var(--acc); }
.egroup input[type=number] { width: 92px; }
#eSave { background: var(--acc); color: #04262a; border: 0; font-weight: 700; }
#eReset { background: #d93025; color: #fff; border: 0; }

/* 🔴 도구 커서는 CSS 가 담당합니다(캔버스의 data-tool 기준).
   펜은 십자가가 아니라 **점**입니다 — 십자가는 「영역을 자른다」는 신호라
   그리는 도구에 쓰면 손이 헷갈립니다 [운영자 지시 2026-08-14]. */
#eCanvas[data-tool="crop"] { cursor: crosshair; }
#eCanvas[data-tool="text"] { cursor: text; }
#eCanvas[data-tool="pen"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14'%3E%3Ccircle cx='7' cy='7' r='4.5' fill='none' stroke='%23000' stroke-width='3'/%3E%3Ccircle cx='7' cy='7' r='4.5' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E") 7 7, crosshair;
}
/* 선택된 도구는 눌린 상태로 보입니다 */
/* 🔴 [계산 `app.py contrast`] 선택 상태의 글자색을 `#04262a` 로 두면 `#1f6feb` 위에서 **3.444:1** 로
   4.5 기준에 1.056 모자랍니다. 흰 글자로 바꿔도 4.634:1 = 여유 3% 라 잣대 ②(5% 미만은 통과 아님)에 걸립니다.
   → 선택 상태만 **더 어두운 파랑**을 씁니다: 흰 글자 대비 7.836:1(여유 +3.336). 다크 테마도 따로 잡습니다. */
.tools3 .tsel[aria-pressed="true"], .tools3 .fsel[aria-pressed="true"] {
  background: #15509f; color: #ffffff; border-color: #15509f; font-weight: 700;
}
@media (prefers-color-scheme: dark) {
  .tools3 .tsel[aria-pressed="true"], .tools3 .fsel[aria-pressed="true"] {
    background: #4c8dff; color: #06182f; border-color: #4c8dff;
  }
}

/* 🔴 [계산 `app.py target --size 34 --gap 8 --min 44`] 도구 버튼이 34 CSS px 이라 크기·중심간 거리 둘 다 미달이었습니다.
   48 px 로 올립니다 — 44 로 맞추면 여유 0% 이라 테두리 하나에 다시 미달합니다(잣대 ②). */
.tools3 .tsel, .tools3 .fsel, .egroup button {
  min-height: 48px; padding-top: 10px; padding-bottom: 10px;
}

/* 🔴 결과 위에서 직접 다듬습니다 — 커서가 어느 도구인지 알려줘야 손이 안 헷갈립니다. */
#mOut { touch-action: none; cursor: none; }
/* 브러시 굵기와 **같은 지름**의 원이 따라다닙니다 — 누르기 전에 지울 면적이 보입니다. */
#mRing {
  display: none; position: fixed; z-index: 40; pointer-events: none;
  border-radius: 50%; box-sizing: border-box;
  border: 1px solid #fff; outline: 1px solid rgba(0,0,0,.75); outline-offset: -2px;
}
#mRing[data-fix="restore"] { border-color: #4ade80; }
#mRing[data-fix="refine"] { border-color: #fbbf24; border-style: dashed; }
#mRing::after {                      /* 중심점 — 얇은 선을 그을 때 어디가 찍히는지 */
  content: ''; position: absolute; left: 50%; top: 50%; width: 2px; height: 2px;
  margin: -1px 0 0 -1px; background: #fff; box-shadow: 0 0 2px rgba(0,0,0,.9);
}
#mFixReset { background: #d93025; color: #fff; border: 0; }

/* 🔴 [실측 2026-08-14] `.mbar` 에 규칙이 하나도 없어 진행바가 높이 0 으로 안 보였습니다.
   숫자를 바 안에 넣습니다 — 바 밖에 두면 눈이 두 군데를 왕복합니다. */
.mbar {
  position: relative; height: 24px; margin: 12px 0;
  border-radius: 12px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
}
.mbar i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .25s ease; }
.mbar b {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-variant-numeric: tabular-nums;
  /* 🔴 채워진 파랑 위에서도, 빈 회색 위에서도 읽혀야 합니다 → 흰 글씨 + 그림자 */
  color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.85), 0 1px 2px rgba(0,0,0,.6);
}
/* 전체 길이를 모를 때(Content-Length 없음)는 숫자를 지어내지 않고 흐르는 줄만 보입니다. */
.mbar.wait i { width: 40%; animation: mslide 1.1s linear infinite; }
@keyframes mslide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* 단축키 안내 — 화면 맨 아래. 🔴 계명 17: 단축키는 화면에서 **발견 가능**해야 합니다. */
.keys { margin: 24px 0 0; font-size: .85rem; color: var(--dim); }
.keys b { color: var(--fg); display: block; margin-bottom: 8px; }
/* 🔴 3열 격자 [운영자 지시 2026-08-14]. 한 줄로 이어 붙이면 가운뎃점 사이에서 눈이 길을 잃습니다.
   `auto-fit` + `minmax` 를 쓰면 열 수를 화면 폭이 정합니다 — 중단점을 손으로 관리하지 않습니다
   (관리하는 순간 언어마다 글자 길이가 달라 어딘가는 반드시 깨집니다). */
.keygrid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 18px; line-height: 1.8;
}
.keygrid li { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.keygrid span { min-width: 0; }
@media (max-width: 700px) { .keygrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .keygrid { grid-template-columns: 1fr; } }
kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; text-align: center;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  background: var(--card); color: var(--fg);
  font: inherit; font-size: .8rem; font-weight: 600;
}

/* 🔴 [실측 2026-08-14] `.mpanes`·`figure` 에 규칙이 하나도 없어 **원본 해상도 그대로** 그려졌습니다.
   4K 사진을 올리면 원본·결과가 세로로 이어져 화면을 몇 번씩 넘겨야 비교가 됩니다.
   → ① 넓으면 좌우로 나란히 ② 각 칸은 **높이 고정 스크롤 상자** ③ 기본은 「화면에 맞춤」. */
.mpanes { display: grid; gap: 14px; margin: 14px 0; }
@media (min-width: 760px) { .mpanes { grid-template-columns: 1fr 1fr; } }
.mpanes figure { margin: 0; min-width: 0; }
.mpanes figcaption { font-size: .85rem; color: var(--dim); margin-bottom: 6px; }
.mview {
  height: 46vh; min-height: 220px; overflow: auto;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
}

/* 🔴 미리보기는 **사용자가 넣는 그림**이라 크기를 미리 모릅니다.
   그래서 `width`/`height` 속성을 적을 수 없습니다 — 적으면 그 비율로 찌그러집니다
   [제가 실제로 512x512 를 적었다가 되돌렸습니다].
   대신 **자리(높이)를 CSS 가 미리 잡고** 그림은 그 안에서 비율을 지킵니다.
   이러면 그림이 도착해도 아래 내용이 밀리지 않습니다(레이아웃 흔들림 0). */
.mview { min-height: 240px; display: flex; align-items: center; justify-content: center; }
.mview img, .mview canvas { max-width: 100%; height: auto; object-fit: contain; }
/* 투명 부분이 어디인지 보이게 격자를 깝니다 — 흰 배경이면 흰 옷과 구별이 안 됩니다. */
.checker .mview {
  background-image:
    linear-gradient(45deg, rgba(128,128,128,.22) 25%, transparent 25%, transparent 75%, rgba(128,128,128,.22) 75%),
    linear-gradient(45deg, rgba(128,128,128,.22) 25%, transparent 25%, transparent 75%, rgba(128,128,128,.22) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
}
.mview img, .mview canvas { display: block; flex: none; }
/* 「맞춤」일 때만 상자에 가둡니다. 숫자 배율일 때는 JS 가 px 를 직접 넣고 상자가 스크롤됩니다. */
.mpanes[data-zoom="fit"] .mview img,
.mpanes[data-zoom="fit"] .mview canvas { max-width: 100%; max-height: 100%; width: auto; height: auto; }

.zoombar { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; flex-wrap: wrap; }
.zoombar button {
  min-width: 48px; min-height: 48px; padding: 8px 12px;
  background: var(--card); color: var(--fg); border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; font: inherit; font-size: .9rem;
}
.zoombar button:hover { border-color: var(--acc); }
.zoombar b { font-variant-numeric: tabular-nums; min-width: 5.5em; text-align: center; color: var(--dim); }

/* 법적 고지 페이지 — 읽는 문서라 폭을 좁히고 줄간을 넓힙니다. */
.legal { max-width: 62ch; }
.legal h2 { font-size: 1.05rem; margin: 22px 0 6px; }
.legal p { margin: 0 0 4px; color: var(--fg); }
.legal .links { font-size: .9rem; }
.mailto a { font-weight: 600; }
.legalnav { font-size: .85rem; color: var(--dim); margin: 8px 0; }
.legalnav a { color: var(--dim); }

/* ── 사진 정보 화면 ─────────────────────────────────────────
   🔴 위치정보 경고가 제일 먼저 눈에 들어와야 합니다. 표보다 배지가 위에 옵니다. */
.xlist { list-style: none; padding: 0; margin: 14px 0 0; }
.xlist > li {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 12px; background: var(--card);
}
.xhead { display: flex; gap: 10px; align-items: center; }
.xhead .t { flex: none; width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--bg); }
.xhead .nm { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.xhead .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xhead .sz { font-size: .82rem; color: var(--dim); font-variant-numeric: tabular-nums; }

.bds { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.bd {
  font-size: .82rem; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--dim);
}
/* 촬영 위치는 가장 위험한 항목이라 유일하게 색을 씁니다. */
.bd.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); font-weight: 600; }

.xt { width: 100%; border-collapse: collapse; margin: 10px 0 0; font-size: .86rem; }
.xt th, .xt td { text-align: start; padding: 5px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.xt th { color: var(--dim); font-weight: 400; white-space: nowrap; width: 1%; }
.xt td { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.xt td.pre { white-space: pre-wrap; font-size: .8rem; color: var(--dim); }

.xact { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.strip {
  padding: 8px 16px; border: 0; border-radius: 8px; background: var(--acc);
  color: #fff; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.strip:hover { filter: brightness(1.08); }
.xact .dim { color: var(--dim); font-size: .82rem; flex: 1 1 14rem; }

/* 지도 링크 — 🔴 좌표는 우리도 남도 안 받습니다. 누르는 순간에만 그쪽으로 갑니다. */
.mapl { color: var(--acc); text-decoration: underline; white-space: nowrap; margin-inline-start: .5em; }
/* 프롬프트처럼 긴 값은 접어 둡니다 — 하나가 화면을 다 먹으면 나머지를 못 봅니다. */
.xt details summary { cursor: pointer; color: var(--dim); }
.xt details[open] summary { margin-bottom: 4px; }

/* 메타데이터 내려받기 — 주 버튼(정보 지우기)보다 약하게 둡니다. */
.gh {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--fg); font: inherit; font-size: .88rem;
  cursor: pointer; white-space: nowrap;
}
.gh:hover { border-color: var(--acc); color: var(--acc); }
.xlist > li.xall { border-style: dashed; padding: 10px 14px; }


/* ── 탭 밖 도구(파비콘·Base64·팔레트) ──────────────────────── */
/* 🔴 결과 영역은 도구마다 다르지만 **테두리·간격은 한 벌**로 둡니다. */
.fvout { margin-top: 22px; }
.fvout h2 { font-size: 1rem; margin: 18px 0 8px; }
.fvout pre {
  /* 🔴 Base64 는 한 줄이 수십만 자입니다. 줄바꿈을 허용하지 않으면 페이지가 통째로
     가로 스크롤됩니다 — 본문은 절대 가로로 밀리면 안 됩니다. */
  white-space: pre-wrap; word-break: break-all;
  max-height: 190px; overflow-y: auto;
  margin: 0; padding: 10px 12px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: .8rem; line-height: 1.5;
}
.ghost {
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--fg);
  border: 1px solid var(--line); font: inherit;
}
.fvlist, .pllist { list-style: none; margin: 0; padding: 0; }
.fvlist li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.fvlist code { color: var(--fg); }
.fvlist span, .pllist span { color: var(--dim); margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.pllist li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: .9rem; }
.sw {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 6px; border: 1px solid var(--line);
  cursor: pointer; padding: 0;
}
/* 진행바 — 진짜 %가 있는 구간이므로 흐르는 막대가 아니라 채워지는 막대입니다. */
.prog { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 12px; }
.prog .bar { height: 100%; width: 0; background: var(--acc); transition: width .15s linear; }

/* 결과 캔버스 — 원본 해상도로 그리고 화면에서만 줄입니다(저장은 원본 크기 그대로). */
.cvout {
  max-width: 100%; height: auto; display: block;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel);
}
.opts input[type=text] {
  padding: 7px 10px; border-radius: 8px; min-width: 160px;
  background: var(--panel); color: var(--fg); border: 1px solid var(--line); font: inherit;
}
.opts input[type=range] { width: 120px; accent-color: var(--acc); }
