:root {
  --bg: #F2F4F6; --card: #FFFFFF; --ink: #191F28; --ink2: #4E5968; --gray: #8B95A1; --line: #E5E8EB;
  --blue: #3182F6; --blue2: #1B64DA; --blue-bg: #E8F3FF; --red: #F04452; --red-bg: #FFEEF0;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.5; }
button, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }

.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: var(--bg); position: relative; }
.screen { padding: 12px 20px calc(120px + var(--safe-b)); }
.screen.home { padding-top: 8px; }

/* nav */
.nav { height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 12px; position: sticky; top: 0; background: rgba(242,244,246,.92); backdrop-filter: blur(10px); z-index: 10; }
.nav .back { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 12px; display: grid; place-items: center; }
.nav .back:active { background: rgba(0,0,0,.05); }
.nav .title { font-size: 16px; font-weight: 700; }
.nav .brand { font-size: 20px; font-weight: 800; letter-spacing: -.02em; padding-left: 8px; }
.nav .brand em { font-style: normal; color: var(--blue); }

/* type */
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.3; margin: 12px 0 8px; }
h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
h3 { font-size: 17px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.01em; }
.lead { color: var(--ink2); margin: 0 0 20px; font-size: 15px; }
.muted { color: var(--gray); font-size: 13px; }

