/* Leapinity 계산기 화면 모양
   - 색·글꼴·버튼·위아래 막대는 lp-brand.css(Leapinity 공통, _leapinity-style 에서 복사)를 써요.
   - 여기는 계산기에만 필요한 모양. 색은 모두 --lp-* 변수로 써서 공통 파일만 바꾸면 따라 바뀌어요.
   - 사이트 고유 색: 초록(에메랄드) */
:root {
  --lp-accent: #0a7d5d; --lp-accent-ink: #0a7d5d; --lp-accent-ink-dark: #5ee0b8; --lp-on-accent: #ffffff;
  --c-accent-soft: #e3f6ef; --c-warn-bg: #fff4e0; --c-warn-ink: #8a4b00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --c-accent-soft: #123a3a; --c-warn-bg: #3a2a10; --c-warn-ink: #ffd18a; color-scheme: dark;
} }
:root[data-theme="dark"] { --c-accent-soft: #123a3a; --c-warn-bg: #3a2a10; --c-warn-ink: #ffd18a; color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { min-height: 100vh; display: flex; flex-direction: column; font-size: 16px; line-height: 1.65; }
main { flex: 1; padding-bottom: 8px; }
a { color: var(--lp-accent-ink); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--lp-focus); outline-offset: 2px; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.3; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--lp-card); color: var(--lp-ink); padding: 10px 16px; border-radius: 12px; }
.skip:focus { top: 12px; }
.muted { color: var(--lp-mute); }
[hidden] { display: none !important; }

/* 위 막대 */
.bar-all { min-height: 44px; padding: 0 16px; font-size: 14px; }
@media (max-width: 400px) { .bar-all { display: none; } }

