/* 칼퇴키트 — 공통 스타일 */
:root {
  --bg: #fff; --bg2: #f5f6f8; --bg3: #eceef2; --line: #e3e6eb; --tx: #14171c; --tx2: #5a6372; --tx3: #8a93a3;
  --ac: #2f5bea; --ac-tx: #fff; --ac-bg: #eef2ff; --ok: #12a150; --mark: #ffe98a; --shadow: 0 8px 30px rgba(20, 23, 28, .12);
  --head: 56px; --r: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Segoe UI", sans-serif;
  --glyph: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols 2", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "D2Coding", monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #111318; --bg2: #191c23; --bg3: #232732; --line: #2b303b; --tx: #eceef2; --tx2: #a3acba; --tx3: #727b8b;
  --ac: #86a2ff; --ac-tx: #0d1020; --ac-bg: #1c2442; --ok: #3ccf7d; --mark: #6b5a00; --shadow: 0 8px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111318; --bg2: #191c23; --bg3: #232732; --line: #2b303b; --tx: #eceef2; --tx2: #a3acba; --tx3: #727b8b;
    --ac: #86a2ff; --ac-tx: #0d1020; --ac-bg: #1c2442; --ok: #3ccf7d; --mark: #6b5a00; --shadow: 0 8px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--head) + 120px); }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--tx); background: var(--bg); word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ac); color: var(--ac-tx); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* ---------- 헤더 ---------- */
.top { position: sticky; top: 0; z-index: 40; height: var(--head); display: flex; align-items: center; gap: 12px; padding: 0 max(16px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -.02em; font-size: 18px; margin-right: auto; }
.logo .mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--ac); color: var(--ac-tx); font-size: 15px; }
.gsearch { display: none; align-items: center; gap: 8px; width: min(420px, 40vw); height: 38px; padding: 0 12px; border-radius: 10px; background: var(--bg2); color: var(--tx3); border: 1px solid transparent; }
.gsearch:focus-within { border-color: var(--ac); background: var(--bg); }
.gsearch input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; color: var(--tx); font-size: 14px; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--tx2); }
.icon-btn:hover { background: var(--bg2); color: var(--tx); }

/* ---------- 레이아웃 ---------- */
.shell { max-width: 1240px; margin: 0 auto; }
main { min-width: 0; padding: 20px 16px 56px; }
.side { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow: auto; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: var(--shadow); transform: translateY(105%); visibility: hidden; transition: transform .25s ease, visibility .25s; }
.side.open { transform: none; visibility: visible; }
.side a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 15px; color: var(--tx2); }
.side a:hover { background: var(--bg2); color: var(--tx); }
.side a.on { background: var(--ac-bg); color: var(--ac); font-weight: 700; }
.side .ic, .tabbar .ic { font-family: var(--glyph); width: 22px; text-align: center; font-size: 16px; line-height: 1; }
.ng { margin-top: 14px; }
.ng p { padding: 0 12px 4px; font-size: 12px; font-weight: 700; color: var(--tx3); }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .4); }

.tabbar { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 56px; font-size: 11px; color: var(--tx3); }
.tabbar .ic { font-size: 19px; }
.tabbar .on { color: var(--ac); font-weight: 700; }
body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }

.foot { padding: 28px 16px 36px; border-top: 1px solid var(--line); color: var(--tx2); font-size: 13px; text-align: center; display: grid; gap: 6px; }
.foot a { margin: 0 8px; text-decoration: underline; text-underline-offset: 3px; }
.foot .c { color: var(--tx3); }

