/* 칼퇴키트 — 공통 스타일 */
:root {
  --bg: #fff; --bg2: #f2f2f7; --bg3: #e5e5ea; --line: #dcdce3; --tx: #1d1d1f; --tx2: #48484a; --tx3: #6e6e73;
  --ac: #007aff; --ac-tx: #fff; --ac-bg: #e8f1ff; --ok: #248a3d; --mark: #ffe98a; --shadow: 0 8px 30px rgba(0, 0, 0, .12);
  --page: #f2f2f7; --side: #e9e9ee; --fill: #e3e3e8; --hair: 0 0 0 1px var(--line);
  --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: #1c1c1e; --bg2: #2c2c2e; --bg3: #3a3a3c; --line: #38383a; --tx: #f5f5f7; --tx2: #c7c7cc; --tx3: #98989d;
  --ac: #0a84ff; --ac-tx: #fff; --ac-bg: #0a2a4d; --ok: #30d158; --mark: #6b5a00; --shadow: 0 8px 30px rgba(0, 0, 0, .5);
    --page: #000; --side: #161618; --fill: #2c2c2e; --hair: 0 0 0 1px var(--line);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1c1e; --bg2: #2c2c2e; --bg3: #3a3a3c; --line: #38383a; --tx: #f5f5f7; --tx2: #c7c7cc; --tx3: #98989d;
    --ac: #0a84ff; --ac-tx: #fff; --ac-bg: #0a2a4d; --ok: #30d158; --mark: #6b5a00; --shadow: 0 8px 30px rgba(0, 0, 0, .5);
    --page: #000; --side: #161618; --fill: #2c2c2e; --hair: 0 0 0 1px var(--line);
    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; }
