.tool-page {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% 0, rgba(76, 124, 244, 0.07), transparent 32rem),
    #fbfcfe;
}

.tool-page main {
  padding-bottom: 84px;
}

.tool-page .hero {
  padding-top: 42px;
  padding-bottom: 30px;
}

.tool-page .hero h1 {
  font-size: clamp(34px, 5vw, 50px);
  text-wrap: balance;
  word-break: keep-all;
}

.tool-page .hero p {
  font-size: 16px;
}

.tool-page .standard-badge {
  color: #295fcf;
}

.tool-card {
  max-width: 980px;
  padding: 30px;
}

.tool-card-header {
  margin-bottom: 24px;
}

.tool-card-header h2,
.tool-results h2,
.tool-info-section h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(23px, 3vw, 30px);
  line-height: 1.28;
  letter-spacing: -0.035em;
}

.tool-card-header p,
.tool-info-section p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.tool-field {
  display: grid;
  min-width: 0;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.tool-field-wide {
  grid-column: 1 / -1;
}

.tool-field > label,
.tool-field > legend {
  padding: 0;
  color: #374156;
  font-size: 14px;
  font-weight: 780;
}

.tool-field > label small,
.tool-field > legend small {
  color: #66738a;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.tool-field > small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.tool-field input,
.tool-field select {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  color: var(--navy);
  background: white;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-field input:focus,
.tool-field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(53, 109, 243, 0.12);
}

.tool-field input[aria-invalid="true"] {
  border-color: var(--red);
  background: #fffafa;
}

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

.tool-input-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.tool-input-unit input {
  border-radius: 10px 0 0 10px;
}

.tool-input-unit span {
  display: grid;
  min-width: 54px;
  place-items: center;
  margin-left: -1.5px;
  padding: 0 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 0 10px 10px 0;
  color: #4b5669;
  background: #eef1f5;
  font-weight: 750;
}

.tool-segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.tool-segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.tool-segmented label {
  display: grid;
  min-height: 50px;
  place-items: center;
  border: 1.5px solid var(--blue);
  color: var(--blue);
  background: white;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
}

.tool-segmented label:first-of-type {
  border-radius: 10px 0 0 10px;
}

.tool-segmented label:last-of-type {
  margin-left: -1.5px;
  border-radius: 0 10px 10px 0;
}

.tool-segmented input:checked + label {
  z-index: 1;
  color: white;
  background: var(--blue);
}

.tool-segmented input:focus-visible + label {
  outline: 3px solid rgba(53, 109, 243, 0.36);
  outline-offset: 2px;
}

.tool-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.tool-actions .button-primary {
  min-width: 132px;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(53, 109, 243, 0.2);
}

.tool-actions .button-primary:hover {
  background: var(--blue-dark);
}

.tool-page .button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.tool-results {
  max-width: 980px;
  scroll-margin-top: 92px;
  padding-top: 58px;
}

/* Results receive focus after calculation so screen-reader users land on the
   updated content. Suppress the browser's oversized section outline while
   retaining that programmatic focus. */
.tool-results:focus {
  outline: none;
}

.tool-result-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.tool-result-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.tool-result-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-result-actions .button {
  min-height: 48px;
  padding-inline: 18px;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}

.button-action-guide {
  color: white;
  background: var(--navy);
  box-shadow: 0 8px 18px rgba(22, 39, 72, 0.2);
}

.button-action-guide:hover {
  background: #101e39;
}

.benefit-dialog {
  width: min(720px, calc(100% - 32px));
  max-width: none;
  max-height: min(88dvh, 820px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  background: white;
  box-shadow: 0 28px 80px rgba(17, 31, 57, 0.3);
}

.benefit-dialog::backdrop {
  background: rgba(15, 27, 50, 0.56);
  backdrop-filter: blur(3px);
}

.benefit-dialog-card {
  min-height: 100%;
  background: white;
}

.benefit-dialog-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.benefit-dialog-header .eyebrow {
  margin-bottom: 5px;
}

.benefit-dialog-header h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(23px, 4vw, 30px);
  line-height: 1.3;
}

.benefit-dialog-close {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--navy);
  background: white;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.benefit-dialog-close:hover {
  background: #f3f6fc;
}

.benefit-dialog-close:focus-visible {
  outline: 3px solid rgba(53, 109, 243, 0.35);
  outline-offset: 2px;
}

.benefit-dialog-body {
  padding: 24px 26px 28px;
}

.benefit-dialog-lead {
  margin: 0 0 20px;
  color: #526078;
  font-size: 16px;
  line-height: 1.75;
}

.benefit-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.benefit-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fbff;
}

.benefit-step-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 13px;
  font-weight: 800;
}