/* ---------- 페이지 머리 ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--tx3); margin-bottom: 10px; }
.crumbs a:hover { color: var(--tx); text-decoration: underline; }
.ph h1 { font-size: clamp(22px, 5vw, 30px); line-height: 1.3; letter-spacing: -.03em; }
.ph h1 .smp { font-family: var(--glyph); font-weight: 500; color: var(--tx2); margin-left: 4px; }
.lead { margin-top: 8px; color: var(--tx2); font-size: 15px; max-width: 70ch; }
.lead b { color: var(--tx); font-weight: 600; }

/* ---------- 툴바 (검색 + 분류) ---------- */
.toolbar { position: sticky; top: var(--head); z-index: 30; margin: 16px -16px 0; padding: 10px 16px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.tb-row { display: flex; gap: 8px; align-items: center; padding-bottom: 10px; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 12px; background: var(--bg2); border: 1px solid transparent; color: var(--tx3); }
.search:focus-within { border-color: var(--ac); background: var(--bg); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; color: var(--tx); font-size: 16px; }
.search .hint { display: none; }
.toggle, .seg button { height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--tx2); white-space: nowrap; }
.toggle[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--ac); border-color: var(--ac); color: var(--ac-tx); }
.seg { display: flex; }
.seg button:first-child { border-radius: 12px 0 0 12px; border-right: 0; }
.seg button:last-child { border-radius: 0 12px 12px 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 12px; border-radius: 99px; font-size: 13.5px; color: var(--tx2); background: var(--bg2); white-space: nowrap; }
.chip:hover { color: var(--tx); background: var(--bg3); }
.chip.on { background: var(--tx); color: var(--bg); font-weight: 700; }