.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; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 14px; }
.grid.wide { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid.slack { grid-template-columns: repeat(auto-fit, 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; max-width: 240px; overflow: hidden; }
.recent .cell .ch { font-size: 20px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.recent .cell.txt .ch { font: 600 13px var(--mono); }
.empty { padding: 48px 0; text-align: center; color: var(--tx3); }

.grid.big { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.grid.big .cell { min-height: 104px; }
.grid.big .cell .ch { font-size: 38px; }
.grid.big .cell .nm { font-size: 12px; }
.grid.ex { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.ex .cell { align-items: flex-start; padding: 12px 14px; }
.grid.ex .cell .ch { font: 15px/1.5 var(--font); white-space: normal; text-align: left; }
.aka { margin-top: 10px; font-size: 14px; color: var(--tx2); }
.aka b { color: var(--tx); font-weight: 600; }
.block > p { color: var(--tx2); font-size: 15.5px; }
.ut { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.ut th, .ut td { padding: 9px 8px 9px 0; text-align: left; border-top: 1px solid var(--line); font-weight: 400; }
.ut thead th { border-top: 0; font-size: 12px; color: var(--tx3); font-weight: 700; }
.ut td:first-child { font: 22px var(--glyph); width: 48px; }
.ut .keys { margin: -4px -6px; padding: 4px 6px; justify-content: flex-start; }
.sc td.plain { color: var(--tx2); font-size: 14px; }

/* ---------- 단축키 ---------- */
.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-fit, minmax(min(100%, 330px), 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; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, 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 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; }
.goal.keep { cursor: pointer; }
.goal.keep input { width: 16px; height: 16px; padding: 0; margin: 0; accent-color: var(--ac); }
.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-fit, 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); }

/* ---------- 공문 PDF 뷰어 ---------- */
.gv { --seal: #c3302a; --hl: rgba(255, 190, 20, .42); --hl-cur: rgba(195, 48, 42, .32); position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); height: calc(100dvh - var(--head) - 150px); min-height: 480px; margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg2); font-size: 14px; line-height: 1.5; }
:root[data-theme="dark"] .gv { --seal: #e5554c; --hl-cur: rgba(229, 85, 76, .42); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gv { --seal: #e5554c; --hl-cur: rgba(229, 85, 76, .42); } }
.gv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.gv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: var(--tx); }
.gv-btn:hover { border-color: var(--tx3); }
.gv-btn.primary { background: var(--ac); border-color: var(--ac); color: var(--ac-tx); }
.gv-btn.icon { width: 36px; padding: 0; }
.gv-btn:disabled { opacity: .45; cursor: default; }
.gv-search { display: flex; align-items: center; gap: 6px; flex: 1 1 320px; min-width: 0; max-width: 560px; }
.gv-field { flex: 1; min-width: 0; position: relative; }
.gv-field input { width: 100%; height: 36px; padding: 0 64px 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); font-size: 16px; outline: 0; }
.gv-field input:focus { border-color: var(--ac); }
.gv-count { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--tx3); font-variant-numeric: tabular-nums; pointer-events: none; }
.gv-opts { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--tx2); }
.gv-opts label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.gv-opts input { accent-color: var(--ac); }
.gv-main { display: grid; grid-template-columns: 1fr; min-height: 0; position: relative; }
.gv-side { position: absolute; inset: 0 auto 0 0; width: min(320px, 88%); z-index: 20; background: var(--bg2); box-shadow: 4px 0 24px rgba(0, 0, 0, .2); overflow: auto; display: flex; flex-direction: column; }
.gv-side:not(.open) { display: none; }
.gv-sec { padding: 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.gv-sec h2 { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--tx3); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gv-sec h2 span { letter-spacing: 0; font-weight: 400; }
.gv-docs, .gv-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.gv-docs li { display: flex; align-items: stretch; border-radius: 8px; }
.gv-docs li:hover, .gv-docs li[aria-current="true"] { background: var(--bg); }
.gv-docs li[aria-current="true"] { box-shadow: inset 2px 0 0 var(--seal); }
.gv-doc { flex: 1; min-width: 0; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 7px 4px 7px 10px; }
.gv-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gv-meta { font-size: 12px; color: var(--tx3); font-variant-numeric: tabular-nums; }
.gv-tag { grid-column: 1 / -1; font-size: 11.5px; color: var(--tx3); }
.gv-x { flex: none; width: 30px; color: var(--tx3); font-size: 16px; border-radius: 8px; }
.gv-x:hover { color: var(--seal); }
.gv-none, .gv-note { font-size: 12px; color: var(--tx3); margin: 0; padding: 4px 2px; }
.gv-info { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13px; align-items: baseline; }
.gv-info dt { color: var(--tx3); white-space: nowrap; }
.gv-info dd { margin: 0; min-width: 0; }
.gv-val { text-align: left; padding: 2px 6px; margin: -2px -6px; border-radius: 6px; overflow-wrap: anywhere; position: relative; }
.gv-val:hover { background: var(--bg); }
.gv-val.ok, #gv-copyInfo.ok { background: var(--ac-bg); color: var(--ac); }
.gv-warn { font-size: 12.5px; padding: 8px 10px; border: 1px solid var(--seal); color: var(--seal); border-radius: 8px; margin: 0; }
.gv-grp { font-size: 12px; color: var(--tx3); padding: 8px 2px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gv-results button { width: 100%; text-align: left; padding: 7px 9px; border-radius: 8px; display: grid; grid-template-columns: 40px 1fr; gap: 8px; font-size: 13px; }
.gv-results button:hover, .gv-results button[aria-current="true"] { background: var(--bg); }
.gv-results button[aria-current="true"] { box-shadow: inset 2px 0 0 var(--seal); }
.gv-pg { color: var(--tx3); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 1px; }
.gv-sn { min-width: 0; overflow-wrap: anywhere; }
.gv-results mark { background: var(--hl); color: inherit; border-radius: 2px; }
.gv-viewwrap { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; min-width: 0; background: var(--bg3); }
.gv-vbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg2); font-variant-numeric: tabular-nums; }
.gv-title { margin-right: auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 140px; }
.gv-status { font-size: 12px; color: var(--tx3); }
.gv-pgbox { display: flex; align-items: center; gap: 6px; color: var(--tx2); }
.gv-pgbox input { width: 48px; height: 32px; text-align: center; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.gv-vbar .gv-btn { height: 32px; }
.gv-vbar .gv-btn.icon { width: 32px; }
.gv-zoomv { min-width: 44px; text-align: center; color: var(--tx2); }
.gv-viewer { overflow: auto; min-height: 0; position: relative; padding: 16px 12px 40px; overscroll-behavior: contain; }
.gv-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; width: max-content; min-width: 100%; }
.gv-page { position: relative; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 6px 20px rgba(20, 30, 50, .1); flex: none; }
.gv-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.gv-pnum { display: none; position: absolute; left: 100%; top: 0; margin-left: 8px; font-size: 11px; color: var(--tx3); }
.gv .textLayer { position: absolute; text-align: initial; inset: 0; overflow: hidden; opacity: 1; line-height: 1; -webkit-text-size-adjust: none; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; z-index: 2; word-break: normal; overflow-wrap: normal; }
.gv .textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; }
.gv .textLayer span.markedContent { top: 0; height: 0; }
.gv .textLayer ::selection { background: rgba(45, 91, 215, .3); }
.gv .textLayer .hl { position: static; background: var(--hl); border-radius: 2px; margin: -1px; padding: 1px; }
.gv .textLayer .hl.cur { background: var(--hl-cur); box-shadow: 0 0 0 1.5px var(--seal); }
.gv-empty { display: grid; place-items: center; height: 100%; padding: 24px; text-align: center; color: var(--tx2); }
.gv-empty > div { display: flex; flex-direction: column; gap: 10px; align-items: center; max-width: 38ch; }
.gv-empty strong { font-size: 19px; color: var(--tx); letter-spacing: -.02em; }
.gv-empty p { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.gv-drop { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 85%, transparent); border: 3px dashed var(--ac); border-radius: 16px; font-size: 20px; font-weight: 700; }
@media (max-width: 767px) {
  .gv { height: calc(100dvh - var(--head) - 56px - env(safe-area-inset-bottom) - 24px); margin-left: -8px; margin-right: -8px; }
  .gv-search { flex-basis: 100%; max-width: none; order: 3; }
  .gv-title { flex-basis: 100%; }
  .gv-opts { order: 4; }
}
@media (min-width: 1280px) {
  .gv-main { grid-template-columns: 290px minmax(0, 1fr); }
  .gv-side, .gv-side:not(.open) { position: static; display: flex; width: auto; box-shadow: none; border-right: 1px solid var(--line); }
  .gv-sidetoggle { display: none; }
  .gv-pnum { display: block; }
}

/* ---------- 왼쪽 메뉴 하단 배너: 가로형 띠배너, 게임 스플래시 아트 ---------- */
a.sbn { display: flex; align-items: center; gap: 8px; position: relative; flex: none; width: 100%; max-width: 320px; height: 68px; margin: 20px auto 0; padding: 0 10px 0 8px; border-radius: 12px; overflow: hidden; color: #2b2f3a;
  background: #e9eefb url(/banner/spinner-bg.webp) center 12% / cover no-repeat; border: 1px solid rgba(60, 80, 140, .22); transition: transform .15s, box-shadow .15s; }
a.sbn:hover { background-color: #e9eefb; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(40, 60, 120, .22); }
.sbn img { display: block; max-width: none; }
.sbn-l { position: absolute; right: 5px; top: 4px; z-index: 3; font-size: 9px; line-height: 1.5; font-weight: 700; padding: 0 4px; border-radius: 3px; background: rgba(255, 255, 255, .8); color: rgba(43, 47, 58, .7); }
/* 더미는 (452,456)/886 지점을 축으로 돌고, 얼굴은 그 자리에 똑바로 서 있습니다 (게임 스플래시와 같은 값) */
.sbn-stage { position: relative; flex: none; width: 58px; height: 58px; order: 1; }
.sbn-cluster { width: 100%; height: 100%; transform-origin: 51.02% 51.47%; animation: sbn-spin 26s linear infinite; filter: drop-shadow(0 2px 2px rgba(60, 40, 20, .2)); }
.sbn-face { position: absolute; left: 51.02%; top: 51.47%; width: 26%; height: auto; border-radius: 50%; translate: -50% -50%; animation: sbn-face 1.6s ease-out infinite .55s; }
.sbn-shot { display: none !important; }
.sbn-logo { order: 2; flex: 0 1 auto; min-width: 0; height: 54px; width: auto; margin-right: auto; filter: drop-shadow(0 2px 2px rgba(40, 50, 90, .2)); }
.sbn:hover .sbn-cluster { animation-duration: 6s; }
@keyframes sbn-spin { to { transform: rotate(360deg); } }
@keyframes sbn-face { 0%, 30% { transform: rotate(0); } 36% { transform: rotate(-8deg) scale(1.06); } 48% { transform: rotate(5deg); } 60%, 100% { transform: rotate(0); } }
.sbn-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sbn-c { order: 3; flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 12px; border-radius: 50%; background: #ff554f; color: #fff; font-size: 0; box-shadow: 0 2px 0 #c93a35; }
.sbn-c span { font-size: 14px; font-weight: 700; line-height: 1; }
@media (prefers-reduced-motion: reduce) { .sbn-cluster, .sbn-face { animation: none; } }

/* ---------- PDF 편집기 ---------- */
.pe-modes { margin: 14px 0 0; padding: 0; flex-wrap: wrap; overflow: visible; }
.pe { margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg2); font-size: 14px; }
.pe-bar, .pe-bar2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; }
.pe-bar { border-bottom: 1px solid var(--line); position: sticky; top: var(--head); z-index: 20; background: var(--bg2); border-radius: 16px 16px 0 0; }
.pe-bar2 { padding-bottom: 0; }
.pe-sp { flex: 1; }
.pe-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.pe-status { font-size: 12.5px; color: var(--tx3); }
.pe-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: var(--tx); }
.pe-btn:hover:not(:disabled) { border-color: var(--tx3); }
.pe-btn:disabled { opacity: .4; cursor: default; }
.pe-btn.primary { background: var(--ac); border-color: var(--ac); color: var(--ac-tx); }
.pe-btn.ghost { border-color: transparent; background: none; color: var(--tx2); }
.pe-btn.danger { color: #e5484d; }
.pe-btn.icon { width: 36px; padding: 0; font-size: 17px; }
.pe-btn.big { height: 48px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.pe-btn[aria-pressed="true"] { background: var(--ac-bg); border-color: var(--ac); color: var(--ac); }
.pe:not(:has(.pe-work:not([hidden]))) #pe-undo, .pe:not(:has(.pe-work:not([hidden]))) #pe-save { display: none; }
.pe.busy .pe-grid, .pe.busy .pe-bar2 { opacity: .55; pointer-events: none; }
.pe.busy .pe-status::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -2px; border: 2px solid var(--line); border-top-color: var(--ac); border-radius: 50%; animation: pe-spin .8s linear infinite; }
@keyframes pe-spin { to { transform: rotate(360deg); } }

.pe-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 20px 52px; text-align: center; color: var(--tx2); margin: 12px; border: 2px dashed var(--line); border-radius: 14px; background: var(--bg); }
.pe-empty strong { font-size: 18px; color: var(--tx); letter-spacing: -.02em; }
.pe-empty span { max-width: 42ch; }
.pe-empty .pe-btn { margin-top: 8px; }
.pe-empty small { color: var(--tx3); }
.pe-drop-ic { display: grid; place-items: center; width: 56px; height: 68px; border-radius: 6px 18px 6px 6px; background: #e5484d; color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .04em; box-shadow: 0 6px 16px rgba(229, 72, 77, .25); }
.pe-hint { margin: 8px 12px 0; font-size: 12.5px; color: var(--tx3); }
.pe-grid { list-style: none; margin: 0; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pe-th { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; background: var(--bg); border: 2px solid transparent; transition: border-color .15s, opacity .15s; }
.pe-th.sel { border-color: var(--ac); background: var(--ac-bg); }
.pe-th.dragging { opacity: .35; }
.pe-th.drop-l { box-shadow: -4px 0 0 var(--ac); }
.pe-th.drop-r { box-shadow: 4px 0 0 var(--ac); }
.pe-pv { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1.25; border-radius: 6px; background: var(--bg3); overflow: hidden; cursor: pointer; }
.pe-pv canvas { max-width: 100%; max-height: 100%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.pe-pv:hover canvas { outline: 2px solid var(--ac); }
.pe-th[draggable="true"] .pe-pv { cursor: grab; }
.pe-badge { position: absolute; left: 6px; bottom: 6px; padding: 1px 7px; border-radius: 99px; background: var(--ac); color: var(--ac-tx); font-size: 11px; font-weight: 700; }
.pe-ck { position: absolute; left: 12px; top: 12px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); cursor: pointer; }
.pe-ck input { width: 17px; height: 17px; margin: 0; accent-color: var(--ac); cursor: pointer; }
.pe-del { position: absolute; right: 12px; top: 12px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: rgba(255, 255, 255, .92); color: #444; font-size: 13px; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.pe-del:hover { background: #e5484d; color: #fff; }
.pe-ops { display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.pe-ops button { width: 28px; height: 28px; border-radius: 7px; font-size: 16px; color: var(--tx2); }
.pe-ops button:hover:not(:disabled) { background: var(--bg2); color: var(--tx); }
.pe-ops button:disabled { opacity: .25; }
.pe-no { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--tx2); }
.pe-src { font-size: 11px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.pe-add { display: block; margin: 0 12px 12px; width: calc(100% - 24px); padding: 12px; border: 2px dashed var(--line); border-radius: 12px; color: var(--tx2); font-weight: 600; }
.pe-add:hover { border-color: var(--ac); color: var(--ac); }
.pe-drop { position: fixed; inset: 0; z-index: 77; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 82%, transparent); border: 4px dashed var(--ac); font-size: 22px; font-weight: 700; }

/* 페이지 편집 화면 */
body.pe-lock { overflow: hidden; }
.pe-ed { position: fixed; inset: 0; z-index: 76; display: flex; flex-direction: column; background: var(--bg3); }
.pe-edh { flex: none; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px max(10px, env(safe-area-inset-left)) 0; padding-top: max(8px, env(safe-area-inset-top)); }
.pe-edrow { display: flex; align-items: center; gap: 6px; }
.pe-edpage { min-width: 74px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.pe-tools { display: flex; gap: 4px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.pe-tools::-webkit-scrollbar { display: none; }
.pe-tools button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 62px; padding: 6px 8px; border-radius: 10px; font-size: 12px; color: var(--tx2); }
.pe-tools button:hover { background: var(--bg2); color: var(--tx); }
.pe-tools b { display: grid; place-items: center; height: 22px; font: 700 17px/1 var(--glyph); color: var(--tx); }
.pe-tools .sw-w, .pe-tools .sw-h { width: 22px; height: 14px; margin: 4px 0; border-radius: 3px; }
.pe-tools .sw-w { background: #fff; border: 1.5px solid var(--tx3); }
.pe-tools .sw-h { background: rgba(255, 214, 0, .55); }
.pe-objbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0; }
.pe-objbar textarea { flex: 1 1 220px; min-width: 0; min-height: 38px; max-height: 96px; padding: 8px 10px; border: 1px solid var(--ac); border-radius: 9px; background: var(--bg); font: 16px/1.35 var(--font); resize: vertical; outline: 0; }
.pe-grp { display: flex; align-items: center; gap: 4px; }
.pe-size { min-width: 40px; text-align: center; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--tx2); }
.pe-sw { width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--line); }
.pe-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ac); }
.pe-edscroll { flex: 1; min-height: 0; overflow: auto; padding: 12px 12px calc(40px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.pe-stage { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); touch-action: pan-x pan-y pinch-zoom; }
.pe-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pe-layer { position: absolute; inset: 0; }
.pe-o { position: absolute; cursor: move; touch-action: none; user-select: none; -webkit-user-select: none; }
.pe-o::after { content: ""; position: absolute; inset: -3px; border: 1.5px dashed transparent; border-radius: 3px; pointer-events: none; }
.pe-o:hover::after { border-color: rgba(47, 91, 234, .55); }
.pe-o.on::after { border: 2px solid #2f5bea; }
.pe-in { position: absolute; left: 50%; top: 50%; transform-origin: 50% 50%; white-space: pre; overflow: visible; }
.pe-in img { display: block; width: 100%; height: 100%; pointer-events: none; }
.pe-h { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: #2f5bea; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); cursor: nwse-resize; display: none; touch-action: none; }
.pe-o.on .pe-h { display: block; }
@media (pointer: coarse) { .pe-h { width: 26px; height: 26px; right: -13px; bottom: -13px; } }

/* 서명 */
.pe-sign { position: fixed; inset: 0; z-index: 78; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .45); }
.pe-signbox { width: min(560px, 100%); display: grid; gap: 12px; padding: 18px; border-radius: 18px; background: var(--bg); box-shadow: var(--shadow); }
.pe-signbox h2 { font-size: 17px; }
.pe-saved { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: var(--bg2); }
.pe-saved img { height: 44px; max-width: 160px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 6px; margin-right: auto; }
.pe-pad { display: block; width: 100%; height: 200px; border-radius: 12px; background: #fff linear-gradient(transparent calc(100% - 52px), #d8dce4 calc(100% - 52px), #d8dce4 calc(100% - 51px), transparent calc(100% - 51px)); border: 1px solid var(--line); touch-action: none; cursor: crosshair; }
.pe-keep { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tx2); }
.pe-keep input { width: 17px; height: 17px; accent-color: var(--ac); }
.pe-signact { display: flex; gap: 8px; align-items: center; }

@media (max-width: 559px) {
  .pe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px; }
  .pe-bar { top: var(--head); }
  .pe-bar2 .pe-sp { display: none; }
  .pe-bar2 .pe-btn { flex: 1 1 auto; height: 34px; padding: 0 8px; font-size: 12.5px; }
  .pe-edpage { min-width: 60px; }
}

/* ---------- 토스트 · 모아 복사 ---------- */
.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-fit, 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); }
  /* 상단바도 본문과 같은 폭(1240px) 안에서 정렬: 로고는 메뉴 왼쪽 끝, 테마 버튼은 본문 오른쪽 끝에 맞춥니다 */
  .top { padding-left: max(12px, calc((100% - 1240px) / 2 + 12px)); padding-right: max(28px, calc((100% - 1240px) / 2 + 28px)); }
  .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 { display: flex; flex-direction: column; overflow-y: auto; }
  a.sbn { margin-top: auto; }
  .side .ng:last-of-type { margin-bottom: 20px; }
  .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; }
}


