:root {
  --font-latin: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-korean: "Pretendard Variable", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", var(--font-latin);
  --font-japanese: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", var(--font-latin);
  --body-leading: 1.66;
  --heading-leading: 1.2;
  --body-tracking: -.006em;
  --heading-tracking: -.038em;
}

html {
  font-size: clamp(16px, calc(15.25px + .12vw), 17px);
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-latin);
  font-size: 1rem;
  letter-spacing: var(--body-tracking);
  line-height: var(--body-leading);
  text-rendering: optimizeLegibility;
}

html[lang="ko"] {
  --body-leading: 1.74;
  --heading-leading: 1.32;
  --body-tracking: -.012em;
  --heading-tracking: -.035em;
}

html[lang="ko"] body {
  font-family: var(--font-korean);
  overflow-wrap: anywhere;
  word-break: keep-all;
}

html[lang="ja"] {
  --body-leading: 1.78;
  --heading-leading: 1.4;
  --body-tracking: .012em;
  --heading-tracking: -.012em;
}

html[lang="ja"] body {
  font-family: var(--font-japanese);
  line-break: strict;
  overflow-wrap: anywhere;
  word-break: normal;
}

html[lang="es"],
html[lang="pt"] {
  --body-leading: 1.7;
  --body-tracking: -.004em;
}

html[lang="de"] {
  --body-leading: 1.68;
  --body-tracking: -.003em;
}

h1,
h2,
h3,
h4,
.brand {
  letter-spacing: var(--heading-tracking);
  line-height: var(--heading-leading);
  text-wrap: balance;
}

p,
li,
.hero-copy,
.section-heading p,
.page-hero p,
.info-hero p {
  text-wrap: pretty;
}

.hero-copy,
.page-hero p,
.section-heading p,
.prose p,
.prose li,
.info-section p,
.info-section li,
.side-card p,
.side-card li,
.tool-card p {
  line-height: var(--body-leading);
}

.prose p + p,
.info-section p + p {
  margin-top: .9em;
}

.prose li + li,
.info-section li + li {
  margin-top: .35em;
}

.prose,
.info-content {
  max-width: 48rem;
}

.button,
button,
select,
input,
textarea {
  font: inherit;
}

.button {
  align-items: center;
  justify-content: center;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  word-break: keep-all;
}

.search-box .button {
  flex: 0 0 auto;
  min-width: 94px;
}

.page-hero .badge + h1 {
  margin-top: 14px;
}

.tool-form + .date-summary {
  margin-top: 20px;
}

.result-card {
  background: #132238;
  color: #fff;
}

.result-sentence {
  line-height: 1.65;
}

.result-actions .button {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .55);
  color: #fff;
}

.result-actions .button:hover,
.result-actions .button:focus-visible {
  background: rgba(255, 255, 255, .18);
}

.result-actions .button:first-child {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.result-actions .button:first-child:hover,
.result-actions .button:first-child:focus-visible {
  background: color-mix(in srgb, var(--accent) 88%, #fff);
}

.tool-card h3,
.category-card h3,
.field label,
.mode-tab,
.main-nav a,
.footer-column a {
  line-height: 1.45;
}

.tool-icon {
  flex: 0 0 48px;
  line-height: 1;
  white-space: nowrap;
  width: 48px;
  word-break: normal;
}

.category-filter-grid {
  grid-template-columns: repeat(3, 1fr);
}

.category-filter {
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  min-height: 190px;
  position: relative;
  text-align: left;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
  width: 100%;
}

.category-filter:hover,
.category-filter:focus-visible,
.category-filter[aria-pressed="true"] {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.category-filter[aria-pressed="true"] .category-line {
  background: var(--brand);
  width: 72px;
}

.category-filter p {
  color: var(--muted);
  line-height: var(--body-leading);
}

.category-filter .count {
  color: var(--brand);
  font-weight: 800;
}

.category-line {
  transition: background .18s ease, width .18s ease;
}

.tool-card[hidden] {
  display: none;
}

.category-status {
  color: var(--muted);
  font-size: .9rem;
  margin-top: 18px;
  min-height: 1.5em;
}

.content-review-note {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-top: 64px;
  padding-block: 22px;
}

.content-review-note h2 {
  font-size: 1rem;
  margin-bottom: 7px;
}

.content-review-note p {
  color: var(--muted);
  font-size: .88rem;
  line-height: var(--body-leading);
  max-width: 76rem;
}

.content-review-note time {
  color: var(--ink);
  font-weight: 750;
}

@media (max-width: 650px) {
  .hero h1 {
    font-size: clamp(2.65rem, 13vw, 4.6rem);
    line-height: 1.02;
  }

  .page-hero h1,
  .info-hero h1 {
    line-height: 1.12;
  }

  .page-hero .badge + h1 {
    margin-top: 16px;
  }

  .tool-form + .date-summary {
    margin-top: 24px;
  }

  .date-summary .summary-part {
    align-content: center;
    display: grid;
    gap: 7px;
    min-height: 112px;
    padding: 18px 12px;
  }

  .summary-part strong {
    line-height: 1.1;
  }

  .summary-part span {
    line-height: 1.4;
  }

  .result-card {
    padding: 24px 22px 26px;
  }

  .utility-result-grid {
    gap: 11px;
    margin-top: 21px;
  }

  .utility-result-grid .metric {
    align-content: center;
    display: grid;
    min-height: 78px;
    padding: 14px;
  }

  .utility-result-grid .metric span {
    font-size: .74rem;
    line-height: 1.4;
  }

  .utility-result-grid .metric strong {
    font-size: 1.05rem;
    margin-top: 7px;
  }

  .result-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 24px;
  }

  .result-actions .button {
    font-size: .92rem;
    min-height: 48px;
    padding-inline: 14px;
    width: 100%;
  }

  .button {
    min-height: 46px;
  }

  .content-review-note {
    margin-top: 48px;
  }

  .category-filter-grid {
    grid-template-columns: 1fr;
  }

  .category-filter {
    min-height: 0;
  }
}

@media (max-width: 420px) {
  .search-box {
    gap: 4px;
    padding: 5px;
  }

  .search-box input {
    padding-inline: 9px;
  }

  .search-box .button {
    font-size: .88rem;
    min-width: 84px;
    padding-inline: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