/* ---------- 섹션 · 그리드 ---------- */
.sec { padding-top: 28px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sec-h h2, .block > h2, .recent h2 { font-size: 19px; letter-spacing: -.02em; }
.sec-h h2 a:hover { color: var(--ac); }
.more { flex: none; font-size: 13px; color: var(--tx3); }
.more:hover { color: var(--ac); }
.sec-d { margin: 4px 0 0; color: var(--tx2); font-size: 14px; max-width: 78ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 14px; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid.slack { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 76px; padding: 8px 4px 6px; border-radius: var(--r); background: var(--bg2); border: 1px solid transparent; transition: transform .08s, background .15s, border-color .15s; user-select: none; -webkit-user-select: none; }
.cell:hover { background: var(--bg); border-color: var(--ac); }
.cell:active { transform: scale(.94); }
.cell .ch { font: 26px/1.2 var(--glyph); }
.cell .nm { font-size: 11px; line-height: 1.25; color: var(--tx3); text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cell.wide { min-height: 56px; padding: 10px 8px; }
.cell.wide .ch { font-size: 16px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cell.sl { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 60px; padding: 8px 12px; text-align: left; }
.cell.sl .tx { display: grid; min-width: 0; }
.cell.sl code { font: 600 13px var(--mono); color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell.sl .nm { text-align: left; font-size: 12px; -webkit-line-clamp: 1; }
.cell.ok { background: var(--ac-bg); border-color: var(--ac); }
.cell.ok::after { content: "복사됨"; position: absolute; inset: auto 0 5px; font-size: 11px; font-weight: 700; color: var(--ac); text-align: center; background: var(--ac-bg); }
.cell.sl.ok::after, .cell.wide.ok::after { inset: 0; display: grid; place-items: center; border-radius: var(--r); font-size: 13px; }
.recent { margin-top: 20px; padding: 14px; border-radius: 16px; border: 1px dashed var(--line); }
.recent h2 { font-size: 13px; color: var(--tx3); font-weight: 700; }
.recent .grid { margin-top: 10px; grid-template-columns: repeat(auto-fill, minmax(52px, max-content)); }
.recent .cell { min-height: 48px; padding: 6px 10px; }
.recent .cell .ch { font-size: 20px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.recent .cell.txt .ch { font: 600 13px var(--mono); }
.empty { padding: 48px 0; text-align: center; color: var(--tx3); }

/* ---------- 단축키 ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; padding: 0; margin-top: 14px; font-size: 13px; color: var(--tx2); align-items: center; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .sw { margin-left: auto; }
.legend .sw a { color: var(--ac); font-weight: 600; }
kbd { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 7px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--bg); font: 600 13px var(--mono); color: var(--tx); white-space: nowrap; }
kbd .sym { font-family: var(--glyph); font-weight: 400; font-size: 15px; color: var(--tx2); }
.sc { width: 100%; border-collapse: collapse; margin-top: 12px; }
.sc tr { border-top: 1px solid var(--line); }
.sc tr:first-child { border-top: 0; }
.sc th, .sc td { padding: 10px 0; vertical-align: middle; text-align: left; font-weight: 400; }
.sc td { text-align: right; padding-left: 12px; }
.act { display: block; font-size: 15px; font-weight: 600; }
.dsc { display: block; font-size: 12.5px; color: var(--tx3); }
.keys { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; padding: 6px 8px; margin: -6px -8px; border-radius: 10px; position: relative; }
.keys:hover { background: var(--bg2); }
.keys .plus { color: var(--tx3); font-size: 12px; }
.keys .sep { color: var(--tx3); font-size: 12px; padding: 0 4px; }
.keys code { font: 600 14px var(--mono); }
.keys.ok::after { content: "복사됨"; position: absolute; inset: 0; display: grid; place-items: center; background: var(--ac-bg); color: var(--ac); font-size: 13px; font-weight: 700; border-radius: 10px; }
.tip { display: flex; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r); background: var(--ac-bg); font-size: 14px; }
.tip b { flex: none; font-size: 11px; color: var(--ac); letter-spacing: .06em; padding-top: 3px; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 14px; }
.qa { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--bg2); }
.qa a { font-size: 14.5px; font-weight: 600; }
.qa a:hover { color: var(--ac); }
.qa .keys { margin: 0; padding: 4px; flex: none; }

/* ---------- 본문 블록 ---------- */
.block { margin-top: 44px; }
.block h2 + p, .block h2 + ol { margin-top: 10px; }
.howto ol { padding-left: 20px; display: grid; gap: 6px; color: var(--tx2); font-size: 15px; }
.howto ol li::marker { font-weight: 700; color: var(--ac); }
.note { margin-top: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--bg2); font-size: 13.5px; color: var(--tx2); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 20px; color: var(--tx3); flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq h3 { font-size: 15.5px; font-weight: 600; }
.faq p { padding: 0 0 16px; color: var(--tx2); font-size: 15px; max-width: 78ch; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 12px; }
.card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--ac); transform: translateY(-1px); }
.card .ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--bg2); font: 18px var(--glyph); }
.card .tx { display: grid; min-width: 0; }
.card b { font-size: 15px; }
.card small { font-size: 12.5px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gh { margin-top: 18px; font-size: 13px; color: var(--tx3); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.links a { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); font-size: 14px; color: var(--tx2); }
.links a:hover { border-color: var(--ac); color: var(--ac); }
.ad { margin: 28px 0 0; min-height: 100px; }
.prose { max-width: 72ch; }
.prose h1 { font-size: 28px; letter-spacing: -.03em; margin-bottom: 12px; }
.prose h2 { font-size: 18px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--tx2); }
.prose ul { padding-left: 20px; display: grid; gap: 6px; }
.prose a:not(.card) { color: var(--ac); text-decoration: underline; }

/* ---------- 홈 ---------- */
.hero { padding: 20px 0 4px; }
.hero h1 { font-size: clamp(26px, 6.4vw, 40px); line-height: 1.25; letter-spacing: -.035em; }
.hero h1 em { font-style: normal; color: var(--ac); }
.hsearch { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; margin-top: 20px; border-radius: 16px; border: 2px solid var(--tx); background: var(--bg); max-width: 720px; }
.hsearch:focus-within { border-color: var(--ac); }
.hsearch input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; font-size: 17px; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.sugg button { padding: 6px 12px; border-radius: 99px; background: var(--bg2); font-size: 13.5px; color: var(--tx2); }
.sugg button:hover { background: var(--ac-bg); color: var(--ac); }
.results { margin-top: 20px; }
.results h2 { font-size: 13px; color: var(--tx3); margin-top: 22px; }
.results .sc { margin-top: 4px; }
.results .pages { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.results .src { font-size: 11px; color: var(--tx3); margin-left: 6px; font-weight: 400; }
body[data-page="home"] .gsearch, body[data-page="home"] .only-m { display: none; }

/* ---------- 글쓰기 도구 ---------- */
.wtool { display: grid; gap: 14px; margin-top: 20px; }
.pane { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg); }
.pane:focus-within { border-color: var(--ac); }
.pane-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); background: var(--bg2); font-size: 14px; font-weight: 700; }
.pane-h .sp { flex: 1; }
.pane-h .cnt { font-weight: 400; color: var(--tx3); font-size: 13px; }
.pane-h button { height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); font-size: 13px; font-weight: 600; color: var(--tx2); }
.pane-h button:hover { color: var(--tx); border-color: var(--tx3); }
.pane-h button.primary { background: var(--ac); border-color: var(--ac); color: var(--ac-tx); }
.goal { font-weight: 400; font-size: 13px; color: var(--tx2); display: flex; align-items: center; gap: 4px; }
.goal input { width: 78px; height: 34px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; }
.wtool textarea, .out { display: block; width: 100%; min-height: 220px; max-height: 60vh; padding: 14px; border: 0; outline: 0; resize: vertical; background: none; font-size: 16px; line-height: 1.7; overflow: auto; }
.wtool textarea.tall { min-height: 320px; }
.out { white-space: pre-wrap; }
.out:empty::before { content: attr(data-ph); color: var(--tx3); }
.out mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.opts { border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px 14px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 16px; min-width: 0; }
.opts legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--tx3); }
.opts label { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.opts input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--ac); flex: none; }
.opts span { display: grid; min-width: 0; }
.opts b { font-size: 14.5px; font-weight: 600; }
.opts small { font-size: 12px; color: var(--tx3); }
.found { padding: 14px; border-radius: 16px; background: var(--bg2); font-size: 14px; }
.found b { display: block; margin-bottom: 8px; }
.found ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.found li { padding: 4px 10px; border-radius: 99px; background: var(--mark); font-size: 13px; }
.found p { margin-top: 10px; color: var(--tx2); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat { padding: 12px 14px; border-radius: 14px; background: var(--bg2); display: grid; }
.stat b { font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--tx3); }
.bar { position: relative; height: 26px; background: var(--bg2); border-top: 1px solid var(--line); }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ac-bg); border-right: 2px solid var(--ac); transition: width .2s; }
.bar.over i { background: #ffd9d9; border-color: #e5484d; }
.bar span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 26px; color: var(--tx2); }