/* =====================================================================
   애플 기본 앱 스타일 (시스템 설정형 기본 + 떠 있는 복사 바 + 투데이 카드)
   ===================================================================== */
body { background: var(--page); }
.top { background: color-mix(in srgb, var(--page) 80%, transparent); border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
.logo .mark { display: block; border-radius: 0; background: none; box-shadow: 0 1px 3px rgba(0, 60, 150, .25); border-radius: 7px; }
.gsearch { height: 34px; border-radius: 9px; background: var(--fill); }
.gsearch:focus-within { background: var(--bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ac) 30%, transparent); border-color: var(--ac); }

/* 메뉴: 색 사각 아이콘 + 파란 선택 줄 */
.side a:not(.sbn) { gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--tx); font-size: 14.5px; }
.side a:not(.sbn):hover { background: color-mix(in srgb, var(--tx) 6%, transparent); color: var(--tx); }
.side a.on, .side a.on:hover { background: var(--ac); color: var(--ac-tx); font-weight: 600; }
.side .ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--c, #8e8e93); color: #fff; font-size: 14px; font-weight: 700; }
.side a.on .ic { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .7); }
.ng p { padding: 0 8px 4px; font-size: 12px; font-weight: 600; color: var(--tx3); }

/* 검색·분류 바 */
.toolbar { background: color-mix(in srgb, var(--page) 86%, transparent); border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
.search { height: 40px; border-radius: 10px; background: var(--bg); box-shadow: var(--hair); }
.search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ac) 30%, transparent); }
.toggle { height: 40px; border-radius: 10px; border: 0; background: var(--bg); box-shadow: var(--hair); color: var(--tx); }
.toggle[aria-pressed="true"] { background: var(--ac); color: var(--ac-tx); }
.seg { padding: 2px; border-radius: 10px; background: var(--fill); }
.seg button, .seg button:first-child, .seg button:last-child { height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--tx); }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--tx); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.chip { background: var(--bg); color: var(--tx); box-shadow: var(--hair); }
.chip:hover { background: var(--bg); color: var(--ac); }
.chip.on { background: var(--ac); color: var(--ac-tx); box-shadow: none; }