.benefit-step strong {
  display: block;
  margin: 2px 0 5px;
  color: var(--navy);
  font-size: 16px;
}

.benefit-step p {
  margin: 0;
  color: #59677d;
  font-size: 14px;
  line-height: 1.65;
}

.benefit-checklist {
  margin-top: 18px;
  padding: 17px 18px;
  border: 1px solid #d9e3f8;
  border-radius: 14px;
  background: #f2f6ff;
}

.benefit-checklist > strong {
  color: var(--navy);
  font-size: 15px;
}

.benefit-checklist ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #526078;
  font-size: 14px;
  line-height: 1.7;
}

.benefit-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.benefit-dialog-actions .button {
  min-height: 46px;
  text-decoration: none;
}

.benefit-dialog-footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  background: #f8faff;
}

.tool-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.tool-summary-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tool-summary-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.tool-summary-card span {
  display: block;
  margin-bottom: 5px;
  color: #59677e;
  font-size: 12px;
  font-weight: 720;
}

.tool-summary-card strong {
  display: block;
  color: var(--navy);
  font-size: clamp(18px, 2.5vw, 24px);
  line-height: 1.35;
}

.tool-summary-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.tool-follow-up-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-top: 16px;
  padding: 22px;
  border: 1px solid #cddfff;
  border-radius: 18px;
  background: linear-gradient(135deg, #f4f7ff 0%, #ffffff 72%);
  box-shadow: var(--shadow-soft);
}

.tool-follow-up-guide h3 {
  margin: 4px 0 6px;
  color: var(--navy);
  font-size: 20px;
}

.tool-follow-up-guide p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.tool-follow-up-guide > .button {
  min-height: 48px;
  text-decoration: none;
  white-space: nowrap;
}

.tool-fieldset {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8faff;
}

.tool-fieldset legend {
  padding: 0 7px;
  color: var(--navy);
  font-weight: 800;
}

.tool-fieldset > p {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 13px;
}

.tool-panel-spaced {
  margin-top: 16px;
}

.tool-action-panel {
  padding: 20px;
}

.tool-action-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.tool-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.tool-panel + .tool-panel {
  margin-top: 16px;
}

.tool-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #f8faff;
}

.tool-panel-header h3 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
}

.tool-panel-header p {
  margin: 2px 0 0;
  color: #627087;
  font-size: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-active {
  color: var(--green);
  background: var(--green-soft);
}

.status-upcoming {
  color: #295fcf;
  background: var(--blue-soft);
}

.status-ended,
.status-muted {
  color: #5d6a7f;
  background: #eef1f5;
}

.status-warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.tool-table-wrap {
  overflow-x: auto;
}

.tool-table-wrap:focus-visible {
  border-radius: 8px;
  outline: 3px solid var(--blue);
  outline-offset: -3px;
}

.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tool-table-wide {
  min-width: 760px;
}

.tool-table th,
.tool-table td {
  padding: 13px 15px;
  border-bottom: 1px solid #e8edf4;
  text-align: left;
  vertical-align: middle;
}

.tool-table thead th {
  color: #53627a;
  background: #f4f7fb;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tool-table tbody tr:last-child td {
  border-bottom: 0;
}

.tool-table tbody tr.is-highlighted {
  background: #f2f6ff;
}

.tool-table strong {
  color: var(--navy);
}

.tool-table small {
  color: var(--muted);
}

.timeline-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: start;
  gap: 13px;
  padding: 16px 20px;
  border-bottom: 1px solid #e8edf4;
}

.timeline-item:last-child {
  border-bottom: 0;
}

.timeline-index {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 850;
}

