:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #152238;
  --muted: #5d6b82;
  --line: #dbe4f0;
  --primary: #0d6efd;
  --primary-strong: #0a58ca;
  --shadow: 0 18px 50px rgba(17, 29, 52, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Pretendard Variable", "SUIT Variable", "Noto Sans KR", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 520px at 0% -10%, #d9e8ff 0%, transparent 60%),
    radial-gradient(900px 420px at 100% 0%, #dff8f1 0%, transparent 55%),
    var(--bg);
  min-height: 100vh;
}

.site-header {
  border-bottom: 1px solid rgba(21, 34, 56, 0.08);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  text-decoration: none;
  color: var(--text);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.top-nav {
  display: flex;
  gap: 8px;
}

.tab {
  appearance: none;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.tab.active,
.tab:hover,
.tab:focus-visible {
  color: var(--text);
  border-color: var(--line);
  background: #fff;
  outline: none;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
}

.page {
  max-width: 1140px;
  margin: 28px auto;
  padding: 0 20px 36px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 24px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.field-block {
  margin-bottom: 18px;
}

.field-label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

.toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.toggle-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  color: var(--muted);
  height: 42px;
  font-weight: 600;
  cursor: pointer;
}

.toggle-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #2493ff);
  border-color: transparent;
}

.toggle-btn:focus-visible,
.money-input:focus-visible,
.stepper input:focus-visible,
.step-btn:focus-visible,
.quick-btn:focus-visible,
.action-btn:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.28);
  outline-offset: 2px;
}

.money-input-wrap {
  position: relative;
}

.money-input {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 48px 0 14px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
}

.unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
}

.quick-buttons {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.quick-btn:hover {
  background: #f5f9ff;
}

.grid-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stepper {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.step-btn {
  border: 0;
  height: 42px;
  background: #f5f9ff;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.stepper input {
  border: 0;
  text-align: center;
  height: 42px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}

.helper {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.result-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.headline {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, #f6faff, #eff8ff);
  padding: 16px;
}

.caption {
  color: var(--muted);
  font-size: 13px;
}

.net-pay {
  margin-top: 6px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.03em;
  font-weight: 800;
  color: #0a4cb5;
}

.deduction-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.deduction-box h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.deduction-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.deduction-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  padding: 4px 0;
}

.deduction-list li strong {
  color: var(--text);
  letter-spacing: -0.01em;
}

.deduction-list .label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tip {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #b9c7dc;
  background: #fff;
  color: #58708d;
  font-size: 12px;
  line-height: 1;
  cursor: help;
  position: relative;
  padding: 0;
}

.tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: 200px;
  background: #172335;
  color: #f6f8fb;
  font-size: 12px;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease;
  pointer-events: none;
  z-index: 2;
}

.tip:hover::after,
.tip:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.sum {
  border-top: 1px dashed var(--line);
  margin-top: 6px;
  padding-top: 10px;
}

.sum span,
.sum strong {
  color: var(--text);
  font-weight: 700;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.action-btn {
  height: 42px;
  border: 1px solid var(--primary);
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.action-btn:hover {
  background: var(--primary-strong);
}

.action-btn.secondary {
  color: var(--text);
  border-color: var(--line);
  background: #fff;
}

.action-btn.secondary:hover {
  background: #f5f9ff;
}

.info-panel {
  max-width: 1140px;
  margin: 28px auto;
  padding: 0 20px 36px;
}

.info-panel.active {
  display: block;
}

.info-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.info-card h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

.info-card p {
  color: var(--muted);
  line-height: 1.6;
}

.info-card ul {
  margin: 14px 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.7;
}

@media (max-width: 980px) {
  .page {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .panel {
    padding: 18px;
    border-radius: 18px;
  }

  .grid-fields {
    grid-template-columns: 1fr;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .top-nav {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }
}