/* ---------- 토스트 · 모아 복사 ---------- */
.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 99px; background: var(--tx); color: var(--bg); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.tray { position: fixed; z-index: 70; left: 12px; right: 12px; bottom: calc(66px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 16px; background: var(--bg); border: 1px solid var(--ac); box-shadow: var(--shadow); max-width: 640px; margin: 0 auto; }
.tray output { flex: 1; min-width: 0; font: 20px var(--glyph); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tray output:empty::before { content: "문자를 차례로 눌러 담으세요"; font: 14px var(--font); color: var(--tx3); }
.tray button { height: 40px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 700; flex: none; }
#tray-copy { background: var(--ac); color: var(--ac-tx); }
#tray-clear { color: var(--tx3); }
body.has-tray .toast { bottom: calc(136px + env(safe-area-inset-bottom)); }

/* ---------- 넓은 화면 ---------- */
@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .grid.wide { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .stats { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 559px) {
  .sc td { padding-left: 8px; }
  .sc tr.row { display: grid; grid-template-columns: 1fr; padding: 10px 0; gap: 8px; }
  .sc tr.row th, .sc tr.row td { padding: 0; text-align: left; }
  .keys { justify-content: flex-start; margin: 0 -8px; }
  .legend .sw { margin-left: 0; width: 100%; }
  .toggle { padding: 0 10px; font-size: 13px; }
  .tb-row { flex-wrap: wrap; }
  .seg { width: 100%; }
  .seg button { flex: 1; height: 38px; }
}
@media (min-width: 768px) {
  .gsearch { display: flex; }
  .only-m { display: none; }
  main { padding: 28px 28px 72px; }
  .toolbar { margin: 18px -28px 0; padding: 12px 28px 0; }
  .chips { margin: 0 -28px; padding: 0 28px 12px; flex-wrap: wrap; }
  .search .hint { display: inline-flex; height: 22px; min-width: 22px; font-size: 11px; color: var(--tx3); }
}
@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .tabbar, .scrim { display: none !important; }
  .shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
  .side { position: sticky; top: var(--head); align-self: start; height: calc(100vh - var(--head)); max-height: none; transform: none; visibility: visible; box-shadow: none; border-radius: 0; transition: none; padding: 20px 12px; border-right: 1px solid var(--line); z-index: 1; }
  .side a { padding: 8px 12px; font-size: 14.5px; }
  .wtool#cleaner { grid-template-columns: 1fr 1fr; }
  .wtool#cleaner .opts, .wtool#cleaner .found { grid-column: 1 / -1; }
  .wtool#cleaner .opts { order: -1; }
  .wtool#cleaner textarea, .wtool#cleaner .out { min-height: 380px; }
  .toast { bottom: 32px; }
  .tray { bottom: 24px; left: 232px; }
  body.has-tray .toast { bottom: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .top, .side, .tabbar, .toolbar, .foot, .ad, .toast, .tray, .related { display: none !important; }
}