/* card */
.card { background: var(--card); border-radius: 20px; padding: 20px; margin-bottom: 12px; }
.card.tap { border: 0; width: 100%; text-align: left; }
.card.tap:active { transform: scale(.985); background: #FAFBFC; }
.path { display: flex; gap: 14px; align-items: center; padding: 22px 20px; }
.path .ico { width: 48px; height: 48px; border-radius: 14px; background: var(--blue-bg); display: grid; place-items: center; font-size: 22px; flex: none; }
.path .txt { flex: 1; }
.path .txt b { display: block; font-size: 17px; font-weight: 700; margin-bottom: 3px; }
.path .txt span { color: var(--gray); font-size: 13px; line-height: 1.45; display: block; }
.path .arr { color: #B0B8C1; font-size: 20px; }

/* form */
.field { margin-bottom: 18px; }
.label { display: block; font-size: 13px; color: var(--ink2); font-weight: 600; margin-bottom: 8px; }
.input, .ta { width: 100%; border: 0; border-radius: 14px; background: var(--bg); padding: 15px 16px; font-size: 16px; outline: none; }
.input:focus, .ta:focus { box-shadow: 0 0 0 2px var(--blue) inset; background: #fff; }
.ta { resize: none; min-height: 130px; line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 0; background: var(--bg); border-radius: 999px; padding: 9px 14px; font-size: 14px; font-weight: 600; color: var(--ink2); }
.chip.on { background: var(--blue); color: #fff; }
.help { font-size: 12.5px; color: var(--gray); margin-top: 6px; }

/* buttons */
.btn { width: 100%; border: 0; border-radius: 16px; height: 56px; font-size: 16px; font-weight: 700; background: var(--blue); color: #fff; }
.btn:active:not(:disabled) { background: var(--blue2); }
.btn:disabled { background: #D1D6DB; color: #fff; }
.btn.sub { background: var(--blue-bg); color: var(--blue); }
.btn.sub:active:not(:disabled) { background: #D6E8FF; }
.btn.line { background: #fff; color: var(--ink2); box-shadow: 0 0 0 1px var(--line) inset; }
.btn.sm { height: 44px; font-size: 14px; border-radius: 12px; }
.cta { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 20px calc(12px + var(--safe-b)); background: linear-gradient(to top, rgba(242,244,246,1) 70%, rgba(242,244,246,0)); z-index: 20; }
.cta .in { max-width: 440px; margin: 0 auto; display: grid; gap: 8px; }
.cta .in.two { grid-template-columns: 1fr 1.4fr; }

.err { background: var(--red-bg); color: var(--red); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; margin-top: 12px; font-weight: 500; }
.loading { display: flex; align-items: center; gap: 12px; padding: 18px 0; color: var(--ink2); font-size: 14px; }
.spin { width: 20px; height: 20px; border: 3px solid var(--blue-bg); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* score */
.score { display: flex; align-items: flex-end; gap: 10px; margin: 4px 0 18px; }
.score .n { font-size: 56px; font-weight: 800; letter-spacing: -.05em; line-height: .9; }
.score .d { font-size: 15px; color: var(--gray); padding-bottom: 7px; }
.grade { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; margin-left: auto; margin-bottom: 6px; }
.axis { display: grid; grid-template-columns: 76px 1fr 30px; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 14px; }
.axis .t { color: var(--ink2); }
.bar { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.axis .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.kv { margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.kv p { margin: 0 0 8px; font-size: 14px; color: var(--ink2); line-height: 1.55; }
.kv b { color: var(--ink); display: block; font-size: 13px; margin-bottom: 2px; }

/* trend */
.trend { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.trend:last-child { border-bottom: 0; }
.trend b { display: block; margin-bottom: 2px; }
.trend .src { color: var(--gray); font-size: 12px; margin-top: 2px; }
.tag { display: inline-block; background: var(--bg); color: var(--ink2); border-radius: 6px; padding: 2px 7px; font-size: 12px; font-weight: 600; vertical-align: middle; margin-left: 4px; }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.opt { width: 100%; text-align: left; border: 2px solid transparent; background: #fff; border-radius: 18px; padding: 18px; margin-bottom: 10px; }
.opt.on { border-color: var(--blue); }
.opt b { display: block; font-size: 16px; margin-bottom: 4px; }
.opt p { margin: 0 0 6px; font-size: 14px; color: var(--ink2); line-height: 1.5; }
.opt .why { color: var(--blue); font-size: 13px; font-weight: 600; }

/* features */
.feat { display: flex; gap: 10px; margin-bottom: 12px; align-items: flex-start; }
.feat .no { width: 24px; font-weight: 800; color: #B0B8C1; padding-top: 12px; text-align: center; font-size: 14px; flex: none; }
.feat .body { flex: 1; }
.feat .row { display: flex; gap: 6px; margin-bottom: 6px; }
.feat .input { padding: 12px 14px; font-weight: 700; font-size: 15px; }
.feat .ta { min-height: 60px; padding: 12px 14px; font-size: 14px; }
.feat .mvp { flex: none; border: 0; border-radius: 12px; padding: 0 12px; font-size: 12px; font-weight: 700; background: var(--bg); color: var(--gray); }
.feat .mvp.on { background: #F1E8FF; color: #7C3AED; }
.feat .x { border: 0; background: transparent; color: #B0B8C1; font-size: 22px; padding-top: 6px; }
.add { width: 100%; border: 1.5px dashed #D1D6DB; background: transparent; border-radius: 14px; padding: 12px; color: var(--gray); font-size: 14px; font-weight: 600; }

/* prd */
.prd { white-space: pre-wrap; font-size: 14px; line-height: 1.7; color: var(--ink2); word-break: keep-all; }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); background: rgba(25,31,40,.92); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; z-index: 30; white-space: nowrap; }

/* board */
.bh { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 10px; }
.seg { display: flex; background: #E5E8EB; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--gray); }
.seg button.on { background: #fff; color: var(--ink); }
.empty { text-align: center; padding: 36px 20px; color: var(--gray); font-size: 14px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.brow { display: flex; gap: 12px; align-items: center; padding: 16px 18px; }
.brow .rank { width: 26px; font-size: 20px; font-weight: 800; color: #B0B8C1; letter-spacing: -.03em; flex: none; }
.brow.top .rank { color: var(--blue); }
.brow .mid { flex: 1; min-width: 0; }
.brow .mid b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow .mid .sum { font-size: 13px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.mini { display: flex; gap: 3px; margin-top: 8px; }
.mini i { display: block; width: 22px; height: 4px; background: var(--bg); border-radius: 2px; position: relative; overflow: hidden; }
.mini i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: var(--blue); }
.brow .rs { text-align: right; flex: none; }
.brow .rs .n { font-size: 24px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.brow .rs .g { display: inline-block; border-radius: 6px; padding: 2px 7px; font-size: 11px; font-weight: 800; margin-top: 4px; }
.detail { padding: 0 18px 18px; font-size: 14px; color: var(--ink2); }
.detail p { margin: 0 0 8px; }
.detail ol { margin: 4px 0 12px; padding-left: 18px; }
.detail .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pill { font-size: 11px; font-weight: 700; color: #7C3AED; background: #F1E8FF; border-radius: 5px; padding: 1px 6px; margin-left: 5px; vertical-align: middle; }
.setup { background: #FFF8E6; border-radius: 16px; padding: 16px; font-size: 13.5px; color: #8A5A00; line-height: 1.6; margin-bottom: 12px; }
.setup code { background: #fff; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }

/* nav right / gear */
.nav .right { margin-left: auto; display: flex; align-items: center; }
.nav .gear { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 12px; display: grid; place-items: center; }
.nav .gear:active { background: rgba(0,0,0,.05); }

/* axis weight tag */
.axis { grid-template-columns: 96px 1fr 34px; }
.axis .t em { font-style: normal; color: var(--gray); font-size: 11px; margin-left: 4px; font-weight: 600; }

/* criteria editor */
.card.crit { padding: 14px 16px; }
.crit .row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.crit .no { width: 20px; font-weight: 800; color: #B0B8C1; font-size: 14px; text-align: center; flex: none; }
.crit .input { padding: 12px 14px; font-weight: 700; font-size: 15px; }
.crit .input.w { width: 74px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.crit .pct { color: var(--gray); font-size: 13px; font-weight: 600; }
.crit .ta { min-height: 56px; padding: 12px 14px; font-size: 14px; }
.crit .x { border: 0; background: transparent; color: #B0B8C1; font-size: 22px; padding: 0 2px; flex: none; }
.wsum { margin-top: 10px; font-size: 13.5px; font-weight: 700; }
.wsum.ok { color: #0B8A3C; }
.wsum.bad { color: var(--red); }

/* document attach */
.attach { display: flex; gap: 12px; align-items: center; background: #fff; border: 1.5px dashed #C9D1DB; border-radius: 16px; padding: 14px 16px; margin-bottom: 18px; cursor: pointer; }
.attach:active { background: #FAFBFC; }
.attach.off { opacity: .5; pointer-events: none; }
.attach .ico { font-size: 22px; flex: none; }
.attach .txt b { display: block; font-size: 14.5px; }
.attach .txt small { color: var(--gray); font-size: 12px; }
.docchip { background: var(--blue-bg); color: var(--blue); border-radius: 12px; padding: 10px 14px; font-size: 13px; font-weight: 600; margin: -8px 0 18px; }
.docchip ul { margin: 6px 0 0; padding-left: 16px; font-weight: 500; color: #1B64DA; }
.docchip li { margin: 2px 0; }

/* boost */
.delta { display: inline-block; background: var(--bg); border-radius: 10px; padding: 7px 12px; font-size: 13px; color: var(--ink2); margin: -8px 0 14px; font-weight: 600; }
.delta b { margin-left: 4px; }
.delta.up b { color: #0B8A3C; } .delta.down b { color: var(--red); }
.axis .v small { display: block; font-size: 10px; font-weight: 700; line-height: 1; margin-top: 1px; }
.axis .v small.up { color: #0B8A3C; } .axis .v small.down { color: var(--red); }
.hist { font-size: 12.5px; color: var(--gray); margin: -4px 0 12px; font-weight: 600; }
.hist b { color: var(--ink); }
.detail .acts.three { grid-template-columns: 0.8fr 1.4fr 1.2fr; }
.btn.boost { background: #F1E8FF; color: #7C3AED; }
.btn.boost:active:not(:disabled) { background: #E6D6FF; }
.weak { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.weak:last-child { border-bottom: 0; }
.weak b { color: var(--red); }
.weak span { color: var(--gray); font-size: 13px; margin-left: 4px; }
.weak p { margin: 3px 0 0; color: var(--ink2); }
.chg { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.chg:last-child { border-bottom: 0; }
.chg .tag { margin: 0 0 6px; display: inline-block; }
.chg b { display: block; margin-bottom: 3px; }
.chg p { margin: 0; color: var(--ink2); font-size: 13.5px; }
.ta.tall { min-height: 220px; }
