/* 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; }
