/* pay.those.kr 공통 디자인 (계산기 4종) */
  :root {
    --paper: #f5f1ea; --card: #fffdf9; --ink: #1f2b26; --sub: #5e6a64; --muted: #9aa39e;
    --line: #e4ddd1; --line2: #efe9df;
    --green: #1f7a5c; --green-d: #17604a; --green-soft: #e3f1ea;
    --c-net: #1f7a5c; --c-pension: #e0a03c; --c-health: #d9694f; --c-longterm: #b9577a;
    --c-employment: #7a6fc4; --c-incomeTax: #3f86c4; --c-localTax: #8fb8d9;
  }
  * { box-sizing: border-box; }
  body { margin: 0; background: var(--paper); color: var(--ink); font-family: Pretendard, -apple-system, "Malgun Gothic", sans-serif; -webkit-text-size-adjust: 100%; }
  .num { font-variant-numeric: tabular-nums; }

  header { max-width: 1040px; margin: 0 auto; padding: 30px 16px 26px; }
  .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--green); letter-spacing: .3px; }
  .eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--green); }
  h1 { margin: 10px 0 8px; font-size: 32px; font-weight: 800; letter-spacing: -1px; }
  .lead { margin: 0; color: var(--sub); font-size: 15.5px; }
  .basis { margin-top: 14px; font-size: 12.5px; color: var(--sub); display: flex; align-items: center; gap: 8px; }
  .basis::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); flex: none; }

  .calc { max-width: 1040px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: minmax(0, 1fr) 390px; grid-template-areas: 'in slip' 'btn slip'; gap: 18px 26px; align-items: start; }
  .inputs { grid-area: in; }
  .btns { grid-area: btn; }
  .slip-wrap { grid-area: slip; }

  /* ── 입력 ── */
  .inputs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
  .card { background: var(--card); border-radius: 20px; padding: 26px 28px 28px; box-shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgba(60, 50, 30, .25); }
  .step-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 22px; }
  .step-no { font-size: 14px; font-weight: 800; color: var(--green); }
  .step-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
  .opts { display: flex; flex-wrap: wrap; gap: 18px 28px; }
  .label { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--sub); margin-bottom: 9px; }

  .seg { display: inline-flex; background: var(--line2); border-radius: 999px; padding: 4px; }
  .seg button { border: 0; background: transparent; border-radius: 999px; padding: 10px 22px; font: inherit; font-size: 15.5px; font-weight: 600; color: var(--sub); cursor: pointer; transition: background .15s, color .15s; }
  .seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
  .seg button:disabled { cursor: not-allowed; opacity: .45; }

  .money { margin-top: 26px; }
  .amount-wrap { display: flex; align-items: baseline; gap: 10px; border-bottom: 2px solid var(--ink); padding: 4px 2px 8px; transition: border-color .15s; }
  .amount-wrap:focus-within { border-color: var(--green); }
  .won-sign { font-size: 28px; font-weight: 700; color: var(--muted); }
  .amount { flex: 1; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0; font: inherit; font-size: 40px; font-weight: 800; letter-spacing: -1px; color: var(--ink); }
  .amount::placeholder { color: #cdc6ba; }
  .unit { font-size: 16.5px; color: var(--sub); font-weight: 600; }
  .money-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
  .reading { font-size: 15.5px; color: var(--green); font-weight: 600; min-height: 20px; }
  .adds { display: flex; gap: 6px; flex-wrap: wrap; }
  .adds button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
  .adds button:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }

  .counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px 28px; }
  .stepper { display: inline-flex; align-items: center; gap: 4px; }
  .step { display: inline-flex; align-items: center; gap: 4px; }
  .step button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 21px; line-height: 1; color: var(--ink); cursor: pointer; }
  .step button:hover { border-color: var(--green); color: var(--green); }
  .step input { width: 48px; border: 0; background: transparent; text-align: center; font: inherit; font-size: 22px; font-weight: 700; color: var(--ink); outline: 0; }
  .nontax { display: inline-flex; align-items: center; gap: 8px; background: var(--paper); border-radius: 12px; padding: 0 14px; }
  .nontax input { width: 140px; height: 48px; border: 0; background: transparent; font: inherit; font-size: 19px; font-weight: 700; text-align: right; color: var(--ink); outline: 0; }
  .nontax:focus-within { box-shadow: 0 0 0 2px var(--green); }

  /* ── 결과: 급여명세서 영수증 (아래쪽 톱니 모양) ── */
  .slip-wrap { position: sticky; top: 18px; filter: drop-shadow(0 10px 18px rgba(60, 50, 30, .16)); }
  .slip { background: var(--card); padding: 26px 26px 36px; border-radius: 16px 16px 0 0;
    --z: 8px;
    -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--z)) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--z) * 2) var(--z) repeat-x;
            mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--z)) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--z) * 2) var(--z) repeat-x; }
  .slip-top { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
  .slip-top h2 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: 2px; }
  .slip-top span { font-size: 12px; color: var(--muted); }
  .gross-row { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 12px; font-size: 14px; color: var(--sub); }
  .gross-row strong { font-size: 18px; color: var(--ink); }

  .bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--line2); gap: 2px; }
  .bar span { flex: 0 1 0; min-width: 0; transition: flex-grow .3s; }
  .bar.empty span { flex-grow: 0 !important; }
  .bar [data-k="net"] { background: var(--c-net); }

  .slip-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 16px; }
  .list { list-style: none; margin: 0; padding: 0; }
  .list li { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
  .list li > span:first-child { display: flex; align-items: center; gap: 8px; color: var(--sub); }
  .list .rate { font-style: normal; font-size: 12.5px; color: var(--muted); margin-left: -3px; }
  .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
  .list li.sum { border-bottom: 0; padding-top: 12px; font-weight: 700; }
  .list li.sum > span:first-child { color: var(--ink); }
  .list .amt { color: var(--ink); font-weight: 600; }

  .net-box { background: var(--green-soft); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; }
  .net-label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--green-d); }
  .net-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
  .net-value { font-size: 31px; font-weight: 800; letter-spacing: -1px; color: var(--green-d); }
  .net-ratio { font-size: 12.5px; font-weight: 700; color: var(--green); }
  .net-rows { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid rgba(31, 122, 92, .18); display: grid; gap: 4px; }
  .net-rows div { display: flex; justify-content: space-between; font-size: 14px; }
  .net-rows dt { color: var(--sub); }
  .net-rows dd { margin: 0; font-weight: 700; color: var(--green-d); }

  .btns { display: flex; gap: 8px; }
  .btns button { font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 60px; border-radius: 14px; }
  .btns svg { width: 19px; height: 19px; }
  .copy { flex: 1; background: var(--ink); color: #fff; border: 0; }
  .copy:hover { background: #33433c; }
  .reset { padding: 0 28px; background: transparent; color: var(--sub); border: 1px solid var(--line); }
  .reset:hover { color: var(--ink); border-color: var(--sub); }

  /* 물음표 도움말: 마우스 오버(또는 터치/키보드 포커스)로 표시 */
  .q { position: relative; display: inline-flex; width: 17px; height: 17px; border-radius: 50%; border: 1.5px solid currentColor; color: var(--muted); font-size: 10.5px; font-weight: 800; align-items: center; justify-content: center; cursor: help; flex: none; outline: none; }
  .q:hover, .q:focus { color: var(--green); }
  .net-label .q { color: var(--green); }
  .q .tip { display: none; position: absolute; z-index: 10; left: -14px; top: 25px; width: 272px; background: var(--ink); color: #f3efe7; text-align: left; font-size: 12.5px; font-weight: 400; line-height: 1.65; padding: 11px 13px; border-radius: 10px; box-shadow: 0 8px 22px rgba(0,0,0,.2); white-space: normal; letter-spacing: 0; }
  .q .tip::before { content: ""; position: absolute; left: 16px; top: -10px; border: 5px solid transparent; border-bottom-color: var(--ink); }
  .q .tip b { color: #8fe0bd; font-weight: 700; }
  .q:hover .tip, .q:focus .tip { display: block; }

  .toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(10px); background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
  .toast.show { opacity: 1; transform: translateX(-50%); }

  .about { max-width: 1040px; margin: 56px auto 0; padding: 0 16px; color: #3d4843; font-size: 14.5px; line-height: 1.8; }
  .about h2 { font-size: 18px; margin: 30px 0 8px; color: var(--ink); }
  .about table { border-collapse: collapse; width: 100%; background: var(--card); font-size: 13.5px; border-radius: 12px; overflow: hidden; }
  .about th, .about td { border-bottom: 1px solid var(--line2); padding: 10px 12px; text-align: left; }
  .about th { background: var(--line2); font-weight: 700; }
  footer { max-width: 1040px; margin: 46px auto 30px; padding: 20px 16px 0; color: var(--muted); font-size: 13px; text-align: center; }
  footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; }
  footer nav a { color: var(--sub); text-decoration: none; padding: 4px 0; }
  footer nav a:hover { color: var(--green); text-decoration: underline; }
  footer p { margin: 0; }
  /* 광고 배치: [좌 광고] [본문] [우 광고] — 좌우는 화면 폭 1440px 이상에서만 */
  .layout { display: grid; grid-template-columns: minmax(0, 1fr); }
  .page { min-width: 0; }
  .ad-side { display: none; }
  .ad-band { max-width: 760px; margin: 36px auto 0; padding: 0 16px; }
  @media (min-width: 1440px) {
    .layout { grid-template-columns: 160px minmax(0, 1040px) 160px; column-gap: 24px; justify-content: center; }
    .ad-side { display: block; position: sticky; top: 24px; align-self: start; margin-top: 192px; }
    .ad-side[data-ad-slot="left"] { grid-column: 1; grid-row: 1; }
    .page { grid-column: 2; grid-row: 1; }
    .ad-side[data-ad-slot="right"] { grid-column: 3; grid-row: 1; }
  }

  @media (max-width: 860px) {
    .calc { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'in' 'btn' 'slip'; }
    .slip-wrap { position: static; }
    .slip-body { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .net-value { font-size: 30px; }
    header { padding-top: 20px; }
    h1 { font-size: 26px; }
    .card { padding: 22px 18px 24px; }
    .amount { font-size: 32px; }
    .btns button { height: 56px; font-size: 16.5px; }
  }
  @media (max-width: 400px) {
    .q .tip { width: 232px; }
    .seg button { padding: 9px 16px; }
    .adds button { padding: 8px 12px; font-size: 14px; }
    .slip { padding: 22px 18px 34px; }
    .net-box { padding: 18px; }
  }

  /* ── 상단 메뉴 (계산기 4종): 왼쪽 아이콘 · 가운데 메뉴 버튼 ── */
  .topnav { max-width: 1040px; margin: 0 auto; padding: 22px 16px 0; display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 12px; }
  .brand { display: inline-flex; text-decoration: none; }
  .brand i { width: 46px; height: 46px; border-radius: 13px; background: var(--green); color: #fff; font-style: normal; font-size: 23px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px -4px rgba(31, 122, 92, .5); }
  .brand:hover i { background: var(--green-d); }
  .tabs { justify-self: center; display: flex; gap: 6px; background: var(--line2); border-radius: 999px; padding: 6px; }
  .tabs a { flex: none; padding: 13px 24px; border-radius: 999px; font-size: 16.5px; font-weight: 700; color: var(--sub); text-decoration: none; white-space: nowrap; text-align: center; transition: background .15s, color .15s; }
  .tabs a:hover { color: var(--ink); background: rgba(255, 255, 255, .55); }
  .tabs a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 5px rgba(0,0,0,.13); }
  @media (max-width: 1000px) { .tabs a { padding: 12px 16px; font-size: 15.5px; } }
  @media (max-width: 860px) {
    /* 휴대폰: 아이콘은 위 왼쪽, 메뉴 4개는 2×2 로 모두 보이게 */
    .topnav { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 14px; }
    .brand i { width: 40px; height: 40px; font-size: 20px; border-radius: 11px; }
    .tabs { justify-self: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 18px; padding: 5px; gap: 5px; }
    .tabs a { padding: 12px 6px; font-size: 15.5px; border-radius: 13px; white-space: normal; }
  }

  /* ── 날짜·선택 입력 (퇴직금·실업급여) ── */
  .date { height: 48px; border: 0; border-radius: 12px; background: var(--paper); padding: 0 14px; font: inherit; font-size: 17px; font-weight: 700; color: var(--ink); outline: 0; min-width: 0; width: 100%; max-width: 230px; }
  .date:focus { box-shadow: 0 0 0 2px var(--green); }
  .seg.wrap { flex-wrap: wrap; border-radius: 18px; }
  .field-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
  .money.small { margin-top: 22px; }
  .money.small .amount { font-size: 28px; }
  .money.small .won-sign { font-size: 22px; }
  .warn { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: #fdf0e6; color: #9a4b1c; font-size: 14px; line-height: 1.6; }
  .warn[hidden] { display: none; }

  /* ── 결과 상자: 필요 연봉(실수령 계산기) · 큰 결과 ── */
  .need-box { margin-top: 16px; background: var(--ink); color: #fff; border-radius: 14px; padding: 18px 20px; }
  .need-box .net-label { color: #b9e6d3; }
  .need-box .net-label .q { color: #b9e6d3; }
  .need-box .net-value { color: #fff; }
  .need-box .net-rows { border-top-color: rgba(255,255,255,.18); }
  .need-box .net-rows dt { color: #c9d3ce; }
  .need-box .net-rows dd { color: #fff; }
  .kv-list { list-style: none; margin: 16px 0 0; padding: 0; }
  .kv-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; font-size: 14px; border-bottom: 1px dashed var(--line); }
  .kv-list li > span:first-child { color: var(--sub); display: flex; align-items: center; gap: 6px; }
  .kv-list li > span:last-child { font-weight: 600; text-align: right; }
  .kv-list li.sum { border-bottom: 0; font-weight: 700; }
  .kv-list li.sum > span:first-child { color: var(--ink); }
  .kv-list .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
  .need-box.need-last { margin-top: 14px; }

  /* ── 명세 높이 맞춤 (PC): 명세 아래 끝 = 명세 복사하기·다시 버튼 아래 끝 ──
     명세가 더 길면 왼쪽 마지막 카드가 늘어나고, 입력이 더 길면 명세가 늘어남 */
  @media (min-width: 861px) {
    .calc { align-items: stretch; grid-template-rows: minmax(0, 1fr) auto; }   /* 남는 높이는 입력 카드 쪽으로 */
    .inputs { display: flex; flex-direction: column; gap: 18px; }
    .inputs > .card:last-child { flex: 1; }
    .btns { align-self: end; }
    .slip-wrap { position: static; display: flex; flex-direction: column; }
    .slip { flex: 1; display: flex; flex-direction: column; }
    .slip > .field-note:last-child { margin-top: auto; padding-top: 14px; }   /* 안내 문구는 명세 맨 아래 */
  }