/* 머리 */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding-top: 14px; font-size: 14px; color: var(--lp-mute); }
.crumbs a { color: var(--lp-soft); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.crumbs a:hover { text-decoration: underline; }
.page-head { padding-top: 6px; padding-bottom: 14px; }
.page-head h1 { font-size: clamp(26px, 6vw, 38px); font-weight: 800; margin: 4px 0 6px; display: flex; align-items: center; gap: 10px; }
.h1-emoji { font-size: .9em; }
.lead { color: var(--lp-soft); margin: 0; font-size: 17px; }

/* 첫 화면 */
.hero { padding-top: 36px; padding-bottom: 12px; text-align: center; }
.hero h1 { font-size: clamp(28px, 7vw, 48px); font-weight: 800; letter-spacing: -0.03em; margin: 10px 0 12px; }
.hero .lead { max-width: 640px; margin: 0 auto; }
.search { max-width: 560px; margin: 22px auto 14px; }
.search .lp-input { width: 100%; min-height: 54px; font-size: 17px; border-radius: 999px; padding: 0 22px; box-shadow: var(--lp-shadow); }
.cat-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.all { padding-top: 8px; }
.cat { margin-top: 26px; scroll-margin-top: 76px; }
.cat h2 { font-size: 21px; font-weight: 800; margin: 0 0 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.calc-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; text-decoration: none; color: var(--lp-ink);
  min-height: 44px; transition: transform .25s var(--lp-ease), border-color .2s; }
.calc-card:hover { border-color: var(--lp-accent); }
@media (hover: hover) { .calc-card:hover { transform: translateY(-2px); } }
.card-emoji { font-size: 28px; line-height: 1.2; flex: none; }
.card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-text b { font-size: 17px; font-weight: 800; }
.card-text span { color: var(--lp-soft); font-size: 14px; line-height: 1.5; }
.no-result { text-align: center; padding: 20px 0; }
.about { padding-left: 0; list-style: none; display: grid; gap: 10px; }
.about li { background: var(--lp-card); border: 1px solid var(--lp-line); border-radius: 16px; padding: 12px 16px; }

/* 계산기 */
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .result { position: sticky; top: 80px; } }
.calc-form, .result { padding: 20px; min-width: 0; }
@media (max-width: 480px) { .calc-form, .result { padding: 16px; border-radius: 20px; } }
.fields { display: grid; grid-template-columns: 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field .label { font-weight: 700; font-size: 15px; color: var(--lp-ink); }
.field .lp-input { width: 100%; }
.field select.lp-input { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.field textarea.lp-input { min-height: 200px; resize: vertical; line-height: 1.6; }
.field input[type="date"].lp-input { min-height: 48px; }
.input-unit { position: relative; display: flex; align-items: center; }
.input-unit .lp-input { padding-right: 58px; font-variant-numeric: tabular-nums; }
.unit { position: absolute; right: 14px; color: var(--lp-mute); font-weight: 600; pointer-events: none; font-size: 15px; }
.hint { font-size: 14px; color: var(--lp-mute); }
.money-read { color: var(--lp-accent-ink); font-weight: 600; min-height: 1.4em; }
.field-check .check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--lp-accent); flex: none; margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.form-actions .lp-btn { padding: 0 16px; font-size: 14px; }

.result-h { font-size: 15px; font-weight: 700; color: var(--lp-mute); margin: 0 0 10px; }
.big { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: 18px; background: var(--c-accent-soft); }
.big-label { font-size: 15px; font-weight: 700; color: var(--lp-soft); }
.big-value { font-size: clamp(28px, 7.5vw, 40px); font-weight: 800; letter-spacing: -0.02em; color: var(--lp-accent-ink); line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.big-sub { font-size: 15px; color: var(--lp-soft); }
.rows { margin: 12px 0 0; }
.rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--lp-line); }
.rows dt { color: var(--lp-soft); }
.rows dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rows .sum dt, .rows .sum dd { color: var(--lp-ink); font-weight: 800; }
.sub-h { font-size: 16px; margin: 18px 0 0; }
.note { font-size: 14px; color: var(--lp-soft); margin: 12px 0 0; }
.warn { background: var(--c-warn-bg); color: var(--c-warn-ink); padding: 10px 14px; border-radius: 12px; }
.ref-note { font-size: 13px; color: var(--lp-mute); margin: 14px 0 0; }
.more { margin-top: 14px; }
.more summary, .faq summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; }
.more summary::-webkit-details-marker, .faq summary::-webkit-details-marker { display: none; }
.more summary::before, .faq summary::before { content: '▸'; color: var(--lp-accent-ink); transition: transform .2s; flex: none; }
.more[open] summary::before, .faq[open] summary::before { transform: rotate(90deg); }
.table-wrap { max-height: 420px; overflow: auto; border: 1px solid var(--lp-line); border-radius: 12px; margin-top: 8px; }
.sched { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.sched th, .sched td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--lp-line); white-space: nowrap; }
.sched th { position: sticky; top: 0; background: var(--lp-card); color: var(--lp-soft); }
.sched td:first-child, .sched th:first-child { text-align: center; }

.bmi-scale { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bmi-scale li { border: 1px solid var(--lp-line); border-radius: 12px; padding: 6px 8px; display: flex; flex-direction: column; font-size: 13px; color: var(--lp-soft); }
.bmi-scale li b { color: var(--lp-ink); font-size: 13px; }
.bmi-scale li.on { border: 2px solid var(--lp-accent); background: var(--c-accent-soft); }

/* 학점 표 */
.grades { display: grid; gap: 8px; }
.grade-row { display: grid; grid-template-columns: 24px 1fr 1fr 44px; gap: 8px; align-items: center; }
.g-no { color: var(--lp-mute); font-weight: 700; text-align: center; }
.icon-x { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--lp-line); background: var(--lp-card); color: var(--lp-soft); cursor: pointer; font-size: 16px; }
.icon-x:hover { color: var(--lp-ink); border-color: var(--lp-soft); }
.add-row { margin-top: 8px; align-self: flex-start; }

