/* k-taxlaw.com — 홈·Q&A 공용 스타일. 뷰어(/viewer/)와 같은 색(라이트: 흰 바탕 + 남색 #0b3d91, 다크: 에디터 톤)·서체(Pretendard). 테마 키는 뷰어와 공유(localStorage ide-theme). */
:root {
  --font-ui: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --font-mono: "Cascadia Code", Consolas, "D2Coding", "JetBrains Mono", Menlo, monospace;
  --bg: #ffffff; --bg-soft: #f6f7f9; --bg-card: #ffffff; --bg-tint: #e9eff9;
  --border: #e3e5ea; --border-strong: #c9cdd6;
  --text: #1c1f26; --text-strong: #000000; --text-muted: #5b6270; --text-dim: #8a909c;
  --accent: #0b3d91; --accent-2: #072a66; --on-accent: #ffffff;
  --ok: #1b7a3a; --warn: #a15c00; --bad: #b3261e; --mark: rgba(255, 213, 61, .5);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --wrap: 1080px;
}
:root[data-theme="dark"] {
  --bg: #1e1e1e; --bg-soft: #252526; --bg-card: #252526; --bg-tint: #04395e;
  --border: #3c3c3c; --border-strong: #505050;
  --text: #d4d4d4; --text-strong: #ffffff; --text-muted: #9a9a9a; --text-dim: #7a7f87;
  --accent: #4fc1ff; --accent-2: #9cdcfe; --on-accent: #0b1a2b;
  --ok: #6cc38a; --warn: #dcb15a; --bad: #f1857c; --mark: rgba(255, 213, 61, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: 15px; line-height: 1.65; letter-spacing: -0.01em; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--font-mono); }

/* 머리 */
.top { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; height: 52px; gap: 6px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text-strong); font-size: 16px; margin-right: 14px; }
.brand:hover { text-decoration: none; }
.brand-mark { font-family: var(--font-mono); font-weight: 800; color: var(--accent); font-size: 19px; }
.top nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a { padding: 6px 11px; border-radius: 6px; color: var(--text-muted); font-size: 14px; white-space: nowrap; }
.top nav a:hover { background: var(--bg-soft); color: var(--text-strong); text-decoration: none; }
.top nav a.on { color: var(--accent); font-weight: 600; }
.icon-btn { width: 34px; height: 34px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
.icon-btn:hover { background: var(--bg-soft); color: var(--text-strong); }
.icon-btn .material-icons { font-size: 19px; }

/* 공통 조각 */
main { flex: 1; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; color: var(--accent); letter-spacing: 0; }
.sec { padding: 44px 0 0; }
.sec-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-bottom: 14px; }
.sec-head h2 { font-size: 20px; font-weight: 700; color: var(--text-strong); letter-spacing: -0.02em; }
.sec-head .more { margin-left: auto; font-size: 13px; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 18px; border-radius: 8px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn .material-icons { font-size: 18px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-2); text-decoration: none; }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-line { border: 1px solid var(--border-strong); color: var(--text); background: var(--bg-card); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.badge { display: inline-block; font-family: var(--font-mono); font-size: 10.5px; line-height: 1; padding: 3px 6px; border-radius: 4px; background: var(--bg-tint); color: var(--accent); white-space: nowrap; vertical-align: 1px; }
.badge.new { background: var(--accent); color: var(--on-accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); margin-right: 6px; vertical-align: 1px; }
.dot.on { background: var(--ok); }
.dot.off { background: var(--warn); }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }

/* 질문 상자 (홈·Q&A 공용) */
.ask { padding: 14px; box-shadow: var(--shadow); }
.ask-tabs { display: flex; gap: 4px; padding-bottom: 10px; }
.ask-tab { height: 30px; padding: 0 12px; border-radius: 15px; font-size: 13px; color: var(--text-muted); border: 1px solid transparent; display: inline-flex; align-items: center; gap: 5px; }
.ask-tab .material-icons { font-size: 16px; }
.ask-tab.on { background: var(--bg-tint); color: var(--accent); font-weight: 600; }
.ask-row { display: flex; gap: 10px; align-items: flex-end; }
.ask textarea, .ask input[type="search"] { flex: 1; min-width: 0; width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg); padding: 10px 12px; font-size: 16px; line-height: 1.5; resize: none; }
.ask textarea:focus, .ask input[type="search"]:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--bg-tint); }
.ask-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 10px; font-size: 12.5px; color: var(--text-muted); }
.ask-foot label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.ask-foot .count { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 15px; font-size: 13px; color: var(--text); background: var(--bg-card); }
.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.suggest { list-style: none; margin-top: 6px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; max-height: 300px; overflow-y: auto; }
.suggest:empty { display: none; }
.suggest li a { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; color: var(--text); font-size: 14px; }
.suggest li a:hover, .suggest li.sel a { background: var(--bg-tint); text-decoration: none; }
.suggest .num { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); min-width: 44px; }
.suggest .kind { margin-left: auto; font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }

/* 발 */
.foot { margin-top: 64px; border-top: 1px solid var(--border); background: var(--bg-soft); padding: 24px 0 36px; font-size: 12.5px; color: var(--text-muted); line-height: 1.75; }
.foot b { color: var(--text); font-weight: 600; }
.foot .links { display: flex; gap: 14px; flex-wrap: wrap; padding-bottom: 8px; }

