:root {
  color-scheme: light;
  --bg: #f4f8f7;
  --panel: #ffffff;
  --panel-soft: #edf4f2;
  --ink: #151820;
  --muted: #5f6876;
  --line: #cfd9df;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --blue: #2b6cb0;
  --amber: #b45309;
  --shadow: 0 18px 44px rgba(30, 45, 61, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #eef7fa 0%, var(--bg) 38%, #ffffff 100%);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--blue);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  background: var(--ink);
  color: white;
  padding: 10px 12px;
  z-index: 5;
}

.skip-link:focus {
  left: 12px;
}

.site-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 46px);
  border-bottom: 1px solid rgba(207, 217, 223, 0.75);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 3;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 900;
  font-size: 15px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 750;
  padding: 14px 17px;
  border-left: 1px solid var(--line);
}

.nav a:first-child {
  border-left: 0;
}

.nav a:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

main {
  padding: clamp(22px, 4vw, 48px);
}

.tool-shell {
  max-width: 1320px;
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: 24px;
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px);
}

.tool-shell.compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.tool-intro {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 980px;
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: 0.96;
}

h2 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  line-height: 1.08;
}

h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.tool-intro p,
.page-hero p,
.notice-band p,
.content-grid p,
.site-footer p {
  color: var(--muted);
}

.tool-intro p {
  margin-top: 18px;
  font-size: 1.15rem;
  max-width: 720px;
}

.calculator-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #303743;
  font-weight: 800;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfdfe;
  color: var(--ink);
  border-radius: 8px;
  min-height: 50px;
  padding: 0 14px;
  font: inherit;
  font-weight: 650;
}

input:focus,
select:focus {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-color: var(--teal);
}

.input-unit {
  position: relative;
}

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

.input-unit input {
  padding-right: 44px;
}

.button {
  min-height: 52px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  padding: 0 18px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.button.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}

.button.secondary {
  background: white;
  color: var(--teal-dark);
}

.calculator-form .button {
  grid-column: 1 / -1;
}

.results {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 4px;
}

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

.metric {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.3rem, 3vw, 2rem);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.detail-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.warning {
  margin-top: 16px;
  border-left: 4px solid var(--amber);
  background: #fff8eb;
  color: #59330a;
  padding: 14px 16px;
  border-radius: 8px;
  font-weight: 700;
}

.notice-band {
  max-width: 1320px;
  margin: 0 auto 32px;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: clamp(18px, 3vw, 28px);
}

.content-grid {
  max-width: 1320px;
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.content-grid article,
.resource-list a {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.page-wrap {
  max-width: 1180px;
  margin: 0 auto;
}

.page-hero {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 38px);
  margin-bottom: 20px;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

.resource-list {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.resource-list a {
  color: var(--ink);
  font-weight: 850;
}

.legal {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 4vw, 38px);
}

.legal h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px clamp(18px, 4vw, 46px);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  background: #fff;
}

.site-footer p {
  margin: 0;
  max-width: 780px;
}

.site-footer nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .site-header,
  .site-footer,
  .notice-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .nav a {
    white-space: nowrap;
  }

  .tool-shell,
  .tool-shell.compact,
  .content-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .calculator-form,
  .result-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.2rem, 15vw, 4rem);
  }
}

@media (max-width: 560px) {
  main {
    padding: 16px;
  }

  .brand {
    white-space: normal;
  }

  .tool-shell,
  .page-hero,
  .legal {
    padding: 18px;
  }
}
