/* =====================================================================
   모두의 기후 v1 — 화면 스타일 (모바일 우선, 접근성: 큰글씨·고대비·쉬운모드)
   ===================================================================== */
:root {
  --fs: 16px;
  --g: #0F7B5F; --g2: #13A57E; --gl: #E3F4EC; --bg: #F4FAF7; --card: #fff;
  --ink: #17322A; --mut: #5C736B; --line: #DCE9E3;
  --warn: #F2A541; --bad: #D64545; --info: #2E86DE;
  --r: 16px; --sh: 0 2px 10px rgba(16, 60, 45, .08);
  --navh: 68px;
}
html.hc { --g: #004D36; --g2: #00704F; --gl: #FFFFFF; --bg: #FFFFFF; --ink: #000; --mut: #222; --line: #000; --sh: none; }
html.hc .card, html.hc .tile, html.hc .list li a, html.hc .risk { border: 2px solid #000 !important; }
* { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.55; -webkit-tap-highlight-color: transparent;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--navh) + 20px + env(safe-area-inset-bottom)); }
a { color: var(--g); }
h1, h2, h3 { line-height: 1.3; margin: .3em 0; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 99; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.muted { color: var(--mut); } .small { font-size: .85rem; } .center { text-align: center; } .pad { padding: 4px 16px; } .mt { margin-top: 12px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; word-break: break-all; }

/* 상단바 */
header.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 6px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--g); color: #fff; }
header.top h1 { flex: 1; font-size: 1.15rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { font-size: 1.5rem; }
.icon-btn { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 12px; min-width: 44px; height: 44px; font-size: 1.2rem; cursor: pointer; }

/* 하단 내비게이션 */
nav.bottom { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-around; align-items: flex-end;
  height: calc(var(--navh) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); max-width: 560px; margin: 0 auto; }
nav.bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; height: var(--navh); text-decoration: none; color: var(--mut); font-size: .75rem; }
nav.bottom a span { font-size: 1.45rem; line-height: 1.1; }
nav.bottom a.on { color: var(--g); font-weight: 700; }
nav.bottom a.fab span { background: var(--g); color: #fff; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; margin-top: -26px; box-shadow: 0 4px 14px rgba(15,123,95,.4); font-size: 1.6rem; }

/* 버튼 */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 32px); margin: 10px 16px; min-height: 52px; padding: 12px 16px;
  border-radius: 14px; border: 2px solid var(--g); background: #fff; color: var(--g); font-size: 1rem; font-weight: 700; text-decoration: none; cursor: pointer; font-family: inherit; }