@media (max-width: 640px) {
  .brand { margin-right: 4px; }
  .top nav a { padding: 6px 8px; }
  .ask-row { flex-direction: column; align-items: stretch; }
  .sec { padding-top: 34px; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .chip, .card { transition: border-color .12s, background-color .12s, color .12s; } }

/* 질문 분야·세법 선택 — 2026-10-06 */
.pick { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding-bottom: 10px; font-size: 13px; }
.pick-f, .pick-laws { display: inline-flex; align-items: center; gap: 6px; }
.pick-f > span, .pick-laws > span { color: var(--text-muted); font-size: 12.5px; }
.pick select { height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--bg-card); font-size: 13.5px; -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 15px) 13px, calc(100% - 10px) 13px; background-size: 5px 5px; background-repeat: no-repeat; }
.pick select:focus { outline: 0; border-color: var(--accent); }
.pick-dd { position: relative; }
.pick-btn { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 6px 0 10px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--bg-card); font-size: 13.5px; max-width: 70vw; }
.pick-btn .pick-sel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.pick-btn .material-icons { font-size: 18px; color: var(--text-muted); }
.pick-btn:hover { border-color: var(--accent); }
.pick-panel { position: absolute; left: 0; top: 36px; z-index: 30; width: 320px; max-width: 90vw; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); }
.pick-hint { padding: 8px 12px 4px; font-size: 11.5px; color: var(--text-dim); }
.pick-list { list-style: none; max-height: 300px; overflow-y: auto; padding: 4px 6px; }
.pick-list li label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.pick-list li label:hover { background: var(--bg-soft); }
.pick-list li label.off { color: var(--text-dim); cursor: default; }
.pick-list li.pick-sep { padding: 8px 10px 2px; font-size: 11.5px; color: var(--text-dim); border-top: 1px dashed var(--border); margin-top: 4px; }
.pick-foot { display: flex; justify-content: space-between; padding: 6px 10px 8px; border-top: 1px solid var(--border); }
.pick-foot button { font-size: 12.5px; color: var(--accent); padding: 4px 6px; }
.pick-note { width: 100%; font-size: 12.5px; color: var(--warn); }
.pick-note b { font-weight: 600; }
.tag { display: inline-block; font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 4px; background: var(--bg-soft); color: var(--text-muted); border: 1px solid var(--border); margin-right: 6px; vertical-align: 1px; white-space: nowrap; }

/* 이용 기록 안내 한 줄(site.js) */
.ktl-notice { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; max-width: calc(100vw - 24px); padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-card); color: var(--text); font-size: 13px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.ktl-notice button { font: inherit; font-size: 12.5px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); cursor: pointer; }
.m-all { padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px dashed var(--border); }

/* 만든이 표시 — 큰 안내 상자(전체가 링크) */
.ktl-maker { display: flex; flex-direction: column; gap: 10px; margin: 32px 0 0; padding: 28px 28px 24px; border: 1px solid var(--border-strong); border-left: 5px solid var(--accent); border-radius: 14px; background: var(--bg-card); color: var(--text); text-decoration: none; }
.ktl-maker:hover { border-color: var(--accent); }
.ktl-maker .mk-head { font-size: clamp(22px, 3.4vw, 30px); font-weight: 700; line-height: 1.25; color: var(--text-strong); text-wrap: balance; }
.ktl-maker .mk-sub { font-size: 15px; line-height: 1.6; color: var(--text-muted); max-width: 62ch; }
.ktl-maker .mk-by { margin-top: 6px; font-size: 18px; color: var(--text); }
.ktl-maker .mk-by b { font-size: 22px; color: var(--accent); }
.ktl-maker .mk-by i { font-style: normal; color: var(--accent); }

/* AI 답변 표(복사·엑셀 저장) */
.a-table { margin: 10px 0 14px; }
.a-table figcaption { font-weight: 600; font-size: 14px; margin: 0 0 6px; }
.a-table-wrap { overflow-x: auto; }
.a-table table { border-collapse: collapse; font-size: 13.5px; min-width: 60%; font-variant-numeric: tabular-nums; }
.a-table th, .a-table td { border: 1px solid var(--border-strong); padding: 5px 10px; text-align: left; vertical-align: top; }
.a-table th { background: var(--bg-sunken, var(--bg)); font-weight: 600; }
.a-table-btns { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }
.a-table-btns button { font: inherit; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text); cursor: pointer; }
.a-table-btns button:hover { border-color: var(--accent); color: var(--accent); }

/* 생활 말 → 법률 용어 '이 의미신가요?' (질문 상자 밑, site.js layWatch · js/lay-terms.js) */
.lay-hint { display: flex; flex-direction: column; gap: 6px; padding: 8px 0 2px; }
.lay-hint[hidden] { display: none; }
.lay-row { padding: 8px 12px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; background: var(--bg-tint); }
.lay-row .lay-q { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.lay-row .lbl { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.lay-row .muted { font-size: 12px; }
.lay-row .lay-x { margin-left: auto; background: none; border: 0; color: var(--text-muted); font-size: 16px; cursor: pointer; line-height: 1; padding: 0 2px; }
.lay-row .lay-ch { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; }
.lay-it { display: inline-flex; align-items: stretch; }
.lay-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 11px; border: 1px solid var(--border-strong); border-radius: 8px 0 0 8px; background: var(--bg-card); color: var(--text); text-align: left; cursor: pointer; font: inherit; max-width: 280px; }
.lay-it:not(:has(.lay-go)) .lay-pick { border-radius: 8px; }
.lay-pick b { font-size: 13.5px; color: var(--text-strong); }
.lay-pick small { font-size: 11px; color: var(--text-muted); line-height: 1.3; }
.lay-pick:hover { border-color: var(--accent); background: var(--bg-soft); }
.lay-go { display: flex; align-items: center; padding: 0 8px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 8px 8px 0; color: var(--accent); background: var(--bg-card); font-weight: 700; font-size: 13px; }
.lay-go:hover { background: var(--bg-soft); text-decoration: none; }
