@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #93c5fd;
  --accent: #2563eb;
  --accent2: #1d4ed8;
  --accent-light: rgba(37,99,235,0.08);
  --accent-lighter: rgba(37,99,235,0.04);
  --text: #0f172a;
  --text-muted: #64748b;
  --positive: #059669;
  --negative: #dc2626;
  --info: #0284c7;
  --warning: #d97706;
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.04);
  --shadow: 0 4px 16px rgba(15,23,42,0.08), 0 1px 4px rgba(15,23,42,0.04);
  --shadow-lg: 0 12px 40px rgba(15,23,42,0.12), 0 4px 8px rgba(15,23,42,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  padding: 0 0 80px 0;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
header {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 40%, #fafbff 100%);
  border-bottom: 1px solid var(--border);
  padding: 44px 32px 36px;
  position: relative;
  overflow: hidden;
}
header::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.07) 0%, transparent 70%);
  pointer-events: none;
}
header::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 10%;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.04) 0%, transparent 70%);
  pointer-events: none;
}
.law-badge {
  display: inline-flex;
  align-items: center;
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 1.5px;
  border: 1px solid rgba(37,99,235,0.3);
  background: rgba(37,99,235,0.06);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
  text-transform: uppercase;
}
header h1 {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}
header h1 span { color: var(--accent); }
header p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.85;
  max-width: 700px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 36px 24px 0; }

/* ── Vertical Tab Layout ── */
.tab-layout {
  display: flex;
  gap: 0;
  align-items: flex-start;
}
.tabs {
  display: flex;
  flex-direction: column;
  width: 168px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 24px;
  gap: 2px;
  padding: 4px 0;
}
.tab-btn {
  background: none;
  border: none;
  border-right: 3px solid transparent;
  color: var(--text-muted);
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px 10px 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s;
  white-space: nowrap;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  line-height: 1.4;
  text-decoration: none;
}
.tab-btn.active {
  color: var(--accent);
  background: var(--accent-light);
  border-right-color: var(--accent);
  font-weight: 700;
}
.tab-btn:hover:not(.active) {
  color: var(--text);
  background: var(--surface2);
}
.tab-content {
  flex: 1;
  min-width: 0;
  padding-left: 32px;
}
.tab-panel { display: block; }