.btn.primary { background: var(--g); color: #fff; }
.btn.big { min-height: 62px; font-size: 1.15rem; }
.btn.ghost { border-color: var(--line); color: var(--ink); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.right { background: #2EAD6B; color: #fff; border-color: #2EAD6B; } .btn.wrong { background: var(--bad); color: #fff; border-color: var(--bad); } .btn.dim { opacity: .5; }
.detail .btn, .pad .btn { width: 100%; margin: 10px 0; }
.rowbtn { display: flex; width: 100%; gap: 12px; align-items: center; padding: 14px; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }

/* 온보딩 */
.onboard { padding: 36px 22px; text-align: center; }
.hero { font-size: 5rem; line-height: 1; margin: 18px 0 6px; } .hero.small { font-size: 3.6rem; }
.onboard h1 { color: var(--g); font-size: 1.9rem; }
.lead { font-size: 1.1rem; color: var(--mut); }
.feat { list-style: none; padding: 0; margin: 22px 0; text-align: left; }
.feat li { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: var(--r); padding: 14px; margin: 10px 0; box-shadow: var(--sh); }
.feat li > span { font-size: 1.9rem; } .feat b { display: block; } .feat small { color: var(--mut); }
.onboard .btn { width: 100%; margin: 10px 0; }

/* 카드·폼 */
.card { background: var(--card); border-radius: var(--r); padding: 14px 16px; margin: 12px 16px; box-shadow: var(--sh); }
.pad .card, .detail .card { margin: 12px 0; }
.card.info { background: var(--gl); } .card.warnbox { background: #FDECEC; }
.card p { margin: .4em 0; }
.card.link { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); margin: 0; }
.card.link span { font-size: 1.6rem; } .card.link small { color: var(--mut); }
.warn { background: #FFF4E0; padding: 10px 12px; border-radius: 12px; }
.field { display: block; margin: 14px 0; font-weight: 600; }
.field input, .field select, .input { display: block; width: 100%; margin-top: 6px; min-height: 50px; padding: 10px 12px; font-size: 1rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-family: inherit; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: .95rem; }
.check input, .switch input, .checklist input, .seg input { width: 24px; height: 24px; flex: none; accent-color: var(--g); }
.switch { display: flex; gap: 12px; align-items: center; min-height: 54px; padding: 8px 12px; background: #fff; border-radius: 12px; margin: 10px 0; box-shadow: var(--sh); }
.seg { border: 0; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seg legend { font-weight: 700; margin-bottom: 6px; }
.seg label { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #fff; border-radius: 12px; box-shadow: var(--sh); }
details summary { cursor: pointer; color: var(--g); font-weight: 600; padding: 10px 0; }

/* 홈 */
.hello { padding: 14px 16px 0; font-size: 1.1rem; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 16px; }
.stats div { background: #fff; border-radius: var(--r); padding: 12px 6px; text-align: center; box-shadow: var(--sh); }
.stats b { display: block; font-size: 1.45rem; color: var(--g); } .stats b small { font-size: .75rem; margin-left: 2px; }
.stats span { font-size: .8rem; color: var(--mut); }
.risk { display: block; margin: 12px 16px; padding: 14px 16px; border-radius: var(--r); text-decoration: none; color: var(--ink); background: #EAF6EF; border-left: 8px solid #2EAD6B; }
.risk.l1 { background: #FFF8E6; border-color: var(--warn); } .risk.l2 { background: #FFEEDD; border-color: #E67E22; } .risk.l3 { background: #FDE3E3; border-color: var(--bad); }
.risk-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.25rem; font-weight: 800; }
.risk-h small { font-size: .78rem; font-weight: 400; color: var(--mut); }
.risk p { margin: 4px 0; font-weight: 600; }
.sec { margin: 18px 16px 6px; font-size: 1.05rem; } .sec.danger { color: var(--bad); }
.grid4, .grid3 { display: grid; gap: 8px; margin: 0 16px; }
.grid4 { grid-template-columns: repeat(4, 1fr); } .grid3 { grid-template-columns: repeat(3, 1fr); }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 92px; padding: 8px 4px; background: #fff; border-radius: var(--r); text-decoration: none; color: var(--ink); text-align: center; font-size: .82rem; font-weight: 600; box-shadow: var(--sh); border-top: 4px solid var(--c, transparent); }
.tile span { font-size: 1.9rem; } .tile small { color: var(--g); font-weight: 700; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 16px; }
.bars { display: flex; gap: 6px; height: 120px; margin: 6px 16px; padding: 10px; background: #fff; border-radius: var(--r); box-shadow: var(--sh); align-items: flex-end; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar i { width: 70%; background: var(--g2); border-radius: 6px 6px 2px 2px; }
.bar small { font-size: .7rem; color: var(--mut); } .bar em { position: absolute; top: -2px; font-size: .62rem; font-style: normal; color: var(--g); }

/* 쉬운 모드 */
.easy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px; }
.easy-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 150px; background: #fff; border-radius: 22px; text-decoration: none; color: var(--ink); font-size: 1.15rem; font-weight: 800; box-shadow: var(--sh); text-align: center; border: 3px solid var(--gl); }
.easy-btn span { font-size: 3rem; }

/* 목록 */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; scrollbar-width: none; }
.chip { flex: none; padding: 9px 14px; border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-size: .9rem; box-shadow: var(--sh); }
.chip.on { background: var(--g); color: #fff; }
.list { list-style: none; margin: 0 16px; padding: 0; }
.list li { margin: 8px 0; }
.list li a, .list li .rowbtn { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: #fff; border-radius: var(--r); text-decoration: none; color: var(--ink); box-shadow: var(--sh); min-height: 64px; }
.list .ic { font-size: 1.8rem; width: 40px; text-align: center; }
.list div { flex: 1; } .list b { display: block; } .list small { color: var(--mut); font-size: .82rem; }
.badge { text-align: right; color: var(--g); font-weight: 800; font-size: .9rem; }
.badge.pass { color: #2EAD6B; } .badge.review { color: #E67E22; } .badge.reject { color: var(--bad); }

/* 상세 */
.detail { padding: 8px 16px; text-align: center; }
.big-ic { font-size: 4.5rem; } .detail .card { text-align: left; }
.kv { display: flex; gap: 8px; margin: 12px 0; }
.kv div { flex: 1; background: var(--gl); border-radius: 14px; padding: 10px; }
.kv b { display: block; font-size: 1.4rem; color: var(--g); } .kv small { color: var(--mut); font-size: .78rem; }
.file { position: relative; }
.status { display: inline-block; padding: 8px 18px; border-radius: 999px; font-weight: 800; margin: 8px 0; }
.status.ok { background: #DFF5E8; color: #1E7A4C; } .status.mid { background: #FFEEDD; color: #B85C00; } .status.bad { background: #FDE3E3; color: var(--bad); }
.thumb { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--r); }
.score { position: relative; height: 30px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.score i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--g2), var(--g)); }
.score span { position: relative; line-height: 30px; font-weight: 800; color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.4); }
.checks { list-style: none; padding: 0; text-align: left; }
.checks li { background: #fff; border-radius: 12px; padding: 10px 12px; margin: 6px 0; box-shadow: var(--sh); }
.checks b { display: block; font-size: .95rem; } .checks small { color: var(--mut); }
.checks li.n { border-left: 5px solid var(--bad); } .checks li.y { border-left: 5px solid #2EAD6B; } .checks li.na { border-left: 5px solid var(--line); }
.spinner { width: 64px; height: 64px; border: 6px solid var(--gl); border-top-color: var(--g); border-radius: 50%; margin: 40px auto 16px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { list-style: none; padding: 0; text-align: left; display: inline-block; } .steps li { padding: 5px 0; animation: fade 1.8s ease-in-out infinite alternate; }
@keyframes fade { from { opacity: .45; } to { opacity: 1; } }

/* 적응 */
.wx { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 16px; }
.wx div { background: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: var(--sh); }
.wx b { display: block; font-size: .85rem; color: var(--mut); } .wx span { font-size: 1.15rem; font-weight: 800; } .wx small { display: block; color: var(--mut); font-size: .75rem; }
.banner { display: flex; gap: 12px; align-items: center; margin: 12px 16px; padding: 16px; border-radius: var(--r); background: var(--c); color: #fff; font-size: 1.2rem; }
.banner span { font-size: 2.2rem; }
.todo { margin: 6px 16px 6px 36px; padding: 0; } .todo li { margin: 8px 0; font-size: 1.02rem; }
.checklist { list-style: none; margin: 0 16px; padding: 0; }
.checklist label { display: flex; gap: 12px; align-items: center; min-height: 52px; padding: 8px 12px; background: #fff; border-radius: 12px; margin: 6px 0; box-shadow: var(--sh); }

/* 계산기·인증서 */
.form { padding: 0 16px; }
.big-num { font-size: 2rem; font-weight: 800; color: var(--g); margin: 0; } .big-num small { font-size: .85rem; color: var(--mut); font-weight: 400; }
.hbars div { display: grid; grid-template-columns: 70px 1fr 56px; gap: 8px; align-items: center; margin: 6px 0; font-size: .85rem; }
.hbars i { height: 14px; background: var(--g2); border-radius: 7px; } .hbars b { text-align: right; }
.profile { display: flex; gap: 14px; align-items: center; margin: 14px 16px; padding: 16px; background: #fff; border-radius: var(--r); box-shadow: var(--sh); }
.avatar { font-size: 2.6rem; width: 64px; height: 64px; display: grid; place-items: center; background: var(--gl); border-radius: 50%; }
.profile b { display: block; font-size: 1.2rem; } .profile small { display: block; color: var(--mut); font-size: .8rem; }
.certbox { position: relative; margin: 14px 16px; padding: 22px 18px; background: #fff; border: 3px double var(--g); border-radius: var(--r); }
.certbox h2 { text-align: center; color: var(--g); }
.seal { position: absolute; right: 14px; top: 12px; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--g); color: #fff; font-size: 1.6rem; }
.kvt { width: 100%; border-collapse: collapse; font-size: .9rem; }
.kvt th { text-align: left; width: 34%; color: var(--mut); font-weight: 600; padding: 8px 6px; vertical-align: top; border-bottom: 1px solid var(--line); }
.kvt td { padding: 8px 6px; border-bottom: 1px solid var(--line); word-break: break-all; }
.q { font-size: 1.25rem; } .answers .btn { width: 100%; margin: 8px 0; }

#toast { position: fixed; left: 50%; bottom: calc(var(--navh) + 24px); transform: translateX(-50%) translateY(20px); max-width: 90vw; background: #17322A; color: #fff; padding: 12px 18px; border-radius: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; font-size: .95rem; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

html.easy .tile { min-height: 110px; font-size: .95rem; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 600px) { body { background: #E6F1EC; } #app { background: var(--bg); box-shadow: 0 0 30px rgba(0,0,0,.06); } }

.qrbox { display: inline-block; padding: 12px; background: #fff; border-radius: 16px; box-shadow: var(--sh); margin: 10px 0; }
.qrbox svg { width: 240px; height: 240px; display: block; }