.timeline-copy strong,
.timeline-copy span,
.timeline-copy small {
  display: block;
}

.timeline-copy strong {
  color: var(--navy);
}

.timeline-copy span {
  margin-top: 2px;
  color: #4e5d75;
  font-size: 13px;
}

.timeline-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.tool-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #cddfff;
  border-radius: 12px;
  color: #38547f;
  background: var(--blue-soft);
  font-size: 13px;
}

.tool-note-warning {
  border-color: #f0d7aa;
  color: #815318;
  background: var(--amber-soft);
}

.tool-note p {
  margin: 0;
}

.tool-note strong {
  color: inherit;
}

.tool-info-section {
  display: grid;
  max-width: 980px;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 40px;
  margin-top: 58px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tool-info-copy {
  color: var(--muted);
  font-size: 14px;
}

.tool-info-copy p {
  margin: 0;
}

.tool-info-copy ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.tool-info-copy a {
  display: inline-block;
  margin-top: 12px;
  color: var(--blue);
  font-weight: 750;
  text-underline-offset: 3px;
}

.empty-state {
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 4px;
  color: var(--navy);
}

@media (max-width: 760px) {
  .tool-card {
    padding: 22px 16px;
  }

  .tool-form-grid,
  .tool-summary,
  .tool-info-section {
    grid-template-columns: 1fr;
  }

  .tool-summary-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-follow-up-guide {
    grid-template-columns: 1fr;
  }

  .tool-follow-up-guide > .button {
    justify-self: stretch;
  }

  .tool-field-wide {
    grid-column: auto;
  }

  .tool-actions,
  .tool-result-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-actions .button,
  .tool-result-actions .button {
    flex: 1;
  }

  .tool-result-heading {
    display: flex;
  }

  .tool-result-actions {
    width: 100%;
  }

  .timeline-item {
    grid-template-columns: 38px minmax(0, 1fr);
    padding-inline: 14px;
  }

  .timeline-item > .status-chip {
    grid-column: 2;
    justify-self: start;
  }

  .tool-info-section {
    gap: 14px;
  }
}

@media (max-width: 460px) {
  .tool-page .shell {
    width: min(100% - 24px, 1180px);
  }

  .tool-page .hero h1 {
    font-size: clamp(28px, 8.4vw, 32px);
    line-height: 1.24;
  }

  .tool-page .standard-badge {
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    line-height: 1.45;
    text-align: center;
    word-break: keep-all;
  }

  .tool-page .standard-badge .badge-dot {
    flex: 0 0 auto;
  }

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

  .tool-result-actions {
    flex-direction: column;
  }

  .benefit-dialog {
    width: calc(100% - 24px);
    max-height: 90dvh;
    border-radius: 18px;
  }

  .benefit-dialog-header {
    padding: 20px 18px 16px;
  }

  .benefit-dialog-body {
    padding: 20px 18px 22px;
  }

  .benefit-dialog-actions {
    flex-direction: column;
  }

  .benefit-dialog-actions .button {
    width: 100%;
  }

  .benefit-dialog-footer {
    padding: 14px 18px;
  }

  .tool-table th,
  .tool-table td {
    padding: 11px 12px;
  }
}

@media print {
  .tool-page .site-header,
  .tool-page .breadcrumb,
  .tool-page .hero,
  .tool-page .calculator-card,
  .tool-page .tool-result-actions,
  .tool-page .tool-info-section,
  .tool-page .site-footer,
  .tool-page .ad-slot {
    display: none !important;
  }

  .tool-page .tool-results {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .tool-page .tool-panel,
  .tool-page .tool-summary-card {
    break-inside: avoid;
    box-shadow: none;
  }
}

/* 시니어 도구는 표와 보조 텍스트를 한 단계 크게 표시해 가독성을 높입니다. */
.senior-tool .tool-table {
  font-size: 15px;
}

.senior-tool .tool-summary-card span {
  font-size: 13px;
}

.senior-tool .tool-panel-header p,
.senior-tool .status-chip {
  font-size: 13px;
}

.senior-tool .tool-field label {
  font-size: 15px;
}

.senior-tool .tool-result-heading p {
  font-size: 15px;
}