/* 아래 내용 */
.sources { margin-top: 18px; padding: 14px 18px; border-radius: 16px; border: 1px dashed var(--lp-line); background: var(--lp-card); font-size: 14px; color: var(--lp-soft); }
.sources p { margin: 0 0 6px; }
.sources ul { margin: 0; padding-left: 18px; }
.sources li a { display: inline-block; padding: 6px 0; min-height: 32px; }
.content { margin-top: 30px; }
.content h2 { font-size: 21px; font-weight: 800; margin: 0 0 10px; }
.content p, .content li { color: var(--lp-ink); }
.steps { padding-left: 22px; margin: 0; }
.steps li { margin: 4px 0; }
.formula { overflow-wrap: anywhere; }
.formula ul { padding-left: 20px; }
.faq { background: var(--lp-card); border: 1px solid var(--lp-line); border-radius: 16px; padding: 4px 16px; margin-bottom: 8px; }
.faq p { margin: 0 0 12px; color: var(--lp-soft); }
.mini-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mini-card { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 14px; border-radius: 16px; background: var(--lp-card); border: 1px solid var(--lp-line);
  color: var(--lp-ink); text-decoration: none; font-weight: 700; font-size: 15px; }
.mini-card:hover { border-color: var(--lp-accent); }
.mini-emoji { font-size: 20px; }
.legal h2 { font-size: 18px; margin-top: 24px; }
.legal a { overflow-wrap: anywhere; }
.nf { text-align: center; padding-top: 40px; }
.nf h1 { justify-content: center; }
.nf-emoji { font-size: 56px; margin: 0; }
.nf .lp-btn { margin-top: 18px; }

/* 아래쪽 */
.foot-cats { display: flex; flex-wrap: wrap; gap: 0 18px; width: 100%; }
.foot-cats a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
.foot-cats a:hover { color: var(--lp-foot-hi); }
.ad-slot { margin-top: 20px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0;
  background: var(--lp-ink); color: var(--lp-bg); padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 15px;
  transition: opacity .25s, transform .25s; pointer-events: none; z-index: 90; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .calc-card, .toast, .more summary::before, .faq summary::before { transition: none; }
  .calc-card:hover { transform: none; }
}
@media print {
  .lp-bar, .lp-foot, .form-actions, .ad-slot, .crumbs { display: none; }
}

/* ---------- Leapinity의 다른 도구 (아래쪽 바로 위, 카드 3장. 휴대폰은 한 줄씩) ---------- */
.lp-more { margin-top: 40px; margin-bottom: 8px; }
.lp-more-h { margin: 0 0 12px; font-size: 15px; font-weight: 700; letter-spacing: .01em; color: var(--lp-soft); }
.lp-more-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lp-more-card { display: flex; align-items: center; gap: 12px; min-height: 64px; height: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: 18px;
  background: var(--lp-card); border: 1px solid var(--lp-line); color: var(--lp-ink); text-decoration: none; transition: transform .25s ease, border-color .25s; }
.lp-more-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--lp-vio) 45%, var(--lp-line)); }
.lp-more-card:focus-visible { outline: 3px solid var(--lp-focus); outline-offset: 2px; }
.lp-more-ic { flex: none; width: 40px; height: 40px; }
.lp-more-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.lp-more-txt b { font-size: 15.5px; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
.lp-more-txt span { font-size: 13.5px; color: var(--lp-soft); line-height: 1.4; word-break: keep-all; }
.lp-more-go { flex: none; font-size: 22px; line-height: 1; color: var(--lp-mute); }
@media (max-width: 720px) {
  .lp-more { margin-top: 32px; }
  .lp-more-list { grid-template-columns: 1fr; gap: 8px; }
  .lp-more-card { min-height: 56px; padding: 10px 12px; }
  .lp-more-ic { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .lp-more-card { transition: none; } .lp-more-card:hover { transform: none; } }

/* 돈 칸: 못 읽음·너무 큼 안내, '만 원 단위로 넣었나요?' 바꾸기 단추 */
.money-read.bad { color: var(--c-warn-ink, #b45309); }
.money-fix { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; padding: 8px 10px; border-radius: 14px; background: var(--c-accent-soft); font-size: 14.5px; font-weight: 600; color: var(--lp-ink); }
.money-fix[hidden] { display: none; }
.money-fix .lp-btn { min-height: 44px; padding: 0 14px; font-size: 14px; }
