:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #172033;
  --muted: #5d6678;
  --line: #dfe3ea;
  --accent: #275efe;
  --accent-soft: #eaf0ff;
  --good: #0b7a53;
  --warning: #9a5d00;
  --radius: 18px;
  --shadow: 0 14px 38px rgba(28, 39, 60, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.65; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #173fbd;
  outline-offset: 3px;
}
img { max-width: 100%; height: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(223, 227, 234, 0.85);
  background: rgba(247, 248, 250, 0.94);
  backdrop-filter: blur(14px);
}

.nav-wrap,
.page-wrap,
.footer-wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.nav-wrap {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  color: var(--text);
  font-weight: 850;
  letter-spacing: -0.035em;
  font-size: 1.28rem;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 0.85rem;
  letter-spacing: -0.04em;
}

.nav-links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 650; font-size: 0.94rem; min-height: 44px; display: inline-flex; align-items: center; }
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; }

.page-wrap { padding: 64px 0 84px; }
.hero { padding: 34px 0 42px; max-width: 850px; }
.eyebrow { color: var(--accent); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -0.035em; }
h1 { font-size: clamp(2.3rem, 6vw, 4.7rem); margin: 14px 0 18px; }
h2 { font-size: clamp(1.65rem, 3vw, 2.35rem); margin: 48px 0 16px; }
h3 { font-size: 1.18rem; margin: 30px 0 8px; }
.lead { font-size: clamp(1.08rem, 2vw, 1.32rem); color: var(--muted); max-width: 760px; }

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card-link { color: inherit; text-decoration: none; display: block; transition: transform 120ms ease, border-color 120ms ease; }
.card-link:hover { border-color: #b8c5f4; transform: translateY(-1px); }
.card-link:focus-visible { border-color: #173fbd; }

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  background: #fff;
}

.article {
  width: min(790px, 100%);
  margin: 0 auto;
}
.article h1 { font-size: clamp(2.2rem, 5vw, 3.7rem); }
.article-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 28px; }
.article p, .article li { font-size: 1.04rem; }
.article ul, .article ol { padding-left: 1.35rem; }

.callout {
  margin: 26px 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid #cdd9ff;
}
.callout strong { display: block; margin-bottom: 4px; }

.note {
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
table { border-collapse: collapse; width: 100%; min-width: 620px; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f1f4f9; font-size: 0.9rem; }
tr:last-child td { border-bottom: 0; }

.tool {
  margin: 30px 0;
  padding: 22px;
  border: 1px solid #cbd5e8;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: grid; gap: 7px; font-weight: 720; font-size: 0.9rem; }
input, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd2dd;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 10px 15px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
}
button:hover { filter: brightness(0.95); }
.result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: #f3f6fb;
  border: 1px solid var(--line);
}
.result strong { font-size: 1.08rem; }

.source-list { font-size: 0.93rem; color: var(--muted); }
.source-list a { word-break: break-word; }

.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-wrap { padding: 32px 0 46px; display: flex; justify-content: space-between; gap: 22px; flex-wrap: wrap; color: var(--muted); font-size: 0.9rem; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card-link { transition: none; }
  .card-link:hover { transform: none; }
}

@media (max-width: 760px) {
  .nav-wrap { align-items: flex-start; padding: 16px 0; flex-direction: column; gap: 10px; }
  .site-header { position: static; }
  .grid-2, .grid-3, .tool-grid { grid-template-columns: 1fr; }
  .page-wrap { padding-top: 36px; }
  .hero { padding-top: 18px; }
}
