/*
 * 정리연구소 — 공통 스타일 (시안 D: 단정한 구성 + 산뜻한 파스텔)
 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --ink: #1d1b29;
  --sub: #575468;
  --muted: #9c99ad;
  --line: #ece9f3;
  --line-soft: #f3f1f8;
  --paper: #faf9fd;
  --sheet: #ffffff;
  --violet: #6c4cf5;
  --violet-weak: #f0ecff;
  --pink: #ff6f9f;
  --pink-weak: #ffeef5;
  --mint: #22b98a;
  --sun: #ffb238;
  --sky: #3c9cff;
  --minus: #e5486f;
  --stamp: #6c4cf5;   /* 이전 이름 호환 */
  --marker: #ffd6e6;
  --ok: #138a63;
  --mono: 'Pretendard Variable', Pretendard, sans-serif;
  --max: 1120px;
  --shadow: 0 18px 40px -26px rgba(60,40,140,.38);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: var(--ink);
  line-height: 1.65;
  word-break: keep-all;
  font-feature-settings: 'tnum';
  background:
    radial-gradient(900px 520px at 8% -6%, #ffe3ee 0%, transparent 62%),
    radial-gradient(800px 520px at 96% 4%, #e6e0ff 0%, transparent 60%),
    radial-gradient(900px 600px at 50% 105%, #dcf7ee 0%, transparent 60%),
    #fdfcff;
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
::selection { background: var(--marker); }
svg.i { width: 24px; height: 24px; }

/* ---------- 머리글 ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(253,252,255,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(236,233,243,.9); }
.site-header .inner { max-width: var(--max); margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none !important; }
.logo .seal {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 14px;
  background: conic-gradient(from 210deg, #ff8fb8, #9f8bff, #6fe0c4, #ffd36e, #ff8fb8); text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.logo b { font-size: 18px; font-weight: 800; letter-spacing: -.5px; }
.logo small { display: none; }
.nav-toggle { display: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; font: inherit; font-size: 14px; font-weight: 700; color: var(--sub); cursor: pointer; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { padding: 8px 13px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--sub); text-decoration: none; }
.site-nav a:hover { background: #fff; color: var(--ink); }
.site-nav a.on { background: var(--violet-weak); color: var(--violet); }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; gap: 2px; padding: 8px 16px 14px; box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; }
}

/* ---------- 본문 ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 28px 24px 64px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.crumb a { color: var(--muted); }
.page-head { margin: 0 0 26px; }
.page-head .no { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .5px; color: var(--violet); background: var(--violet-weak); padding: 4px 10px; border-radius: 99px; }
.page-head h1 { font-size: clamp(28px, 4.4vw, 40px); line-height: 1.22; margin: 12px 0 8px; letter-spacing: -1.4px; font-weight: 800; }
.page-head p { margin: 0; color: var(--sub); font-size: 16.5px; max-width: 680px; }
mark { background: linear-gradient(transparent 58%, var(--marker) 58%); color: inherit; padding: 0 2px; }

.desk { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; align-items: start; }
.desk.wide { grid-template-columns: 1fr; }
@media (max-width: 880px) { .desk { grid-template-columns: 1fr; } }
.desk > .slip-col { position: sticky; top: 84px; }
@media (max-width: 880px) { .desk > .slip-col { position: static; } }

.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: 22px; padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel > h2 { font-size: 16.5px; margin: 0 0 18px; font-weight: 800; display: flex; align-items: center; gap: 10px; letter-spacing: -.3px; }
.panel > h2 .step { width: 24px; height: 24px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #b4a3ff, #6c4cf5); }

/* ---------- 입력 ---------- */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }
.field > label, .field > .label { display: block; font-size: 13.5px; font-weight: 600; color: var(--sub); margin-bottom: 7px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1.5px solid #e4e0f0; border-radius: 12px; padding: 11px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-weak); }
input[type=number] { -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit-wrap { position: relative; }
.unit-wrap input { padding-right: 46px; font-weight: 700; font-size: 17px; }
.unit-wrap .unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.readout { font-size: 12.5px; color: var(--violet); margin-top: 5px; min-height: 18px; font-weight: 600; }

.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 4px; width: fit-content; max-width: 100%; }
.seg button { font: inherit; font-size: 14px; font-weight: 600; background: none; border: 0; padding: 8px 14px; border-radius: 9px; cursor: pointer; color: var(--sub); }
.seg button.on { background: #fff; color: var(--violet); box-shadow: 0 2px 8px -2px rgba(60,40,140,.25); }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--sub); cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--violet); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 15px; font-weight: 700; border-radius: 12px; padding: 12px 20px; cursor: pointer;
  background: var(--ink); color: #fff; border: 1px solid var(--ink); text-decoration: none !important; transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -12px rgba(29,27,41,.6); }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.line { background: #fff; color: var(--ink); border-color: #e4e0f0; }
.btn.line:hover { border-color: var(--violet); color: var(--violet); box-shadow: none; }
.btn.sm { font-size: 13.5px; padding: 8px 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- 결과 카드 ---------- */
.slip { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 22px; font-size: 14.5px; box-shadow: 0 30px 60px -32px rgba(60,40,140,.38); position: relative; }
.slip-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.slip-head b { font-size: 15.5px; }
.slip-head span { font-size: 12.5px; color: var(--muted); }
.slip .total { background: linear-gradient(135deg, #f4f0ff, #ffeef5); border-radius: 18px; padding: 18px 18px 16px; }
.slip .total .k { font-size: 13px; color: var(--sub); font-weight: 600; }
.slip .total .v { font-size: clamp(28px, 4.6vw, 36px); font-weight: 800; letter-spacing: -1.5px; line-height: 1.25; }
.slip .total .v small { font-size: 16px; color: var(--sub); margin-left: 2px; letter-spacing: 0; font-weight: 700; }
.slip .total .sub { font-size: 13px; color: var(--sub); margin-top: 3px; }
.slip.empty .total .v { color: #cfcade; }
.lines { padding: 8px 2px 2px; }
.lines div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.lines div:last-child { border-bottom: 0; }
.lines div span:first-child { color: var(--sub); }
.lines div span:last-child { font-weight: 700; text-align: right; white-space: nowrap; }
.lines div.minus span:last-child { color: var(--minus); }
.lines div.sum { border-top: 1.5px solid var(--line); border-bottom: 0; margin-top: 4px; padding-top: 12px; }
.lines div.sum span { color: var(--ink); font-weight: 800; }
.slip .foot { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }

.note { background: var(--pink-weak); color: #a3284e; border-radius: 14px; padding: 12px 16px; font-size: 14px; margin-top: 14px; }
.note.plain { background: var(--paper); color: var(--sub); }
.note p { margin: 0; }
.note p + p { margin-top: 4px; }

/* ---------- 표 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; }
th { font-size: 13px; color: var(--sub); font-weight: 700; background: var(--paper); white-space: nowrap; }
td.num, th.num { text-align: right; }
td input { padding: 6px 8px; font-size: 14px; border-radius: 8px; }

/* ---------- 파일 ---------- */
.drop {
  display: block; border: 2px dashed #d9d3ec; border-radius: 20px; background: rgba(250,249,253,.8);
  padding: 38px 16px; text-align: center; cursor: pointer; transition: background .15s, border-color .15s;
}
.drop:hover, .drop.over { background: var(--violet-weak); border-color: var(--violet); }
.drop b { display: block; font-size: 16.5px; margin-bottom: 4px; }
.drop span { color: var(--muted); font-size: 13.5px; }
.drop input { display: none; }
.files { list-style: none; padding: 0; margin: 14px 0 0; }
.files li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; font-size: 14px; }
.files .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.files .mt { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.files .mt .down { color: var(--ok); font-weight: 700; }
.files img { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; background: var(--paper); }
.x { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 13px; color: var(--sub); }
.x:hover { border-color: var(--violet); color: var(--violet); }
.x:disabled { opacity: .3; cursor: default; }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #9f8bff, #ff8fb8); width: 0; transition: width .2s; }

/* ---------- 홈 ---------- */
.notice a { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 11px 16px; font-size: 14.5px; color: var(--ink); text-decoration: none; }
.notice a:hover { border-color: #ddd6f5; }
.notice b { color: var(--violet); }
.notice em { font-style: normal; margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.notice .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 4px #ffe3ee; flex: none; }
@media (max-width: 560px) { .notice em { display: none; } }

.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; padding: 40px 0 28px; }
@media (max-width: 880px) { .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 24px; } }
.hero h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.18; letter-spacing: -2px; margin: 0 0 16px; font-weight: 800; }
.hl { position: relative; white-space: nowrap; }
.hl svg { position: absolute; left: -4px; bottom: -10px; width: calc(100% + 8px); height: 18px; }
.hero > div > p { color: var(--sub); font-size: 17px; margin: 0 0 26px; }
@media (max-width: 560px) { .hero > div > p br { display: none; } .hero > div > p { font-size: 16px; } }
.search { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid #e4e0f0; border-radius: 16px; padding: 7px 7px 7px 16px; max-width: 520px; box-shadow: 0 14px 34px -22px rgba(108,76,245,.45); }
.search:focus-within { border-color: var(--violet); }
.search svg { color: var(--muted); flex: none; }
.search input { flex: 1; border: 0 !important; box-shadow: none !important; padding: 8px 0; min-width: 0; }
.search button { border: 0; background: var(--ink); color: #fff; font: inherit; font-weight: 700; padding: 11px 18px; border-radius: 11px; cursor: pointer; }
.asked { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); align-items: center; }
.asked a { color: var(--sub); border-bottom: 1px dashed #c9c4dc; text-decoration: none; }
.asked a:hover { color: var(--violet); border-color: var(--violet); }
.finder-result { margin-top: 10px; font-size: 14px; color: var(--sub); min-height: 20px; }

.mini { background: #fff; border-radius: 26px; padding: 24px; box-shadow: 0 30px 60px -30px rgba(60,40,140,.35), 0 0 0 1px var(--line); position: relative; }
.mini::before { content: ''; position: absolute; top: -14px; right: -14px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff, #ffc2d8 45%, #ff7aa8); z-index: -1; }
.mini::after { content: ''; position: absolute; left: -22px; bottom: 30px; width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff, #b9f0de 45%, #3fcf9f); z-index: -1; }
.mini .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.mini .top b { font-size: 16px; }
.mini .top span { font-size: 12px; font-weight: 700; color: var(--violet); background: var(--violet-weak); padding: 4px 9px; border-radius: 99px; }
.mini label { font-size: 13px; color: var(--sub); font-weight: 600; }
.mini .in { display: flex; align-items: center; border: 1.5px solid #e4e0f0; border-radius: 12px; padding: 0 14px; margin: 6px 0 4px; }
.mini .in:focus-within { border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-weak); }
.mini .in input { flex: 1; border: 0 !important; box-shadow: none !important; font-size: 20px; font-weight: 700; padding: 12px 0; min-width: 0; }
.mini .in span { color: var(--muted); }
.mini .kr { font-size: 12.5px; color: var(--violet); min-height: 18px; }
.mini .presets { display: flex; gap: 6px; margin: 8px 0 16px; flex-wrap: wrap; }
.mini .presets button { font: inherit; font-size: 13px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 5px 10px; cursor: pointer; color: var(--sub); }
.mini .presets button:hover { border-color: var(--violet); color: var(--violet); }
.mini .out { background: linear-gradient(135deg, #f4f0ff, #ffeef5); border-radius: 18px; padding: 18px; }
.mini .out small { color: var(--sub); font-size: 13px; font-weight: 600; }
.mini .net { font-size: 34px; font-weight: 800; letter-spacing: -1.5px; line-height: 1.25; }
.mini .bars { display: flex; height: 8px; border-radius: 99px; overflow: hidden; margin: 12px 0 8px; background: #fff; }
.mini .bars i { display: block; height: 100%; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--sub); }
.legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; background: var(--c); }
.mini .more { display: block; text-align: right; font-size: 14px; font-weight: 700; margin-top: 12px; }

.cat { padding: 34px 0 4px; scroll-margin-top: 80px; }
.cat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cat-head h2 { margin: 0; font-size: 22px; letter-spacing: -.7px; }
.cat-head .chip { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.cat-head .line { flex: 1; height: 1px; background: linear-gradient(90deg, #e3def0, transparent); }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool { display: flex; gap: 14px; align-items: flex-start; background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 20px; padding: 18px; color: var(--ink); text-decoration: none !important; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tool:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -22px rgba(60,40,140,.4); border-color: #ddd6f5; }
.tool.gone { display: none; }
.ic { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: #fff; flex: none; }
.tool h3 { margin: 0 0 3px; font-size: 16.5px; letter-spacing: -.4px; }
.tool p { margin: 0; font-size: 13.5px; color: var(--sub); line-height: 1.5; }
.g-pink { background: linear-gradient(135deg, #ff9ac0, #ff5f93); }
.g-violet { background: linear-gradient(135deg, #b4a3ff, #6c4cf5); }
.g-mint { background: linear-gradient(135deg, #8ff0d4, #22b98a); }
.g-sun { background: linear-gradient(135deg, #ffd98a, #ff9f1c); }
.g-sky { background: linear-gradient(135deg, #a3dbff, #3c9cff); }

.qa-title { margin: 48px 0 14px; font-size: 22px; letter-spacing: -.7px; }
.qa { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 860px) { .qa { grid-template-columns: 1fr; } }
.qa a { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; color: var(--ink); text-decoration: none; transition: border-color .15s; }
.qa a:hover { border-color: #ddd6f5; }
.qa b { display: block; font-size: 15.5px; margin-bottom: 6px; }
.qa span { font-size: 14px; color: var(--sub); line-height: 1.55; display: block; }
.qa em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--violet); display: inline-block; margin-top: 8px; }

/* ---------- 설명 글 ---------- */
.article { max-width: 780px; margin-top: 40px; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 24px; padding: 10px 30px 26px; }
@media (max-width: 560px) { .article { padding: 4px 18px 18px; } }
.article h2 { font-size: 20px; margin: 30px 0 10px; letter-spacing: -.5px; }
.article h3 { font-size: 16.5px; margin: 20px 0 6px; }
.article p, .article li { color: #3d3a4d; }
.article table { margin: 10px 0 18px; }
.faq details { border-bottom: 1px solid var(--line); padding: 15px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: '+'; color: var(--violet); font-weight: 700; font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin: 8px 0 0; color: var(--sub); }

.also { margin-top: 36px; }
.also h2 { font-size: 15px; color: var(--sub); margin: 0 0 12px; }
.also div { display: flex; flex-wrap: wrap; gap: 8px; }
.also a { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 8px 15px; font-size: 14px; text-decoration: none; color: var(--sub); font-weight: 600; }
.also a:hover { border-color: var(--violet); color: var(--violet); }

/* 휴대폰 결과 띠 */
.dock {
  display: none; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60;
  background: var(--ink); color: #fff; border: 0; border-radius: 16px; padding: 13px 18px;
  font: inherit; text-align: left; justify-content: space-between; align-items: center; gap: 12px;
  box-shadow: 0 16px 30px -12px rgba(29,27,41,.55); cursor: pointer;
}
.dock span { font-size: 13px; opacity: .7; }
.dock b { font-size: 18px; font-weight: 800; }
.dock b::after { content: ' ↓'; font-size: 13px; opacity: .6; }
@media (max-width: 880px) { .dock.show { display: flex; } }

.ad-slot:empty { display: none; }
.ad-slot { margin: 24px 0; text-align: center; }

/* ---------- 바닥글 ---------- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--line); background: rgba(255,255,255,.6); }
.site-footer .inner { max-width: var(--max); margin: 0 auto; padding: 28px 24px 48px; font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer nav a { color: var(--sub); margin-right: 18px; font-weight: 600; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

@media print {
  .site-header, .site-footer, .no-print, .ad-slot, .also, .article, .dock { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .panel { border: 0; padding: 0; box-shadow: none; }
}