/* ── Cards / Sections ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s;
}
.card:hover {
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.1px;
}
.card-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 14px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Form elements ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0;
}
label .req { color: var(--accent); margin-left: 2px; }

select, input[type="number"], input[type="text"] {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 13px;
  padding: 9px 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  appearance: none;
}
select:focus, input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  background: var(--surface);
}
select option { background: var(--surface2); }

.hint {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 2px;
}

/* ── Toggle checkbox ── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 13px; flex: 1; font-weight: 500; color: var(--text); }
.toggle-sub { font-size: 12px; color: var(--text-muted); display: block; margin-top: 2px; }

/* Custom checkbox */
.chk { display: none; }
.chk-box {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
  background: var(--surface2);
}
.chk:checked + .chk-box {
  background: var(--accent);
  border-color: var(--accent);
}
.chk:checked + .chk-box::after { content: '✓'; font-size: 12px; color: #fff; font-weight: 700; }

/* ── Calc Button ── */
.calc-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #ffffff;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 24px;
  letter-spacing: 0.5px;
  transition: background 0.18s, transform 0.1s, box-shadow 0.18s;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.calc-btn:hover {
  background: var(--accent2);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
  transform: translateY(-1px);
}
.calc-btn:active { transform: scale(0.99) translateY(0); box-shadow: none; }

/* ── Result ── */
#result-panel {
  display: none;
  margin-top: 28px;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

.result-header {
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 16px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.result-header::before {
  content: '공제금액';
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 14px;
  border-radius: 20px;
  letter-spacing: 2px;
}
.result-total {
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  font-size: 38px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -1px;
}
.result-unit { font-size: 16px; color: var(--text-muted); margin-left: 4px; font-weight: 500; }

.result-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.result-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-xs);
}
.result-item-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.result-item-value {
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--positive);
  letter-spacing: -0.3px;
}
.result-item-value.zero { color: var(--text-muted); }
.result-item-value.negative { color: var(--negative); font-weight: 700; }
.result-item-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.accent-item { border-top: 2px solid var(--accent); background: #eff6ff; }

/* ── Headcount input table ── */
.hc-input-table { width:100%; border-collapse:collapse; font-size:13px; }
.hc-input-table th, .hc-input-table td { border:1px solid var(--border); padding:9px 12px; vertical-align:middle; }
.hc-input-table thead th { background:var(--surface2); font-weight:600; color:var(--accent); text-align:center; font-size:12px; white-space:nowrap; }
.hc-input-table td:first-child { background:#fafbfc; font-size:12px; font-weight:600; white-space:nowrap; min-width:90px; }
.hc-input-table tr.yr-cur td:first-child { background:var(--accent-light); color:var(--accent); }
.hc-input-table input.tbl-inp { width:100%; border:none; background:transparent; text-align:right; font-size:13px; padding:2px 4px; color:var(--text); outline:none; font-family:inherit; }
.hc-input-table input.tbl-inp:focus { background:var(--accent-light); border-radius:2px; }
.hc-input-table input.tbl-inp::placeholder { color:#bbb; }
.hc-input-table td.tbl-gen { text-align:right; font-size:13px; color:var(--text-muted); padding-right:16px; background:rgba(0,0,0,0.02); min-width:110px; }

/* ── Multi-year credit summary ── */
.yr-credit-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:14px; }
.yr-credit-card { border:1px solid var(--border); border-radius:var(--radius); padding:14px 12px; text-align:center; background:var(--surface); box-shadow:var(--shadow-xs); }
.yr-credit-card.yr-active { border-color:var(--accent); background:var(--accent-light); }
.yr-credit-card.yr-inactive { opacity:0.4; }
.yr-credit-card.yr-partial { border-color:#f59e0b; background:#fffbeb; }
.yr-credit-tag { font-size:10px; font-weight:700; letter-spacing:1px; color:var(--text-muted); margin-bottom:6px; text-transform:uppercase; }
.yr-credit-val { font-family:'Inter','Noto Sans KR',sans-serif; font-size:16px; font-weight:700; color:var(--accent); }
.yr-credit-card.yr-inactive .yr-credit-val { color:var(--text-muted); }
.yr-credit-card.yr-partial .yr-credit-tag { color:#b45309; }
.yr-credit-card.yr-partial .yr-credit-val { color:#b45309; }
.yr-credit-sub { font-size:11px; color:var(--text-muted); margin-top:5px; line-height:1.5; }

.credit-total-row { background:var(--surface); border:1px solid rgba(37,99,235,0.25); border-radius:var(--radius); padding:14px 18px; display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; flex-wrap:wrap; gap:8px; box-shadow:var(--shadow-xs); }
.credit-total-label { font-size:13px; font-weight:700; color:var(--accent); }
.credit-total-val { font-family:'Inter','Noto Sans KR',sans-serif; font-size:22px; font-weight:700; color:var(--accent); letter-spacing:-0.5px; }
.credit-net-row { background:#eff6ff; border:1px solid var(--border); border-radius:var(--radius); padding:12px 18px; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; }
.credit-net-label { font-size:12px; font-weight:600; color:#374151; }
.credit-net-val { font-family:'Inter','Noto Sans KR',sans-serif; font-size:16px; font-weight:700; color:var(--positive); }

/* ── Info Table ── */
.info-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.info-table th, .info-table td {
  border: 1px solid var(--border);
  padding: 9px 13px;
  text-align: left;
  vertical-align: middle;
}
.info-table th {
  background: var(--surface2);
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
  text-align: center;
  font-size: 12px;
}
.info-table td { color: var(--text); line-height: 1.65; }
.info-table tr:nth-child(even) td { background: #fafbfd; }
.info-table td.amt, .info-table th.amt {
  text-align: right;
  white-space: nowrap;
  padding-right: 18px;
  font-feature-settings: "tnum";
  font-family: 'Inter', sans-serif;
}
.info-table td.ctr { text-align: center; }

/* ── Notice ── */
.notice {
  background: rgba(37,99,235,0.04);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  font-size: 13px;
  color: #374151;
  line-height: 1.75;
  margin-bottom: 16px;
}
.notice strong { color: var(--accent); }

.notice-warning {
  background: rgba(220,38,38,0.04);
  border-left: 3px solid var(--negative);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  font-size: 13px;
  color: #374151;
  line-height: 1.8;
  margin-bottom: 16px;
}
.notice-warning .notice-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--negative);
  margin-bottom: 6px;
}
.notice-warning strong { color: var(--negative); font-weight: 600; }

/* ── Tab section label ── */
.tab-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 8px;
}
.tab-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  padding: 4px 14px 2px;
  text-transform: uppercase;
}

/* ── Law text ── */
.law-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.law-article-header {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.law-article-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.law-article-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.law-article-body {
  padding: 16px 18px;
  font-size: 12.5px;
  line-height: 2.0;
  color: var(--text);
}
.law-para {
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.law-para:last-child { margin-bottom: 0; }
.law-para-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 3px;
  min-width: 28px;
}
.law-para-text { flex: 1; }
.law-sub {
  margin-top: 6px;
  margin-left: 16px;
  font-size: 12px;
  color: #374151;
  line-height: 1.8;
}
.law-sub-item {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  align-items: flex-start;
}
.law-sub-item-num {
  font-size: 11px;
  color: var(--info);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 24px;
  padding-top: 2px;
}
.law-amended {
  display: inline-block;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 5px;
  margin-left: 4px;
  vertical-align: middle;
}
.law-emphasis { color: var(--accent); font-weight: 600; }
.law-article-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.law-article-block > .law-article-title {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.law-article-block > .law-article-body {
  padding: 16px 18px;
  font-size: 11.5px;
  line-height: 1.9;
}
.law-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12.5px; }
.law-table th { background: var(--surface2); border: 1px solid var(--border); padding: 7px 12px; text-align: center; font-weight: 600; white-space: nowrap; }
.law-table td { border: 1px solid var(--border); padding: 7px 12px; text-align: center; }
.law-safe { color: var(--positive); font-weight: 600; }
.law-tax  { color: var(--negative); font-weight: 600; }
.law-note { font-size: 11.5px; color: var(--text-muted); margin-top: 8px; }
.law-ol { padding-left: 20px; }
.law-ol-sub { padding-left: 16px; list-style-type: none; }
.law-tab-notice {
  background: rgba(37,99,235,0.04);
  border-left: 3px solid var(--info);
  padding: 13px 18px;
  font-size: 13px;
  color: #374151;
  line-height: 1.75;
  margin-bottom: 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── Calc log ── */
.calc-log {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: 'Inter', 'Noto Sans KR', monospace;
  font-size: 12px;
  color: #374151;
  line-height: 1.9;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.calc-log .log-title { color: var(--accent); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.calc-log .log-value { color: var(--info); }
.calc-log .log-total { color: var(--accent2); font-weight: 600; }
.calc-log .log-sep { color: var(--border); }

/* ── 예규·판례 탭 ── */
.ruling-notice {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 13px 18px;
  font-size: 12.5px;
  color: #374151;
  line-height: 1.75;
  margin-bottom: 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.ruling-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.ruling-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s;
}
.ruling-card:hover { box-shadow: var(--shadow-sm); }
.ruling-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}
.ruling-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.ruling-badge.type-ruling   { background: #dbeafe; color: #1e40af; }
.ruling-badge.type-mof      { background: #ede9fe; color: #5b21b6; }
.ruling-badge.type-tribunal { background: #ffedd5; color: #c2410c; }
.ruling-badge.type-court    { background: #d1fae5; color: #065f46; }
.ruling-badge.approx        { background: #f1f5f9; color: #64748b; }
.ruling-citation {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}
.ruling-topic {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.ruling-body {
  font-size: 13px;
  color: #374151;
  line-height: 1.8;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.ruling-point {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  line-height: 1.6;
}
.ruling-point strong { color: var(--accent); }

/* ── 문의하기 탭 ── */
.contact-wrap {}
.contact-faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
}
.contact-faq-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.contact-faq-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 14px;
  background: var(--accent);
  border-radius: 2px;
}
.contact-faq ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contact-faq li {
  font-size: 13px;
  color: #374151;
  line-height: 1.7;
}
.contact-faq li strong { color: var(--text); }
.contact-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-xs);
}
.contact-form-card .card-title { margin-bottom: 20px; }
.contact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.contact-field label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.contact-field input,
.contact-field textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 13px;
  padding: 10px 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  resize: vertical;
}
.contact-field input:focus,
.contact-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  background: var(--surface);
}
.contact-field input.error,
.contact-field textarea.error { border-color: #dc2626; }
.contact-error-msg {
  font-size: 12px;
  color: #dc2626;
  display: none;
  margin-top: 2px;
}
.contact-error-msg.show { display: block; }
.contact-success {
  display: none;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: #166534;
  margin-top: 16px;
}
.contact-success.show { display: block; }
.cf-file-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface2);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.18s;
}
.cf-file-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-lighter);
}
.cf-file-btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cf-file-pick-btn {
  font-size: 12px;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid rgba(37,99,235,0.25);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.cf-file-pick-btn:hover { background: rgba(37,99,235,0.14); }
.cf-file-hint { font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.cf-file-list { display: flex; flex-direction: column; gap: 6px; }
.cf-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
}
.cf-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cf-file-size { color: var(--text-muted); white-space: nowrap; }
.cf-file-remove {
  background: none; border: none;
  cursor: pointer; color: #9ca3af;
  font-size: 14px; line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}
.cf-file-remove:hover { color: #dc2626; }

/* ── Footer ── */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 40px 24px 32px;
  margin-top: 64px;
  font-size: 13px;
  line-height: 1.8;
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.site-footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 16px;
}
.site-footer-links a {
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s;
}
.site-footer-links a:hover { color: #fff; }
.site-footer-disclaimer { color: #94a3b8; font-size: 12px; line-height: 1.75; }
.site-footer-copy { color: #475569; font-size: 11.5px; }

/* ── Modal ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 36px 36px 28px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity:0; transform:translateY(16px) scale(0.97); } to { opacity:1; transform:translateY(0) scale(1); } }
.modal-close {
  position: absolute;
  top: 16px; right: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 30px; height: 30px;
  font-size: 16px; color: var(--text-muted);
  cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  padding-right: 32px;
  letter-spacing: -0.3px;
}
.modal-section { margin-bottom: 20px; }
.modal-section h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}
.modal-section p, .modal-section li {
  font-size: 13px;
  color: #374151;
  line-height: 1.8;
}
.modal-section ul { padding-left: 18px; }
.modal-section li { margin-bottom: 4px; }
.modal-updated {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ── 사후관리 ── */
.post-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.post-section-desc {
  font-size: 13px;
  color: #374151;
  line-height: 1.7;
  margin-bottom: 20px;
}
.post-scenario-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.post-scenario-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.18s;
}
.post-scenario-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37,99,235,0.2);
}
.post-scenario-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
.post-scenario { display: none; }
.post-scenario.active { display: block; }

.post-result-panel { display: none; margin-top: 20px; }
.post-result-panel.show { display: block; animation: fadeIn 0.3s ease; }

.징수-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.징수-badge.danger  { background: #fef2f2; color: #c0392b; border: 1px solid #fca5a5; }
.징수-badge.safe    { background: #f0fdf4; color: #1a7a4a; border: 1px solid #86efac; }
.징수-badge.partial { background: #fff7ed; color: #b45309; border: 1px solid #fcd34d; }

.post-amount-box {
  background: #fef2f2;
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.post-amount-box.safe { background: #f0fdf4; border-color: #86efac; }
.post-amount-box.partial { background: #fff7ed; border-color: #fcd34d; }
.post-amount-label { font-size: 12px; color: #374151; margin-bottom: 4px; font-weight: 600; }
.post-amount-value { font-family: 'Inter', 'Noto Sans KR', sans-serif; font-size: 28px; font-weight: 700; color: #c0392b; letter-spacing: -0.5px; }
.post-amount-value.safe { color: #1a7a4a; }
.post-amount-value.partial { color: #b45309; }
.post-amount-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.post-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.post-breakdown-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
}
.post-breakdown-label { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.post-breakdown-value { font-family: 'Inter', 'Noto Sans KR', sans-serif; font-size: 15px; font-weight: 600; color: var(--text); }
.post-breakdown-value.red { color: #c0392b; }
.post-breakdown-value.green { color: #1a7a4a; }

.post-log {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: 'Inter', 'Noto Sans KR', monospace;
  font-size: 12px;
  color: #374151;
  line-height: 1.9;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.post-log .pl { color: var(--accent); }
.post-log .pv { color: var(--info); }
.post-log .pt { color: #c0392b; font-weight: 700; }
.post-log .ps { color: #1a7a4a; font-weight: 700; }
.post-log .pp { color: #b45309; font-weight: 700; }

.post-notice-bar {
  background: rgba(192,57,43,0.04);
  border-left: 3px solid #c0392b;
  padding: 12px 16px;
  font-size: 13px;
  color: #374151;
  line-height: 1.7;
  margin-bottom: 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.post-notice-bar.safe-bar {
  background: rgba(26,122,74,0.04);
  border-left-color: #1a7a4a;
}


/* ── 상시근로자 수 계산 탭 ── */
.hc-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.hc-toolbar select,
.hc-toolbar input[type="number"],
.hc-toolbar input[type="text"] {
  width: auto;
  min-width: 80px;
}
.hc-toolbar-label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.hc-sheet-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 520px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.hc-table {
  border-collapse: collapse;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 11.5px;
  min-width: 100%;
  white-space: nowrap;
}
.hc-table thead tr.hc-head-info th {
  background: #eff6ff;
  color: var(--accent);
  font-weight: 700;
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.hc-table thead tr.hc-head-months th {
  background: var(--surface2);
  color: #374151;
  font-weight: 600;
  font-size: 10.5px;
  border: 1px solid var(--border);
  padding: 5px 7px;
  text-align: center;
  position: sticky;
  top: 35px;
  z-index: 10;
}
.hc-col-fixed {
  position: sticky;
  left: 0;
  z-index: 5;
  background: #f8fafc;
  font-weight: 600;
  color: var(--text);
}
.hc-table thead th.hc-col-fixed {
  z-index: 20;
  background: #dbeafe;
}
.hc-table td {
  border: 1px solid #e5e7eb;
  padding: 0;
  vertical-align: middle;
  background: #fff;
}
.hc-table td.hc-col-fixed {
  border: 1px solid var(--border);
  padding: 4px 8px;
}
.hc-table td input[type="text"],
.hc-table td input[type="date"],
.hc-table td select {
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 11.5px;
  color: var(--text);
  width: 100%;
  padding: 5px 7px;
  box-sizing: border-box;
}
.hc-table td input[type="text"]:focus,
.hc-table td input[type="date"]:focus,
.hc-table td select:focus {
  background: #eff6ff;
  outline: 1px solid var(--accent);
}
.hc-mon-cell {
  text-align: center;
  min-width: 48px;
  cursor: default;
}
.hc-mon-cell.active-full-youth { background: #dbeafe; color: #1d4ed8; font-weight: 700; font-size: 11px; }
.hc-mon-cell.active-part-youth { background: #e0f2fe; color: #0369a1; font-weight: 600; font-size: 11px; }
.hc-mon-cell.active-full  { background: #dcfce7; color: #166534; font-weight: 700; font-size: 11px; }
.hc-mon-cell.active-part  { background: #d1fae5; color: #065f46; font-weight: 600; font-size: 11px; }
.hc-mon-cell.inactive     { background: #f9fafb; color: #d1d5db; }
.hc-mon-cell.excluded     { background: #fef9c3; color: #92400e; }
.hc-sum-row td {
  background: #eff6ff !important;
  font-weight: 700;
  color: var(--accent);
  border-top: 2px solid var(--accent) !important;
}
.hc-result-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.hc-result-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}
.hc-result-item-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.hc-result-item-value { font-family: 'Inter', 'Noto Sans KR', sans-serif; font-size: 26px; font-weight: 700; color: var(--accent); letter-spacing: -0.5px; }
.hc-result-item-sub   { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.hc-legend {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted);
  margin-top: 10px; align-items: center;
}
.hc-legend-dot {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 3px; margin-right: 4px; vertical-align: middle;
}
.hc-add-btn {
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.18s;
  width: 100%;
  margin-top: 8px;
}
.hc-add-btn:hover { background: #eff6ff; border-color: var(--accent); }
.hc-del-btn {
  background: none; border: none;
  color: #dc2626; font-size: 13px;
  cursor: pointer; padding: 0 4px;
  line-height: 1;
}
.hc-del-btn:hover { color: #b91c1c; }
.hc-excel-btn {
  background: #fff;
  border: 1px solid #16a34a;
  border-radius: var(--radius);
  color: #16a34a;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.18s;
  width: auto;
  margin-top: 0;
}
.hc-excel-btn:hover { background: #f0fdf4; }
.hc-excel-btn.upload { border-color: #2563eb; color: #2563eb; }
.hc-excel-btn.upload:hover { background: #eff6ff; }
.hc-excel-btn.result { border-color: #7c3aed; color: #7c3aed; }
.hc-excel-btn.result:hover { background: #f5f3ff; }
.hc-notice {
  background: var(--accent-lighter);
  border-left: 3px solid var(--info);
  padding: 10px 14px;
  font-size: 13px;
  color: #374151;
  line-height: 1.8;
  margin-bottom: 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.hc-section-title {
  font-size: 13px; font-weight: 700;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  margin: 18px 0 10px;
  display: flex; align-items: center; gap: 8px;
}

a.tab-btn {
  display: block;
  text-decoration: none;
  color: var(--text-muted);
}
a.tab-btn.active { color: var(--accent); }
a.tab-btn:hover:not(.active) { color: var(--text); }

/* ── 반응형: 768px 이하 (모바일) ── */
@media (max-width: 768px) {
  header { padding: 28px 16px 22px; }
  header h1 { font-size: 21px; }
  header p { font-size: 12.5px; }
  .container { padding: 0; }

  /* 모바일: 세로 레이아웃으로 전환 */
  .tab-layout { flex-direction: column; }

  /* 사이드바를 상단 가로 탭 바로 변환 */
  .tabs {
    flex-direction: row;
    width: 100%;
    border-right: none;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
    background: var(--surface);
    box-shadow: 0 2px 8px rgba(15,23,42,0.06);
  }
  .tabs::-webkit-scrollbar { display: none; }

  /* 모바일에서 구분선·섹션 레이블 숨기기 */
  .tab-divider { display: none; }
  .tab-section-label { display: none; }

  .tab-btn {
    border-right: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 12px 14px;
    min-height: 44px;
    white-space: nowrap;
    font-size: 12.5px;
    flex-shrink: 0;
    color: var(--text-muted);
  }
  .tab-btn.active {
    border-right-color: transparent;
    border-bottom-color: var(--accent);
    color: var(--accent);
    background: var(--accent-lighter);
    font-weight: 700;
  }
  .tab-content {
    padding-left: 0;
    padding-top: 0;
    padding: 20px 16px 0;
  }

  /* 결과 분해 그리드 */
  .result-breakdown { grid-template-columns: repeat(2, 1fr); }
  .post-breakdown-grid { grid-template-columns: repeat(2, 1fr); }
  .yr-credit-grid { grid-template-columns: repeat(3, 1fr); }
  .hc-result-box { grid-template-columns: repeat(2, 1fr); }
  .result-total { font-size: 28px; }

  /* 예규·판례 */
  .ruling-grid { grid-template-columns: 1fr; }

  /* 모달 */
  .modal-box { padding: 24px 20px 20px; border-radius: var(--radius); }
  .modal-title { font-size: 17px; }

  /* 사후관리 */
  .post-amount-value { font-size: 24px; }

  /* 푸터 */
  .site-footer { padding: 28px 16px 20px; margin-top: 40px; }

  /* 상시근로자 툴바 */
  .hc-toolbar { gap: 8px; }
  .hc-excel-btn { padding: 7px 12px; font-size: 11px; }

  .card { margin-bottom: 12px; }
}

/* ── 반응형: 480px 이하 (소형 스마트폰) ── */
@media (max-width: 480px) {
  header h1 { font-size: 18px; }
  header p { font-size: 12px; }

  /* 카드 패딩 축소 */
  .card { padding: 16px 14px; }
  .card-title { font-size: 13px; }

  /* 결과 분해 그리드: 소형 기기에서 1열 */
  .result-breakdown { grid-template-columns: 1fr; }
  .post-breakdown-grid { grid-template-columns: 1fr; }
  .yr-credit-grid { grid-template-columns: 1fr; }
  .hc-result-box { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  /* 결과 총계 숫자 크기 */
  .result-total { font-size: 22px; }
  .result-item-value { font-size: 16px; }

  /* 모달 */
  .modal-box { padding: 18px 14px 16px; }
  .modal-title { font-size: 15px; }
  .modal-backdrop { padding: 10px; }

  /* 사후관리 */
  .post-amount-value { font-size: 22px; }
  .post-amount-box { padding: 14px 14px; }

  /* 공지·안내 박스 */
  .notice { font-size: 12.5px; padding: 12px 14px; }
  .law-tab-notice { font-size: 12px; padding: 10px 12px; }

  /* 탭 버튼 */
  .tab-btn { padding: 11px 11px; font-size: 12px; }

  /* 푸터 */
  .site-footer { padding: 20px 14px 16px; }
  .site-footer-links { gap: 14px; }
  .site-footer-links a { font-size: 12px; }
  .site-footer-disclaimer { font-size: 11px; }

  /* 문의 폼 카드 */
  .contact-form-card { padding: 16px; }
  .contact-faq { padding: 14px 16px; }

  /* 예규 카드 */
  .ruling-card { padding: 14px 14px; }
  .ruling-topic { font-size: 13px; }
  .ruling-body { font-size: 12px; }

  /* 법령 탭 테이블 */
  .law-table { font-size: 11.5px; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .law-table th,
  .law-table td { padding: 7px 8px; }

  /* hc 결과 값 크기 */
  .hc-result-item-value { font-size: 18px; }
}
