/* goodinfoday 공통 스타일 v2 (허브·모든 앱·모든 언어)
   원칙: 흰 바탕 + 검정 글자 + 노란 강조 하나. 그림자·그라데이션·이모지 없이, 결과 숫자는 크게.
   파일을 바꾸면 각 페이지의 ?v= 값을 올린다 (nginx 가 7일 캐시) */
:root {
  --ink: #111;
  --muted: #666;
  --line: #e4e4e4;
  --soft: #f5f5f3;
  --accent: #ffd60a;       /* 결과·포커스 강조 */
  --link: #0b57d0;
  --error: #c62828;
  --radius: 6px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
}
:lang(en) { --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
:lang(ja) { --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", system-ui, sans-serif; }
:lang(zh) { --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* display 를 준 요소(.tab-panel 등)도 hidden 속성이 이기게 */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--ink); font: 17px/1.7 var(--font); }
:lang(ko) body, body:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--link); text-underline-offset: 2px; }
img { max-width: 100%; }

.wrap { max-width: 760px; margin: 0 auto; padding-inline: 20px; }

/* 머리글: 로고 + 언어 전환. 얇고 조용하게 */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.logo { color: var(--ink); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; text-decoration: none; }
.logo::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 3px; background: var(--accent); border-radius: 50%; vertical-align: 1px; }
.site-header nav { display: flex; gap: 14px; margin-left: auto; font-size: .9rem; flex-wrap: wrap; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--ink); }
.site-header nav a[aria-current] { font-weight: 700; }

main.wrap { padding-block: 32px 64px; }
h1 { font-size: 2rem; line-height: 1.25; letter-spacing: -0.035em; margin: 0 0 10px; font-weight: 800; }
h2 { font-size: 1.25rem; letter-spacing: -0.02em; margin: 48px 0 12px; }
h3 { font-size: 1.05rem; margin: 28px 0 8px; }
.lead { color: var(--muted); margin: 0 0 28px; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }

/* 상자 (문의 주소 등) */
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }

/* 도구 영역 */
.tool { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: .9rem; font-weight: 700; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
textarea, input[type=text], input[type=number], input[type=date], select {
  width: 100%; font: inherit; color: inherit; background: #fff;
  border: 2px solid var(--ink); border-radius: var(--radius); padding: 12px 14px; min-height: 52px;
}
textarea { min-height: 220px; resize: vertical; line-height: 1.6; border-width: 2px; }
textarea:focus, input:focus, select:focus, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
button, .btn {
  font: inherit; font-size: .92rem; cursor: pointer; border-radius: var(--radius); padding: 8px 14px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { border-color: var(--ink); }
button.primary { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }

/* 탭: 한 페이지에 계산기 여러 개. 선택된 탭만 검정 바탕 */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { border: 1px solid var(--ink); background: #fff; font-weight: 700; }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.tab-panel { display: grid; gap: 16px; }

/* 문장형 입력: "[200]의 [15]%는?" */
.sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 1.1rem; font-weight: 700; }
.sentence input, .sentence select { width: 9em; min-width: 0; text-align: right; font-weight: 700; }
.sentence select { width: auto; text-align: left; }
.formula { font-size: .9rem; color: var(--muted); margin: 0; font-variant-numeric: tabular-nums; }

/* 결과: 핵심 숫자는 노란 블록에 크게, 나머지는 표처럼 */
.answer { background: var(--accent); border-radius: var(--radius); padding: 20px 22px; }
.answer .label { font-size: .95rem; font-weight: 700; }
.answer .big { font-size: clamp(2.6rem, 9vw, 4rem); font-weight: 900; line-height: 1.05; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.answer .big small { font-size: .45em; font-weight: 800; margin-left: 4px; letter-spacing: 0; }
.answer .note { margin-top: 6px; font-size: .95rem; }
.answer.empty { background: var(--soft); color: var(--muted); }
.answer.bad { background: #fff; border: 2px solid var(--error); }
.answer.bad .label { color: var(--error); }
.answer .big.text { font-size: clamp(1.6rem, 6vw, 2.4rem); }

/* 코드 입력 (JSON 등) */
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "D2Coding", monospace; font-size: .88rem; line-height: 1.55;
  white-space: pre; overflow-wrap: normal; overflow-x: auto; min-height: 340px; tab-size: 2; }
.snippet { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; background: var(--soft);
  border-radius: var(--radius); padding: 10px 12px; margin: 0; overflow-x: auto; white-space: pre; }

.facts { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.facts li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.facts .k { color: var(--muted); }
.facts .v { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }

/* 글자수 세기 같은 여러 숫자 도구 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.stat { padding: 12px 4px; border-bottom: 1px solid var(--line); }
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.6rem; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat.main { background: var(--accent); padding-inline: 12px; border-bottom-color: var(--accent); }
.stat.main .label { color: var(--ink); font-weight: 700; }

.error { color: var(--error); font-weight: 700; margin: 0; }

/* 설명 글 */
.content p, .content li { color: #222; }
.content table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .95rem; }
.content th, .content td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }
.content th { border-bottom: 2px solid var(--ink); }
.table-scroll { overflow-x: auto; }
.source { font-size: .88rem; color: var(--muted); }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
summary { cursor: pointer; font-weight: 700; }

/* 광고 자리: 애드센스 승인 전에는 숨긴다 (app.js 의 ADSENSE_CLIENT) */
.ad-slot { display: none; margin: 32px 0; }
.ads-on .ad-slot { display: block; }
/* 승인 전·광고가 안 채워진 자리는 빈칸을 남기지 않는다 */
.ad-slot ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* 허브 목록: 카드 대신 줄 목록 */
.app-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.app-list a { display: flex; gap: 16px; align-items: baseline; padding: 16px 2px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.app-list a:hover .name { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 4px; text-underline-offset: 3px; }
.app-list .name { font-weight: 800; font-size: 1.1rem; white-space: nowrap; }
.app-list .desc { color: var(--muted); font-size: .92rem; flex: 1; }
.app-list .cat { color: var(--muted); font-size: .8rem; white-space: nowrap; }
@media (max-width: 560px) {
  .app-list a { flex-wrap: wrap; gap: 2px 12px; }
  .app-list .desc { flex-basis: 100%; }
}

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.site-footer .wrap { padding-block: 24px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 8px 16px; border-radius: var(--radius); font-size: .9rem; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  h1 { font-size: 1.6rem; }
}
