:root {
  --bg: #f6f8ff;
  --card: #ffffff;
  --text: #121826;
  --muted: rgba(18, 24, 38, 0.68);
  --line: rgba(18, 24, 38, 0.12);
  --primary: #2f6bff;
  --danger: #e23b3b;
  --shadow: 0 10px 30px rgba(18, 24, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", Arial,
    "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, #dbe7ff, var(--bg));
  color: var(--text);
}

a {
  color: var(--primary);
}

.container {
  max-width: 1050px;
  margin: 0 auto;
  padding: 22px 16px;
}

@media (min-width: 1280px) {
  .container {
    max-width: none;
    width: calc(100vw - 390px);
    margin-left: 360px;
    margin-right: 16px;
  }
}

header h1 {
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.sub {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 980px) {
  .check-grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
  .span-2 {
    grid-column: 1 / -1;
  }

  .common-adjust-card {
    grid-column: 1;
  }

  .child-support-card {
    grid-column: 1;
  }

  .custody-help-card {
    grid-column: 2;
  }
}

@media (min-width: 1280px) {
  .check-grid {
    grid-template-columns: 1.35fr 0.95fr;
    align-items: start;
  }

  .checklist-left,
  .common-adjust-card,
  .child-support-card {
    grid-column: 1;
  }

  .checklist-right,
  .custody-help-card {
    grid-column: 2;
  }
}

.help-card h2 {
  margin-bottom: 4px;
}

.big-help {
  background: rgba(47, 107, 255, 0.035);
}

@media (min-width: 980px) {
  .grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.panel {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(47, 107, 255, 0.03);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(47, 107, 255, 0.25);
  background: rgba(47, 107, 255, 0.08);
  color: #1b4fe6;
  font-weight: 800;
  font-size: 13px;
}

.estimate {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.estimate-label {
  font-size: 12px;
  color: var(--muted);
}

.estimate-value {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.wiro-meta {
  display: grid;
  gap: 6px;
}

.wiro-gap {
  font-weight: 700;
  font-size: 13px;
}

.wiro-gap.good {
  color: #1b7f3b;
}

.wiro-gap.warn {
  color: #b45309;
}

.wiro-need {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.ratio-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(18, 24, 38, 0.08);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.ratio-bar .me {
  background: linear-gradient(90deg, rgba(47, 107, 255, 0.85), rgba(47, 107, 255, 0.35));
}

.ratio-bar .other {
  background: linear-gradient(90deg, rgba(18, 24, 38, 0.12), rgba(18, 24, 38, 0.06));
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 980px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1280px) {
  .summary-split {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .summary-split .panel {
    padding: 10px;
  }
}

.muted {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 10px;
}

.intro-split {
  display: grid;
  gap: 12px;
}

@media (min-width: 980px) {
  .intro-split {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.mt {
  margin-top: 12px;
}

.btn {
  border: 1px solid var(--line);
  color: var(--text);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.btn.primary {
  background: rgba(47, 107, 255, 0.1);
  border-color: rgba(47, 107, 255, 0.35);
}

.main-tab-btn.active {
  background: rgba(47, 107, 255, 0.14);
  border-color: rgba(47, 107, 255, 0.5);
  font-weight: 700;
}

.btn.danger {
  background: rgba(255, 122, 122, 0.12);
  border-color: rgba(255, 122, 122, 0.35);
}

.result-tab-btn.active {
  background: rgba(47, 107, 255, 0.14);
  border-color: rgba(47, 107, 255, 0.5);
  font-weight: 700;
}

.sticky-result {
  position: sticky;
  top: 10px;
  z-index: 20;
}

.sticky-result.at-bottom {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
}

#calculatorTab {
  position: relative;
  padding-bottom: 12px;
}

.impact-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.impact-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.impact-bar {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(18, 24, 38, 0.08);
  overflow: hidden;
}

.impact-fill {
  height: 100%;
  border-radius: 999px;
}

.impact-fill.pos {
  background: linear-gradient(90deg, rgba(47, 107, 255, 0.95), rgba(47, 107, 255, 0.45));
}

.impact-fill.neg {
  background: linear-gradient(90deg, rgba(226, 59, 59, 0.9), rgba(226, 59, 59, 0.4));
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.question {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.question .q-title {
  margin: 0 0 8px;
  font-weight: 650;
}

.question .q-help {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.options {
  display: grid;
  gap: 6px;
}

.opt {
  display: flex;
  gap: 8px;
  align-items: center;
}

.evidence-opt {
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px dashed rgba(47, 107, 255, 0.35);
  border-radius: 10px;
  background: rgba(47, 107, 255, 0.05);
}

.kpi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kpi .label {
  font-size: 12px;
  color: var(--muted);
}

.kpi .value {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-top: 6px;
  padding-bottom: 28px;
}

.footer-note {
  font-size: 11px;
  line-height: 1.5;
}

.footer-keywords {
  width: 100%;
  font-size: 10px;
  line-height: 1.4;
  color: rgba(18, 24, 38, 0.6);
  word-break: keep-all;
}

.footer-keywords a {
  color: rgba(47, 107, 255, 0.9);
  text-decoration: none;
}

.footer-keywords a:hover {
  text-decoration: underline;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(47, 107, 255, 0.05);
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 12px;
  color: rgba(18, 24, 38, 0.86);
}

.input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  min-width: 240px;
}

.field {
  display: grid;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  color: var(--muted);
}

.fine-print {
  font-size: 12px;
  line-height: 1.5;
}

.analysis-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 900px) {
  .analysis-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.analysis-summary-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.analysis-summary-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.analysis-summary-main {
  font-weight: 700;
  line-height: 1.45;
}

.analysis-summary-sub {
  margin-top: 6px;
  font-size: 12px;
}

.analysis-summary-lists {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

@media (min-width: 900px) {
  .analysis-summary-lists {
    grid-template-columns: 1fr 1fr;
  }
}

.analysis-list-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.analysis-summary-lists ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.6;
}

.analysis-summary-footnote {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.note {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(47, 107, 255, 0.04);
  margin-bottom: 10px;
}

.ad-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.board-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 980px) {
  .board-grid {
    grid-template-columns: 1fr 1.2fr;
  }
}

.board-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.board-item .title {
  font-size: 16px;
  font-weight: 700;
}

.board-item .meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.board-item .content {
  margin-top: 8px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.ad-banner {
  width: 500px;
  height: 100px;
  max-width: 100%;
  aspect-ratio: auto;
  min-height: 100px;
  margin: 0 auto;
  background-size: cover;
  background-position: center;
}

.ad-banner.placeholder {
  background: linear-gradient(120deg, #dbe7ff, #f6f8ff);
}

.ad-body {
  padding: 12px;
}

.ad-title {
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.wing {
  position: fixed;
  top: 16px;
  bottom: 16px;
  width: 340px;
  pointer-events: none;
  display: none;
}

.wing-stack {
  display: grid;
  gap: 10px;
  max-height: 100%;
  overflow: auto;
  padding: 6px;
  pointer-events: auto;
}

.wing-left {
  left: 10px;
}

.wing-right {
  right: 10px;
}

.wing-right {
  display: none !important;
}

.wing-ad {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.wing-ad .ad-banner {
  width: 300px;
  height: 100px;
  max-width: 100%;
  min-height: 100px;
}

.wiro-need {
  position: relative;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.wiro-need-trigger {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: default;
}

.wiro-need-pop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: min(560px, 88vw);
  margin: 0;
  padding: 10px 12px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.wiro-need-pop li {
  margin: 0;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(18, 24, 38, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wiro-need-pop li:last-child {
  border-bottom: 0;
}

.wiro-point-text {
  display: block;
  flex: 1;
  min-width: 0;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wiro-point-amount {
  display: block;
  flex: none;
  font-size: 11px;
  color: #1b4fe6;
  font-weight: 700;
  white-space: nowrap;
}

.wiro-need:hover .wiro-need-pop,
.wiro-need:focus-within .wiro-need-pop {
  display: block;
}

@media (max-width: 768px) {
  .wiro-need-pop {
    position: static;
    display: block;
    width: 100%;
    margin-top: 6px;
  }
}

.wing-ad .ad-body {
  padding: 10px;
}

@media (min-width: 1280px) {
  .wing {
    display: block;
  }
}