/* 흰 그룹 카드 */
.grid { padding: 8px; border-radius: 14px; background: var(--bg); box-shadow: var(--hair); gap: 4px; }
.cell { background: transparent; border-color: transparent; }
.cell:hover { background: var(--bg2); border-color: transparent; }
.cell.wide, .cell.sl, .grid.ex .cell { background: var(--bg2); }
.cell.wide:hover, .cell.sl:hover, .grid.ex .cell:hover { background: var(--bg3); }
.cell.ok, .cell.ok:hover { background: var(--ac-bg); border-color: var(--ac); }
.recent { padding: 14px 0 0; border: 0; background: transparent; }
.recent .grid { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.recent .cell { flex: 0 1 auto; min-height: 42px; padding: 4px 12px; min-width: 44px; max-width: min(240px, 100%); background: var(--bg2); }
.recent .cell:hover { background: var(--bg3); }
.qa, .stat, .note, .found { background: var(--bg); box-shadow: var(--hair); }
.quick { gap: 6px; }
.card { border: 0; background: var(--bg); box-shadow: var(--hair); }
.card:hover { box-shadow: 0 0 0 1px var(--ac); }
.card .ic, .app .ic { background: var(--c, #8e8e93); color: #fff; font-weight: 700; border-radius: 10px; }
.links a { border: 0; background: var(--bg); box-shadow: var(--hair); color: var(--tx); }
.links a:hover { color: var(--ac); box-shadow: 0 0 0 1px var(--ac); }
.pane, .opts { border: 0; background: var(--bg); box-shadow: var(--hair); }
.pane:focus-within { box-shadow: 0 0 0 2px var(--ac); }
.pane-h { background: var(--bg); border-bottom-color: var(--line); }

/* 표와 FAQ는 iOS 설정처럼 묶은 목록으로 */
.sc { border-collapse: separate; border-spacing: 0; background: var(--bg); border-radius: 12px; box-shadow: var(--hair); overflow: hidden; }
.sc tr { border-top: 0; }
.sc tr + tr > * { border-top: 1px solid var(--line); }
.sc th { padding-left: 16px; }
.sc td { padding-right: 16px; }
.faq details { background: var(--bg); border-bottom: 1px solid var(--line); padding: 0 16px; }
.faq h2 + details { margin-top: 12px; border-radius: 12px 12px 0 0; }
.faq details:last-of-type { border-bottom: 0; border-radius: 0 0 12px 12px; }
.faq h2 + details:last-of-type { border-radius: 12px; }

/* 홈: 투데이 */
.hero { padding-top: 8px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--tx3); }
.hero h1 { font-size: clamp(28px, 6vw, 38px); font-weight: 800; }
.hsearch { border: 0; height: 52px; border-radius: 14px; background: var(--bg); box-shadow: var(--hair), 0 4px 14px rgba(0, 0, 0, .05); }
.hsearch:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ac) 35%, transparent); }
.sugg button { background: var(--bg); color: var(--tx); box-shadow: var(--hair); }
.sugg button:hover { background: var(--bg); color: var(--ac); }
.today { display: grid; gap: 12px; margin-top: 28px; }
.tc { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 20px; transition: transform .15s; }
.tc:hover { transform: translateY(-2px); }
.tc strong { font-size: 20px; line-height: 1.25; font-weight: 800; letter-spacing: -.02em; }
.tc-e { font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.tc-d { font-size: 14px; }
.tc-main { min-height: 230px; background: #0b3b8c; color: #fff; }
.tc-main strong { font-size: clamp(24px, 4vw, 30px); position: relative; z-index: 1; }
.tc-main .tc-e { color: #bcd0f5; }
.tc-main .tc-d { color: #dce6f8; position: relative; z-index: 1; }
.tc-b { margin-top: auto; align-self: flex-start; position: relative; z-index: 1; padding: 6px 18px; border-radius: 99px; background: #fff; color: #0b3b8c; font-size: 14px; font-weight: 700; }
.tc-g { position: absolute; right: 16px; bottom: -30px; font: 200px/1 var(--glyph); color: #2a58a8; pointer-events: none; }
.tc-dark { background: #2c2c2e; color: #fff; }
.tc-dark .tc-e { color: #aeaeb2; }
.tc-dark .tc-d { color: #d1d1d6; }
.tc-light { background: var(--bg); box-shadow: var(--hair); }
.tc-light .tc-e, .tc-light .tc-d { color: var(--tx3); }
.apps { display: grid; grid-template-columns: 1fr; column-gap: 28px; margin-top: 10px; padding: 0 16px; border-radius: 14px; background: var(--bg); box-shadow: var(--hair); }
.app { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.app:last-child { border-bottom: 0; }
.app .ic { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; font: 700 21px var(--glyph); transition: transform .15s; }
.app .tx { display: grid; min-width: 0; flex: 1; }
.app b { font-size: 15px; font-weight: 600; }
.app small { font-size: 13px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-go { flex: none; padding: 6px 16px; border-radius: 99px; background: var(--bg2); color: var(--ac); font-size: 13px; font-weight: 700; }
.app-go:hover { background: var(--ac); color: var(--ac-tx); }
.app:has(.app-go:hover) .ic { transform: scale(1.05); }
@media (min-width: 768px) {
  .today { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
  .tc-main { grid-row: span 2; min-height: 300px; padding: 26px 28px; }
  .apps { grid-template-columns: 1fr 1fr; }
  .app:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
}

/* 떠 있는 복사 바 (유리 캡슐) */
.tray { border: 0; border-radius: 99px; padding: 6px 6px 6px 20px; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(24px) saturate(1.8); -webkit-backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 55%, transparent), 0 0 0 1px rgba(0, 0, 0, .08), 0 12px 32px rgba(0, 0, 0, .18); }
.tray button { height: 40px; border-radius: 99px; padding: 0 18px; }
#tray-clear { width: 40px; padding: 0; }
.toast { border-radius: 99px; }

/* 광고 자리: 승인 전에는 점선 빈 칸, 붙은 뒤에도 같은 높이를 잡아 화면이 밀리지 않게 */
.ad { margin: 32px 0 0; min-height: 100px; }
.ad-mid { min-height: 250px; }
.ad-ph { display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 14px; color: var(--tx3); font-size: 11px; letter-spacing: .08em; }
@media (min-width: 768px) { .ad, .ad-mid { min-height: 120px; } }

/* 배너: 넓은 화면은 메뉴 맨 아래, 좁은 화면은 본문 끝(푸터 바로 위) */
.m-banner { padding: 8px 16px 24px; }
.m-banner a.sbn { margin: 0 auto; }
@media (min-width: 1024px) {
  .side { background: var(--side); border-right-color: color-mix(in srgb, var(--line) 80%, transparent); padding: 16px 10px; }
  .side a:not(.sbn) { padding: 6px 8px; font-size: 14px; }
  .side a.sbn { margin-top: auto; }
  .m-banner { display: none; }
}
@media print { .m-banner, .ad { display: none !important; } }

/* PC 왼쪽 메뉴 숨기기/보이기 */
.only-pc { display: none; }
@media (min-width: 1024px) {
  .only-pc { display: grid; }
  html[data-side="closed"] .shell { grid-template-columns: minmax(0, 1fr); }
  html[data-side="closed"] .side { display: none; }
  html[data-side="closed"] .tray { left: 12px; }
  html[data-side="closed"] .m-banner { display: block; max-width: 1240px; margin: 0 auto; }
}
/* 메뉴 접기 손잡이: 왼쪽 메뉴 경계선의 세로 가운데에 있는 작은 화살표. 닫으면 화면 왼쪽 끝에 붙어 오른쪽 화살표로 바뀜 */
.side-edge { display: none; }
@media (min-width: 1024px) {
  .shell { position: relative; }
  .side-edge { display: block; position: absolute; top: 0; bottom: 0; left: 232px; width: 0; z-index: 5; }
  #side-toggle { position: sticky; top: calc((100vh + var(--head)) / 2 - 12px); display: grid; place-items: center; width: 24px; height: 24px; padding: 0; translate: -50% 0; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--tx3); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); cursor: pointer; transition: color .15s, border-color .15s, box-shadow .15s; }
  #side-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: rotate .2s; }
  #side-toggle:hover, #side-toggle:focus-visible { color: var(--ac); border-color: var(--ac); box-shadow: 0 2px 8px color-mix(in srgb, var(--ac) 25%, transparent); }
  html[data-side="closed"] .side-edge { left: 0; }
  html[data-side="closed"] #side-toggle { top: calc((100vh + var(--head)) / 2 - 16px); translate: 0 0; width: 22px; height: 32px; border-radius: 0 10px 10px 0; border-left: 0; }
  html[data-side="closed"] #side-toggle svg { rotate: 180deg; }
}

/* 검색으로 들어온 기호 표시: 링이 세 번 퍼지고 "누르면 복사" 꼬리표 */
.cell.mark { position: relative; z-index: 1; background: var(--ac-bg); border-color: var(--ac); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ac) 35%, transparent); animation: kk-ping 1.2s ease-out 3; scroll-margin: 160px; }
.mark-tip { position: absolute; left: 50%; top: -12px; translate: -50% 0; padding: 2px 8px; border-radius: 99px; background: var(--ac); color: var(--ac-tx); font: 700 11px/1.6 var(--font); white-space: nowrap; pointer-events: none; }
.cell:not(.mark) .mark-tip { display: none; }
.cell.mark.ok .mark-tip { display: none; }
.grid:has(.cell.mark) { overflow: visible; }
.grid.big { padding-top: 18px; }
@keyframes kk-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ac) 55%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
@media (prefers-reduced-motion: reduce) { .cell.mark { animation: none; } }

/* 기호 칸: 한 장의 카드 대신 칸마다 테두리 있는 타일 (한눈에 칸이 구분되도록) */
.grid { padding: 0; background: transparent; box-shadow: none; gap: 10px; border-radius: 0; }
.cell, .cell.wide, .cell.sl, .grid.ex .cell { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.cell:hover, .cell.wide:hover, .cell.sl:hover, .grid.ex .cell:hover { background: var(--bg); border-color: var(--ac); box-shadow: 0 2px 10px color-mix(in srgb, var(--ac) 14%, transparent); }
.cell.ok, .cell.ok:hover { background: var(--ac-bg); border-color: var(--ac); }
.cell.mark { border-color: var(--ac); }
.grid.big { padding-top: 14px; }
.recent .grid { gap: 8px; }
.recent .cell { background: var(--bg); }
@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .grid:not(#recent) .cell:not(.wide):not(.sl) { min-height: 96px; }
}


/* =====================================================================
   Stitch 시안에서 가져온 점: 테두리로 나눈 표면, 따로 떨어진 FAQ 카드,
   검색 버튼, 신뢰 배지, OS 전환 탭, 북마크 안내, AD 표시 광고 자리
   ===================================================================== */
/* 자주 묻는 질문: 질문마다 테두리 카드 */
.faq details, .faq h2 + details, .faq details:last-of-type, .faq h2 + details:last-of-type { margin-top: 8px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.faq h2 + details { margin-top: 14px; }
.faq details[open] { border-color: color-mix(in srgb, var(--ac) 40%, var(--line)); }
.faq summary { padding: 15px 0; }

/* 표면: 그림자 대신 테두리 */
.qa, .stat, .note, .found, .card, .links a, .sugg button, .chip, .search, .tc-light, .apps, .sc, .pane, .opts { box-shadow: none; border: 1px solid var(--line); }
.chip.on { border-color: var(--ac); }
.card:hover, .links a:hover { border-color: var(--ac); box-shadow: none; }
.search:focus-within, .pane:focus-within { border-color: var(--ac); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ac) 18%, transparent); }
.toggle { box-shadow: none; border: 1px solid var(--line); }
.toggle[aria-pressed="true"] { border-color: var(--ac); }

/* 홈 검색: 오른쪽 "바로 찾기" 버튼 */
.hsearch { border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0, 0, 0, .04); padding-right: 6px; }
.hsearch:focus-within { border-color: var(--ac); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ac) 20%, transparent); }
.hs-go { flex: none; height: 40px; padding: 0 16px; border-radius: 10px; background: var(--ac); color: var(--ac-tx); font-size: 14px; font-weight: 700; }
.hs-go:hover { filter: brightness(1.08); }

/* 신뢰 배지: 홈 히어로 + 파일·글을 다루는 도구 */
.badges { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 14px 0 0; }
.badges li, .trust { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); font-size: 12.5px; font-weight: 600; color: var(--tx2); }
.badges svg, .trust svg { width: 14px; height: 14px; color: var(--ok); }
.trust { margin-top: 10px; }

/* 맥/윈도우 전환 탭 */
.os-sw { display: inline-flex; margin-top: 16px; padding: 3px; gap: 2px; border-radius: 11px; background: var(--fill); border: 1px solid var(--line); }
.os-sw a { padding: 6px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--tx2); }
.os-sw a:hover { color: var(--tx); }
.os-sw a[aria-current] { background: var(--bg); color: var(--ac); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* 상단 북마크 안내 (PC) */
.bm { align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); font: 600 12px var(--mono); color: var(--tx2); white-space: nowrap; cursor: pointer; }
.bm:hover { border-color: var(--ac); color: var(--tx); }
.bm svg { width: 13px; height: 13px; color: var(--ac); }
@media (min-width: 1024px) { .bm.only-pc { display: inline-flex; } }

/* 광고 자리: AD 표시가 붙은 테두리 상자 */
.ad-ph { position: relative; border: 1px solid var(--line); border-style: solid; background: color-mix(in srgb, var(--bg) 55%, var(--page)); color: var(--tx3); }
.ad-ph span { position: absolute; left: 12px; top: 10px; padding: 1px 6px; border-radius: 4px; background: var(--fill); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.ad-ph::after { content: "광고 자리"; font-size: 12px; }

/* 자사 광고(서바이벌 스피너): 그림 비율대로 높이가 정해지고, 테마에 맞는 그림 한 장만 보임 */
.ad.ad-house { min-height: 0; }
.ad-house a { position: relative; display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; }
.ad-house a:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(40, 60, 120, .18); }
.ad-house img { display: block; width: 100%; height: auto; }
.ah-dark { display: none; }
:root[data-theme="dark"] .ah-light { display: none; }
:root[data-theme="dark"] .ah-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ah-light { display: none; }
  :root:not([data-theme="light"]) .ah-dark { display: block; }
}
.ah-l { position: absolute; right: 6px; top: 5px; z-index: 1; padding: 0 5px; border-radius: 4px; font-size: 10px; line-height: 1.6; font-weight: 700; background: rgba(255, 255, 255, .82); color: rgba(43, 47, 58, .75); }
@media (prefers-reduced-motion: reduce) { .ad-house a { transition: none; } .ad-house a:hover { transform: none; } }

/* =====================================================================
   상단 헤더 메뉴 + 펼침 메뉴 + 분류별 왼쪽 보조 메뉴 (PC 1024px 이상)
   ===================================================================== */
.gnb, .mega { display: none; }
.mega[hidden] { display: none !important; }
.lnb-sub { display: none; }
@media (min-width: 1024px) {
  .logo { margin-right: 0; }
  .gnb { display: flex; align-items: center; gap: 2px; margin: 0 auto 0 22px; }
  .gnb-b { display: inline-flex; align-items: center; gap: 3px; height: 34px; padding: 0 12px; border-radius: 9px; font-size: 14.5px; font-weight: 600; color: var(--tx2); }
  .gnb-b svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .6; transition: rotate .15s; }
  .gnb-b:hover, .gnb-b[aria-expanded="true"] { background: color-mix(in srgb, var(--tx) 6%, transparent); color: var(--tx); }
  .gnb-b[aria-expanded="true"] svg { rotate: 180deg; }
  .gnb-b.on { color: var(--ac); }
  .gsearch { width: min(300px, 24vw); }

  .mega { display: block; position: fixed; z-index: 39; top: var(--head); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0, 0, 0, .12); }
  .mega-in { max-width: 1240px; margin: 0 auto; padding: 18px 28px 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .mg .mg-h { margin: 0; padding: 0 8px 6px; font-size: 12px; font-weight: 700; color: var(--tx3); }
  .mega[data-g="copy"] .mg[data-g="copy"] .mg-h, .mega[data-g="keys"] .mg[data-g="keys"] .mg-h, .mega[data-g="docs"] .mg[data-g="docs"] .mg-h { color: var(--ac); }
  .mg-t { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; }
  .mg-t:hover { background: var(--bg2); }
  .mg-t .ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--c); color: #fff; font: 700 15px var(--glyph); }
  .mg-t span:last-child { display: grid; min-width: 0; }
  .mg-t b { font-size: 14.5px; font-weight: 600; }
  .mg-t small { font-size: 12px; color: var(--tx3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mg-s { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 0 8px 6px 48px; font-size: 12.5px; }
  .mg-s a { color: var(--tx2); }
  .mg-s a:hover { color: var(--ac); text-decoration: underline; }

  /* 홈·소개처럼 분류가 없는 페이지는 왼쪽 메뉴 없이 전체 폭 */
  .no-lnb .shell { grid-template-columns: minmax(0, 1fr); }
  .no-lnb .side, .no-lnb .side-edge { display: none !important; }
  .no-lnb .tray { left: 12px; }
  .no-lnb .m-banner { display: block; max-width: 1240px; margin: 0 auto; }
  /* 도구 페이지: 현재 분류의 도구와 그 하위 페이지만 */
  .side .home, .side .ng:not(.cur) { display: none; }
  .side .ng.cur { margin-top: 0; }
  .side .ng.cur > p { padding-bottom: 8px; font-size: 13px; color: var(--tx2); }
  .lnb-sub { display: grid; gap: 1px; margin: 2px 0 8px 20px; padding-left: 10px; border-left: 1px solid var(--line); }
  .side .lnb-sub a { padding: 4px 8px; font-size: 13px; color: var(--tx2); border-radius: 6px; }
  .side .lnb-sub a:hover { color: var(--tx); }
  .side .lnb-sub a.on, .side .lnb-sub a.on:hover { background: var(--ac-bg); color: var(--ac); font-weight: 700; }
}

/* 페이지 끝 최종 업데이트 */
.upd { margin-top: 28px; font-size: 12.5px; color: var(--tx3); }

/* =====================================================================
   홈 위젯 보드
   ===================================================================== */
:root { --up: #d70015; --down: #0060df; }
:root[data-theme="dark"] { --up: #ff6961; --down: #64a8ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --up: #ff6961; --down: #64a8ff; } }

.dash { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 4px; }
.w { display: flex; flex-direction: column; min-width: 0; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--bg); }
.w[hidden], .trend[hidden] { display: none; }
.w-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.w-h h2 { font-size: 13px; font-weight: 700; color: var(--tx3); letter-spacing: 0; }
.w-src { font-size: 11px; color: var(--tx3); }
p.w-src { margin-top: auto; padding-top: 10px; }
.w-wait { font-size: 13px; color: var(--tx3); }
.w-btn { height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); font-size: 12px; font-weight: 600; color: var(--tx2); }
.w-btn:hover, .w-btn[aria-expanded="true"], .w-btn.on { border-color: var(--ac); color: var(--ac); }
.w .more { font-size: 12.5px; color: var(--ac); font-weight: 600; }

/* 시계 · 퇴근 카운트다운 */
.w-clock { border: 0; background: linear-gradient(155deg, #0b3b8c 0%, #1556c4 100%); color: #fff; }
.w-clock .w-h h2 { color: #cfe0ff; }
.w-clock .w-btn { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .28); color: #fff; }
.w-clock .w-btn:hover, .w-clock .w-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .22); border-color: #fff; }
.clock { margin: 4px 0 10px; font-size: clamp(56px, 8vw, 84px); font-weight: 800; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.clock small { margin-left: 8px; font-size: .3em; font-weight: 600; letter-spacing: 0; opacity: .65; }
.cd { min-height: 1.5em; margin-bottom: 14px; font-size: 16px; color: #dce6f8; }
.cd b { color: #fff; font-weight: 800; }
.bar { height: 6px; margin-top: auto; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .18); }
.bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: #fff; transition: width .6s; }
.bar-l { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: #bcd0f5; }
.ws { display: grid; gap: 10px; margin-top: 14px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .1); font-size: 13px; }
.ws[hidden] { display: none; }
.ws label { display: flex; align-items: center; gap: 8px; }
.ws input[type="time"] { height: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: #fff; color: #1d1d1f; font: inherit; }
.ws .ws-c { align-items: flex-start; line-height: 1.4; }
.ws .ws-c input { margin-top: 2px; }
.ws button { justify-self: start; }

/* 검색 · 지금 많이 찾는 검색어 */
.w-search h1 { font-size: clamp(22px, 3vw, 28px); font-weight: 800; line-height: 1.25; letter-spacing: -.03em; }
.w-search h1 em { font-style: normal; color: var(--ac); }
.w-search .hsearch { max-width: none; margin-top: 12px; }
.w-search .sugg { margin-top: 10px; }
.w-search .sugg button { padding: 4px 10px; font-size: 12.5px; }
.trend { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.trend-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; list-style: none; margin: 0; padding: 0; }
.trend-list li { display: flex; align-items: center; gap: 8px; min-width: 0; height: 30px; font-size: 14px; }
.trend-list .n { flex: none; width: 22px; white-space: nowrap; text-align: center; font-weight: 800; color: var(--ac); font-variant-numeric: tabular-nums; }
.trend-list a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-list a:hover { color: var(--ac); text-decoration: underline; }
.trend-list small { flex: none; margin-left: auto; font-size: 11px; color: var(--tx3); }
.trend-list .sk { flex: 1; height: 10px; border-radius: 4px; background: var(--fill); }
.trend-list .w-wait { grid-column: 1 / -1; }

/* 날씨 */
#city { height: 28px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--tx); font: inherit; font-size: 12.5px; }
.wx { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; min-height: 96px; }
.wx > .w-wait { grid-column: 1 / -1; }
.wx-i { grid-row: span 2; width: 54px; height: 54px; fill: none; stroke: var(--ac); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wx-t { font-size: 42px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.wx-t span { font-weight: 500; color: var(--tx3); }
.wx-l { display: grid; gap: 2px; font-size: 12.5px; color: var(--tx3); }
.wx-l b { font-size: 15px; color: var(--tx); }

/* 환율 */
.fx { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.fx th { padding: 6px 0; text-align: left; font-weight: 400; white-space: nowrap; }
.fx th b { margin-right: 6px; font-weight: 700; }
.fx th small { font-size: 11.5px; color: var(--tx3); }
.fx td { padding: 6px 0 6px 8px; text-align: right; font-weight: 600; white-space: nowrap; }
.fx td:last-child { width: 72px; font-size: 11.5px; font-weight: 500; color: var(--tx3); }
.fx td.up { color: var(--up); }
.fx td.down { color: var(--down); }
.fx tr + tr th, .fx tr + tr td { border-top: 1px solid var(--line); }

/* 다음 공휴일 */
.hol-d { font-size: 36px; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--ac); }
.hol-n { display: grid; margin-top: 8px; }
.hol-n b { font-size: 16px; }
.hol-n span { font-size: 13px; color: var(--tx3); }
.hol-l { display: grid; gap: 4px; margin: 12px 0 0; padding: 10px 0 0; list-style: none; border-top: 1px solid var(--line); font-size: 12.5px; }
.hol-l li { display: flex; justify-content: space-between; gap: 8px; color: var(--tx2); }
.hol-l li span:last-child { flex: none; color: var(--tx3); }

/* 도구 바로가기 */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 2px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 2px; border-radius: 12px; text-align: center; font-size: 12px; line-height: 1.25; color: var(--tx2); }
.tile:hover { background: var(--bg2); color: var(--tx); }
.tile .ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--c); color: #fff; font: 700 18px var(--glyph); transition: transform .15s; }
.tile:hover .ic { transform: scale(1.06); }

/* 자주 복사하는 문자 */
.w-copy .grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.w-copy .recent { margin-top: 8px; }


/* 위젯 켜고 끄기 */
.dash-tools { position: relative; display: flex; justify-content: flex-end; margin-top: 10px; }
.we { position: absolute; z-index: 5; top: 34px; right: 0; display: grid; gap: 8px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); box-shadow: var(--shadow); font-size: 13px; }
.we[hidden] { display: none; }
.we label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

/* 검색하는 동안: 검색 칸만 남기고 결과를 바로 아래에 */
.searching .dash > .w:not(.w-search), .searching .dash-tools, .searching .trend { display: none; }
.results:not([hidden]) { margin-top: 16px; }

.intro .keep { margin-top: 12px; font-size: 13px; color: var(--tx3); }
.intro .keep b { color: var(--tx2); }

@media (min-width: 560px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-clock, .w-search, .w-copy, .w-tools { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .dash { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: row dense; }
  .w-clock { grid-column: span 5; padding: 20px 22px; }
  .w-search { grid-column: span 7; padding: 20px 22px; }
  .w-weather, .w-fx, .w-hol, .w-tools { grid-column: span 4; }
  .w-copy { grid-column: span 8; }
  .searching .w-search { grid-column: 1 / -1; }
  .w-tools .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .w-tools .tile { padding: 6px 2px; font-size: 11.5px; }
  .w-tools .tile .ic { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
}
@media (prefers-reduced-motion: reduce) { .bar span, .tile .ic, .gnb-b svg { transition: none; } }
@media print { .gnb, .mega, .dash, .dash-tools { display: none !important; } }
@media (max-width: 559px) { .trend-list small { display: none; } .trend-list { gap: 0 12px; } }

/* =====================================================================
   노션 톤 (2026-11-29): 흰 바탕 + 따뜻한 회색, 선택은 회색 강조, 파랑은 주요 버튼·링크에만,
   아이콘은 연한 색 배경 + 진한 글자, 작은 모서리, 그림자 최소. 이 층이 위의 색을 덮어씁니다.
   ===================================================================== */
:root {
  --bg: #fff; --bg2: #f7f7f5; --bg3: #efefed; --line: #e9e9e7; --tx: #37352f; --tx2: #5f5e5b; --tx3: #91918e;
  --ac: #2383e2; --ac-tx: #fff; --ac-bg: #e7f3f8; --ok: #448361; --mark: #fbf3db; --shadow: 0 4px 18px rgba(15, 15, 15, .1);
  --page: #fff; --side: #f7f7f5; --fill: #f1f1ef; --hover: rgba(55, 53, 47, .06); --sel: rgba(55, 53, 47, .08);
  --hair: 0 0 0 1px var(--line); --r: 8px; --up: #e03e3e; --down: #0b6e99;
}
:root[data-theme="dark"] {
  --bg: #191919; --bg2: #202020; --bg3: #2a2a2a; --line: #2f2f2f; --tx: #e3e3e1; --tx2: #b4b4b0; --tx3: #7f7f7c;
  --ac: #529cca; --ac-tx: #fff; --ac-bg: #1f2d38; --ok: #4dab9a; --mark: #3f3520; --shadow: 0 4px 18px rgba(0, 0, 0, .45);
  --page: #191919; --side: #202020; --fill: #262626; --hover: rgba(255, 255, 255, .055); --sel: rgba(255, 255, 255, .08);
  --up: #ff7369; --down: #529cca;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191919; --bg2: #202020; --bg3: #2a2a2a; --line: #2f2f2f; --tx: #e3e3e1; --tx2: #b4b4b0; --tx3: #7f7f7c;
    --ac: #529cca; --ac-tx: #fff; --ac-bg: #1f2d38; --ok: #4dab9a; --mark: #3f3520; --shadow: 0 4px 18px rgba(0, 0, 0, .45);
    --page: #191919; --side: #202020; --fill: #262626; --hover: rgba(255, 255, 255, .055); --sel: rgba(255, 255, 255, .08);
    --up: #ff7369; --down: #529cca;
  }
}
body { background: var(--page); }
.top { background: color-mix(in srgb, var(--page) 92%, transparent); border-bottom-color: var(--line); }

/* 아이콘: 진한 색 사각형 대신 연한 색 바탕에 색 글자 */
.ic[style], .side .ic, .app .ic, .tile .ic, .mg-t .ic {
  background: color-mix(in srgb, var(--c, #91918e) 13%, var(--bg)) !important;
  color: color-mix(in srgb, var(--c, #91918e) 78%, var(--tx)) !important;
  box-shadow: none !important;
}
.side a.on .ic { box-shadow: none; }

/* 선택 상태: 파란 채움 → 회색 강조 + 굵은 글자 */
.side a.on, .side a.on:hover { background: var(--sel); color: var(--tx); font-weight: 600; }
.side a:not(.sbn):hover, .gnb-b:hover, .gnb-b[aria-expanded="true"], .mg-t:hover, .tile:hover { background: var(--hover); }
.side .lnb-sub a.on, .side .lnb-sub a.on:hover { background: var(--sel); color: var(--tx); }
.gnb-b.on { color: var(--tx); box-shadow: inset 0 -2px 0 var(--tx); border-radius: 0; }
.chip.on, .toggle[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--tx); border-color: var(--tx); color: var(--bg); }
.chip, .sugg button, .badges li, .trust { border-radius: 6px; }
.sugg button { background: var(--bg); color: var(--tx2); }
.sugg button:hover { background: var(--hover); color: var(--tx); }
.app-go { background: var(--bg2); color: var(--tx); border-radius: 6px; }
.app-go:hover { background: var(--sel); color: var(--tx); }
.mega[data-g="copy"] .mg[data-g="copy"] .mg-h, .mega[data-g="keys"] .mg[data-g="keys"] .mg-h, .mega[data-g="docs"] .mg[data-g="docs"] .mg-h { color: var(--tx); }

/* 카드·칸: 작은 모서리, 그림자 없이 얇은 선 */
.cell, .cell.wide, .cell.sl, .grid.ex .cell { border-radius: 6px; }
.cell:hover, .cell.wide:hover, .cell.sl:hover, .grid.ex .cell:hover { background: var(--hover); border-color: var(--line); box-shadow: none; }
.cell.ok, .cell.ok:hover { background: var(--ac-bg); border-color: var(--ac); }
.grid, .apps, .card, .qa, .stat, .found, .pane, .opts, .faq details, .sc { border-radius: 8px; box-shadow: none; }
.hsearch { height: 48px; border-radius: 8px; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15, 15, 15, .04); }
.hsearch:focus-within { border-color: var(--ac); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ac) 18%, transparent); }
.hs-go { height: 36px; border-radius: 6px; font-weight: 600; }
.gsearch { border-radius: 6px; background: var(--fill); }
.ad-house a, .ad-ph { border-radius: 8px; }
.ad-house a:hover { transform: none; box-shadow: none; }
.bm { border-radius: 6px; }

/* 홈 위젯 */
.w { border-radius: 10px; }
.w-h h2 { font-size: 12.5px; font-weight: 600; color: var(--tx3); }
.w-btn { border-radius: 6px; }
.w-btn:hover, .w-btn[aria-expanded="true"], .w-btn.on { border-color: var(--line); background: var(--hover); color: var(--tx); }
.w-search h1 { font-weight: 700; }
.w-search h1 em { color: inherit; background: linear-gradient(transparent 62%, color-mix(in srgb, var(--ac) 22%, transparent) 0); }
.w-clock { background: var(--bg); color: var(--tx); border: 1px solid var(--line); }
.w-clock .w-h h2 { color: var(--tx3); }
.w-clock .w-btn { background: var(--bg); border-color: var(--line); color: var(--tx2); }
.w-clock .w-btn:hover, .w-clock .w-btn[aria-expanded="true"] { background: var(--hover); border-color: var(--line); color: var(--tx); }
.clock { font-weight: 700; }
.clock small { color: var(--tx3); opacity: 1; }
.cd { color: var(--tx2); }
.cd b { color: var(--tx); font-weight: 700; }
.bar { height: 4px; background: var(--fill); }
.bar span { background: var(--ac); }
.bar-l { color: var(--tx3); }
.ws { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; }
.ws input[type="time"] { border: 1px solid var(--line); background: var(--bg); color: var(--tx); border-radius: 6px; }
.trend-list .n { color: var(--tx3); font-weight: 600; }
.trend-list li:nth-child(-n+3) .n { color: var(--ac); }
.wx-i { stroke: var(--tx2); }
.wx-t, .hol-d, .clock { letter-spacing: -.03em; }
.hol-d { color: var(--tx); font-weight: 700; }
#city { border-radius: 6px; }

/* =====================================================================
   브랜드 초록 (새 아이콘에 맞춤) + 홈 2차 배치: 핵심 문구와 검색을 맨 위 전체 폭으로
   ===================================================================== */
:root { --ac: #1d6b4c; --ac-bg: #e8f3ee; --brand: #0b3d2c; }
:root[data-theme="dark"] { --ac: #5cb88f; --ac-bg: #1c2b24; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ac: #5cb88f; --ac-bg: #1c2b24; } }
.logo .mark { box-shadow: none; border-radius: 7px; }

.ws-main { min-width: 0; }
.w-search { padding: 22px 18px; }
.w-search h1 { font-size: clamp(27px, 6.4vw, 42px); line-height: 1.2; letter-spacing: -.035em; }
.w-search .hsearch { height: 56px; margin-top: 16px; }
.w-search .hsearch input { font-size: 17px; }
.w-search .hs-go { height: 42px; padding: 0 20px; font-size: 15px; }
body[data-page="home"] .m-banner { display: none !important; }
@media (min-width: 1024px) {
  .w-search { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 0 32px; padding: 30px 30px 26px; }
  .w-search .trend { margin-top: 0; padding: 0 0 0 30px; border-top: 0; border-left: 1px solid var(--line); }
  .w-tools { grid-column: 1 / -1; }
  .w-tools .tiles { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .w-clock, .w-weather, .w-fx, .w-hol { grid-column: span 4; }
  .w-clock { padding: 16px; }
  .w-copy { grid-column: span 8; }
  .clock { font-size: clamp(52px, 4.6vw, 68px); }
}
.w-search h1 em { display: inline-block; margin-top: 2px; }
.w-search h1 .br { display: block; height: 0; }
@media (min-width: 1024px) { .w-search h1 { font-size: clamp(32px, 3.2vw, 44px); } }
@media (max-width: 1023px) { .w-tools .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* =====================================================================
   앱 느낌 + 모눈종이 작업대 (2026-11-29)
   바탕은 옅은 모눈종이, 홈 위젯은 그 위에 붙인 흰 메모지(모두 같은 색, 테이프 없음). 헤더는 촘촘하게, 상단 메뉴는 세그먼트 버튼.
   도구 페이지는 모눈 바탕 위에 흰 종이 한 장(본문)을 올린 형태.
   ===================================================================== */
:root {
  --head: 52px;
  --paper: #fff;   --grid-bg: #f8f8f6; --grid-1: rgba(55, 53, 47, .055); --grid-2: rgba(55, 53, 47, .09);
  --note-shadow: 0 1px 1px rgba(15, 15, 15, .04), 0 8px 18px -10px rgba(15, 15, 15, .18);
}
:root[data-theme="dark"] {
  --paper: #1f1f1f;   --grid-bg: #151515; --grid-1: rgba(255, 255, 255, .035); --grid-2: rgba(255, 255, 255, .06);
  --note-shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 10px 22px -12px rgba(0, 0, 0, .7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1f1f1f;     --grid-bg: #151515; --grid-1: rgba(255, 255, 255, .035); --grid-2: rgba(255, 255, 255, .06);
    --note-shadow: 0 1px 1px rgba(0, 0, 0, .3), 0 10px 22px -12px rgba(0, 0, 0, .7);
  }
}

/* 모눈 바탕: 8px 잔눈 + 40px 굵은 눈 */
body {
  background-color: var(--grid-bg);
  background-image:
    linear-gradient(var(--grid-2) 1px, transparent 1px), linear-gradient(90deg, var(--grid-2) 1px, transparent 1px),
    linear-gradient(var(--grid-1) 1px, transparent 1px), linear-gradient(90deg, var(--grid-1) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px;
  background-position: -1px -1px;
  background-attachment: fixed;
}

/* 헤더: 촘촘한 앱 상단바 */
.top { background: color-mix(in srgb, var(--paper) 90%, transparent); box-shadow: 0 1px 0 var(--line); border-bottom: 0; }
@media (min-width: 1024px) {
  .gnb { gap: 2px; padding: 3px; border-radius: 9px; background: var(--fill); }
  .gnb-b, .gnb-b.on { height: 28px; padding: 0 12px; border-radius: 6px; font-size: 13.5px; box-shadow: none; }
  .gnb-b:hover, .gnb-b[aria-expanded="true"] { background: color-mix(in srgb, var(--paper) 60%, transparent); }
  .gnb-b.on { background: var(--paper); color: var(--tx); box-shadow: 0 1px 2px rgba(15, 15, 15, .1), 0 0 0 .5px var(--line); }
  .mega { top: var(--head); border-radius: 0 0 12px 12px; background: var(--paper); }
  /* 도구 페이지: 사이드는 반투명 패널, 본문은 흰 종이 한 장 */
  .side { background: color-mix(in srgb, var(--side) 86%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
  .has-lnb main { margin: 16px 20px 32px; padding: 26px 30px 56px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--note-shadow); }
}
@media (max-width: 1023px) {
  .has-lnb main { background: var(--paper); }
}
.toolbar { background: color-mix(in srgb, var(--paper) 94%, transparent); }

/* 홈 위젯 = 메모지 */
.w { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--note-shadow); }
.w-h h2 { text-transform: none; letter-spacing: 0; }
/* 기본 메모지: 상단에 옅은 줄 하나 */
.w-clock, .w-weather, .w-fx, .w-hol, .w-copy { background-image: linear-gradient(var(--paper), var(--paper)); }
.w-clock .w-h, .w-weather .w-h, .w-fx .w-h, .w-hol .w-h, .w-copy .w-h, .w-tools .w-h { padding-bottom: 8px; border-bottom: 1px dashed var(--line); margin-bottom: 10px; }
.dash { gap: 16px; }
.dash-tools { margin-top: 10px; }

/* 홈 아래쪽 섹션도 종이 위에 */
body[data-page="home"] #home-body > section, body[data-page="home"] #home-body > .faq,
body[data-page="home"] #results { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--note-shadow); padding: 20px; margin-top: 16px; }
.foot { background: transparent; }

@media print { body { background: #fff; } }

/* =====================================================================
   디자인 시스템 v1 (2026-11-29) — 기준 문서: docs/DESIGN.md
   브랜드: 포레스트(진초록) + 크림 + 라임(포인트). 이 층이 위의 모든 색을 덮어씁니다.
   새 색은 여기 토큰에만 추가하고, 컴포넌트에는 var(--토큰)만 씁니다.
   ===================================================================== */
:root {
  /* 브랜드 원색 (아이콘과 같은 값) */
  --brand: #025421; --brand-deep: #013516; --cream: #fcf6e5; --lime: #bffc13; --lime-soft: #ebfdb5;
  /* 역할 토큰: 라이트 */
  --page: #faf8f1; --grid-bg: #faf8f1; --paper: #fff; --bg: #fff; --bg2: #f6f4ee; --bg3: #eeebe3; --side: #f4f2ea; --fill: #f0eee6;
  --line: #e8e5dc; --tx: #26251f; --tx2: #58564e; --tx3: #8f8c82;
  --hover: rgba(38, 37, 31, .055); --sel: rgba(2, 84, 33, .08);
  --ac: var(--brand); --ac-hover: var(--brand-deep); --ac-tx: var(--cream); --ac-bg: #e6f0e2; --ok: var(--brand);
  --hl: var(--lime); --mark: var(--lime-soft); --up: #d93b30; --down: #1f6fb2;
  --grid-1: rgba(2, 84, 33, .045); --grid-2: rgba(2, 84, 33, .08);
  /* 모양 */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-card: 8px; --r-icon: 22.6%;
  --sh-card: 0 1px 1px rgba(20, 30, 20, .04), 0 8px 18px -10px rgba(20, 30, 20, .18);
  --sh-pop: 0 18px 40px -12px rgba(20, 30, 20, .22);
  --ring: 0 0 0 3px color-mix(in srgb, var(--ac) 22%, transparent);
  --note-shadow: var(--sh-card);
}
:root[data-theme="dark"] {
  --page: #141513; --grid-bg: #141513; --paper: #1c1d1a; --bg: #1c1d1a; --bg2: #22231f; --bg3: #2a2b26; --side: #191a17; --fill: #262722;
  --line: #2e2f29; --tx: #e8e7e1; --tx2: #b5b4ac; --tx3: #85847c;
  --hover: rgba(255, 255, 255, .05); --sel: rgba(191, 252, 19, .09);
  --ac: var(--lime); --ac-hover: #d4ff5c; --ac-tx: var(--brand-deep); --ac-bg: #1f2912; --ok: var(--lime);
  --hl: rgba(191, 252, 19, .3); --mark: rgba(191, 252, 19, .22); --up: #ff7a6e; --down: #6fb2ff;
  --grid-1: rgba(255, 255, 255, .03); --grid-2: rgba(255, 255, 255, .055);
  --sh-card: 0 1px 1px rgba(0, 0, 0, .3), 0 10px 22px -12px rgba(0, 0, 0, .7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #141513; --grid-bg: #141513; --paper: #1c1d1a; --bg: #1c1d1a; --bg2: #22231f; --bg3: #2a2b26; --side: #191a17; --fill: #262722;
    --line: #2e2f29; --tx: #e8e7e1; --tx2: #b5b4ac; --tx3: #85847c;
    --hover: rgba(255, 255, 255, .05); --sel: rgba(191, 252, 19, .09);
    --ac: var(--lime); --ac-hover: #d4ff5c; --ac-tx: var(--brand-deep); --ac-bg: #1f2912; --ok: var(--lime);
    --hl: rgba(191, 252, 19, .3); --mark: rgba(191, 252, 19, .22); --up: #ff7a6e; --down: #6fb2ff;
    --grid-1: rgba(255, 255, 255, .03); --grid-2: rgba(255, 255, 255, .055);
    --sh-card: 0 1px 1px rgba(0, 0, 0, .3), 0 10px 22px -12px rgba(0, 0, 0, .7);
  }
}

/* 기본 상호작용 */
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
::selection { background: var(--mark); }
.hsearch:focus-within { border-color: var(--ac); box-shadow: var(--ring); }

/* 주요 버튼: 포레스트 바탕 + 크림 글자 (다크: 라임 바탕 + 진초록 글자) */
.hs-go, .pane-h button.primary, .gv-btn.primary, .pe-btn.primary, #tray-copy, .skip { background: var(--ac); border-color: var(--ac); color: var(--ac-tx); }
.hs-go:hover, .pane-h button.primary:hover, .gv-btn.primary:hover, .pe-btn.primary:hover, #tray-copy:hover { background: var(--ac-hover); border-color: var(--ac-hover); }
/* 선택된 칩·토글: 같은 주요색 */
.chip.on, .toggle[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--ac); border-color: var(--ac); color: var(--ac-tx); }
.app-go:hover { background: var(--ac); color: var(--ac-tx); }
.mark-tip, .pe-badge { background: var(--ac); color: var(--ac-tx); }
/* 선택 상태(메뉴): 연한 초록 */
.side a.on, .side a.on:hover, .side .lnb-sub a.on, .side .lnb-sub a.on:hover { background: var(--sel); color: var(--tx); }
.cell.ok, .cell.ok:hover { background: var(--ac-bg); border-color: var(--ac); }

/* 포인트(라임): 핵심 문구 밑줄, 진행 막대, 상위 검색어 번호 배지 */
.w-search h1 em { background: linear-gradient(transparent 68%, var(--hl) 0 92%, transparent 0); }
.bar span { background: var(--ac); }
.trend-list li:nth-child(-n+3) .n { color: var(--ac); }

/* 모양 통일: 카드·패널 8px, 컨트롤 6px */
.w, body[data-page="home"] #home-body > section, body[data-page="home"] #home-body > .faq, body[data-page="home"] #results { border-radius: var(--r-card); box-shadow: var(--sh-card); }
@media (min-width: 1024px) { .has-lnb main { border-radius: var(--r-card); box-shadow: var(--sh-card); } .mega { box-shadow: var(--sh-pop); } }
.chip, .sugg button, .w-btn, #city, .hs-go, .app-go, .bm, .gsearch, .ws input[type="time"] { border-radius: var(--r-sm); }
.hsearch, .grid, .apps, .card, .qa, .stat, .found, .pane, .opts, .faq details, .sc, .ws { border-radius: var(--r-md); }

/* 로고: 앱 아이콘과 같은 그림, 번개 바늘이 움직임 */
.logo .mark.kk-logo { display: block; width: 28px; height: 28px; border-radius: 0; background: none; overflow: visible; }
.kk-zap, .kk-bolt { transform-origin: 31.95px 32.67px; }
.kk-intro .kk-logo .kk-bolt { animation: kk-sweep 1.15s cubic-bezier(.2, .9, .25, 1.15) .2s both, kk-flash .5s ease-out 1.3s both; }
.logo:hover .kk-zap, .logo:focus-visible .kk-zap { animation: kk-zap .5s ease-in-out; }
@keyframes kk-sweep { from { transform: rotate(-320deg) scale(.55); } to { transform: none; } }
@keyframes kk-flash { 0%, 100% { filter: none; } 35% { filter: drop-shadow(0 0 3px var(--lime)) brightness(1.2); } }
@keyframes kk-zap { 0%, 100% { transform: none; } 25% { transform: rotate(-14deg); } 55% { transform: rotate(8deg); } 80% { transform: rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .kk-intro .kk-logo .kk-bolt, .logo:hover .kk-zap { animation: none; } }

/* 상단바 좌우 끝을 본문 카드의 좌우 끝과 같은 선에 맞춤
   - 분류 없는 페이지(홈·소개): 카드가 shell 안쪽 28px
   - 도구 페이지: 로고는 왼쪽 메뉴 항목 시작선(10px), 오른쪽 버튼은 본문 종이 끝(20px) */
@media (min-width: 768px) {
  .top { padding-left: 28px; padding-right: 28px; }
}
@media (min-width: 1024px) {
  .top { --o: max(0px, calc((100% - 1240px) / 2)); padding-left: calc(var(--o) + 28px); padding-right: calc(var(--o) + 28px); }
  .has-lnb .top { padding-left: calc(var(--o) + 10px); padding-right: calc(var(--o) + 20px); }
  html[data-side="closed"] .has-lnb .top { padding-left: calc(var(--o) + 20px); }
}

/* 소개·개인정보처리방침·404: 홈 카드와 같은 종이 카드에 담아 폭 전체를 씀 */
.no-lnb main > article.prose { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--sh-card); padding: 24px 28px 28px; margin-top: 12px; }
@media (max-width: 767px) { .no-lnb main > article.prose { padding: 20px 18px 22px; } }

/* PC: 푸터 3줄을 한 줄로 (사이트명 · 링크 · 저작권) */
@media (min-width: 1024px) {
  .foot { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 0; padding-top: 22px; padding-bottom: 26px; }
  .foot p { margin: 0; }
  .foot p + p::before { content: ""; display: inline-block; vertical-align: -1px; width: 1px; height: 12px; margin: 0 16px; background: var(--tx3); opacity: .5; }
  .foot p a:first-child { margin-left: 0; }
  .foot p a:last-child { margin-right: 0; }
}
