:root {
  --brand: #0073aa;
  --brand-dark: #005885;
  --brand-soft: #eaf5fb;
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --border: #e0e0e0;
  --text: #111111;
  --muted: #666666;
  --tool-page: #f6fafc;
  --tool-surface: var(--bg);
  --tool-subtle: #f1f7fa;
  --tool-ink: #17374d;
  --tool-muted: #475e6b;
  --tool-border: #cfdee7;
  --tool-control-border: #728b9b;
  --tool-selected: #deeff8;
  --tool-accent: var(--brand);
  --tool-on-accent: #fff;
  --tool-success: #176951;
  --tool-success-soft: #eaf7f0;
  --tool-warning: #8b4b13;
  --tool-warning-soft: #fff2df;
  --tool-error: #9e4038;
  --tool-graph-grid: #bed1dc;
  --tool-graph-axis: #728b9b;
  --tool-graph-secondary: #594ab3;
  --tool-title-size: clamp(2rem, 5vw, 3.5rem);
  --radius: 8px;
  --radius-lg: 18px;
  --shadow: 0 2px 8px rgba(0, 0, 0, .04);
  --shadow-lg: 0 18px 50px rgba(21, 56, 75, .12);
  --max-width: 1120px;
  --transition: 180ms ease-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  color-scheme: light;
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -.025em;
}

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-content {
  flex: 1 0 auto;
}

.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-inline: 1rem;
}

.content-narrow {
  max-width: 900px;
}

.hero-narrow {
  max-width: 850px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 1000;
  padding: .65rem .9rem;
  border-radius: 6px;
  background: #fff;
  color: #111;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
  backdrop-filter: blur(12px);
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .7rem;
  padding-bottom: .7rem;
}

.site-branding {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.site-logo {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 6px;
}

.site-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  white-space: nowrap;
}

.site-title a {
  color: #111;
}

.site-title a:hover {
  color: var(--brand);
  text-decoration: none;
}

.site-description {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
  white-space: nowrap;
}

.header-section {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: .25rem .8rem;
  color: #24475c;
  background: var(--brand-soft);
  border: 1px solid rgba(0, 115, 170, .1);
  border-radius: 999px;
  font-size: .86rem;
  font-weight: 700;
}

a.header-section:hover {
  color: var(--brand-dark);
  background: #fff;
  text-decoration: none;
}

.breadcrumbs {
  padding: .75rem 0 .55rem;
  color: var(--muted);
  font-size: .82rem;
}

.breadcrumbs ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: .35rem;
  color: #a3a3a3;
}

.breadcrumbs a {
  color: #4e6572;
}

.tools-hero,
.calculator-hero {
  position: relative;
  overflow: hidden;
  padding: 3.35rem 0 3.7rem;
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 115, 170, .12) 0, transparent 34%),
    radial-gradient(circle at 90% 90%, rgba(0, 115, 170, .07) 0, transparent 28%),
    linear-gradient(180deg, #f8fcfe 0%, #fff 100%);
}

.calculator-hero {
  padding-bottom: 8.3rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  margin-bottom: .8rem;
  padding: .22rem .7rem;
  color: var(--brand-dark);
  background: rgba(0, 115, 170, .07);
  border: 1px solid rgba(0, 115, 170, .08);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.tools-hero h1,
.calculator-hero h1 {
  max-width: 760px;
  margin: 0 auto .85rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.08;
}

.hero-lead {
  max-width: 760px;
  margin: 0 auto;
  color: #566b76;
  font-size: clamp(1rem, 2vw, 1.14rem);
  line-height: 1.65;
}

.content-section {
  padding: 3.4rem 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid rgba(0, 0, 0, .035);
  border-bottom: 1px solid rgba(0, 0, 0, .035);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.6rem;
}

.section-heading.simple {
  align-items: flex-start;
}

.section-heading h2,
.faq-section h2,
.article-content > h2 {
  margin-bottom: .28rem;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  line-height: 1.25;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
}

.result-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}

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

.tool-card {
  min-height: 310px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.4rem;
  background: #fff;
  border: 1px solid rgba(12, 56, 77, .09);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.tool-card:hover {
  border-color: rgba(0, 115, 170, .25);
  box-shadow: 0 14px 34px rgba(21, 56, 75, .09);
  transform: translateY(-2px);
}

.tool-card-icon {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: linear-gradient(145deg, #edf8fd, #f9fdff);
  border: 1px solid rgba(0, 115, 170, .08);
  border-radius: 18px;
}

.tool-card-icon svg {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.tool-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.tool-card-meta {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-bottom: .36rem;
  color: #4c6a58;
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #2b9b55;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(43, 155, 85, .1);
}

.tool-card h3 {
  margin-bottom: .38rem;
  font-size: 1.3rem;
  line-height: 1.3;
}

.tool-card h3 a {
  color: #17374d;
}

.tool-card h3 a:hover {
  color: var(--brand);
}

.tool-card p {
  margin-bottom: .75rem;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.62;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: .38rem;
  margin: 0 0 1.05rem;
  padding: 0;
  list-style: none;
}

.feature-list li {
  padding: .2rem .55rem;
  color: #4f6570;
  background: var(--bg-alt);
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 600;
}

.button-primary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  margin-top: auto;
  padding: .55rem 1rem;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: .9rem;
  font-weight: 700;
}

.button-primary:hover {
  color: #fff;
  background: var(--brand-dark);
  text-decoration: none;
  box-shadow: 0 5px 14px rgba(0, 88, 133, .2);
}

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

.benefit-card {
  padding: 1.25rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .05);
  border-radius: 14px;
}

.benefit-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-bottom: .8rem;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 10px;
  font-weight: 800;
}

.benefit-card h3 {
  margin-bottom: .25rem;
  font-size: 1rem;
}

.benefit-card p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.6;
}

.faq-section h2 {
  margin-bottom: 1rem;
}

.faq-list {
  display: grid;
  gap: .7rem;
}

.faq-list details {
  background: #fff;
  border: 1px solid rgba(12, 56, 77, .1);
  border-radius: 12px;
}

.faq-list summary {
  position: relative;
  padding: .9rem 2.5rem .9rem 1rem;
  color: #17374d;
  cursor: pointer;
  font-size: .94rem;
  font-weight: 700;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 1rem;
  color: var(--brand);
  font-size: 1.25rem;
  line-height: 1;
  transform: translateY(-50%);
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details p {
  margin: 0;
  padding: 0 1rem 1rem;
  color: var(--muted);
  font-size: .9rem;
}

.calculator-section {
  position: relative;
  z-index: 2;
  margin-top: -6rem;
  padding-bottom: 4rem;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(320px, 490px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.calculator-card {
  width: 100%;
  padding: 1rem;
  background: #fff;
  border: 1px solid rgba(12, 56, 77, .1);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}

.calculator-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 0 .18rem .75rem;
  color: #4e6572;
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
}

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  color: #477458;
}

.privacy-note span {
  color: #2b9b55;
  font-size: .55rem;
}

.calculator-display {
  min-height: 126px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: hidden;
  padding: .9rem 1rem .85rem;
  color: var(--tool-ink);
  background: linear-gradient(145deg, var(--brand-soft), var(--tool-page));
  border: 1px solid var(--tool-border);
  border-radius: 15px;
  font-variant-numeric: tabular-nums;
}

.calculator-history {
  width: 100%;
  min-height: 1.45rem;
  overflow: hidden;
  color: var(--tool-muted);
  font-size: .84rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-value {
  width: 100%;
  overflow-x: auto;
  color: var(--tool-ink);
  font-size: clamp(2.25rem, 8vw, 3.15rem);
  font-weight: 650;
  line-height: 1.12;
  text-align: right;
  white-space: nowrap;
  scrollbar-width: none;
}

.calculator-value::-webkit-scrollbar {
  display: none;
}

.calculator-keys {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .58rem;
  padding-top: .75rem;
}

.calc-key {
  min-width: 0;
  min-height: 58px;
  padding: .45rem;
  color: #183647;
  background: #f7f9fa;
  border: 1px solid #e2e8eb;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .025);
  font-size: 1.08rem;
  font-weight: 680;
  line-height: 1;
  touch-action: manipulation;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform 80ms ease-out;
}

.calc-key:hover {
  background: #eef3f5;
  border-color: #cad7dd;
}

.calc-key:active,
.calc-key.is-pressed {
  transform: scale(.96);
}

.calc-key:focus-visible,
.button-primary:focus-visible,
.header-section:focus-visible,
.faq-list summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 115, 170, .28);
  outline-offset: 3px;
}

.calc-key-operator {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-color: rgba(0, 115, 170, .14);
  font-size: 1.3rem;
}

.calc-key-delete {
  font-size: .76rem;
  letter-spacing: .04em;
}

.calc-key-operator:hover {
  background: #dceff8;
  border-color: rgba(0, 115, 170, .25);
}

.calc-key-operator.is-active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.calc-key-clear {
  color: #9c3e37;
  background: #fff4f2;
  border-color: #f1d8d5;
}

.calc-key-equals {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 5px 12px rgba(0, 115, 170, .18);
  font-size: 1.3rem;
}

.calc-key-equals:hover {
  color: #fff;
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.noscript-message {
  margin: .75rem 0 0;
  padding: .65rem;
  color: #8a342e;
  background: #fff4f2;
  border-radius: 8px;
  font-size: .85rem;
}

.calculator-aside {
  padding: 1rem 0;
}

.aside-kicker {
  display: block;
  margin-bottom: .35rem;
  color: var(--brand);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.calculator-aside h2 {
  margin-bottom: .55rem;
  color: #17374d;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.2;
}

.calculator-aside > p {
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: .94rem;
}

.shortcut-list {
  margin: 0;
  border-top: 1px solid var(--border);
}

.shortcut-list div {
  display: grid;
  grid-template-columns: minmax(100px, .65fr) 1fr;
  align-items: center;
  gap: 1rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
}

.shortcut-list dt,
.shortcut-list dd {
  margin: 0;
}

.shortcut-list dd {
  color: var(--muted);
  font-size: .84rem;
}

kbd {
  display: inline-block;
  padding: .12rem .4rem;
  color: #274a5d;
  background: #fff;
  border: 1px solid #d6dfe3;
  border-bottom-width: 2px;
  border-radius: 5px;
  font: 700 .75rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.precision-callout {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  margin-top: 1.25rem;
  padding: .85rem .9rem;
  color: #315365;
  background: #f1f8fb;
  border: 1px solid rgba(0, 115, 170, .09);
  border-radius: 12px;
}

.precision-callout > span {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 50%;
  font-size: .72rem;
  font-weight: 800;
}

.precision-callout p {
  margin: 0;
  font-size: .78rem;
  line-height: 1.5;
}

.article-content > p {
  color: #4d626d;
  font-size: .95rem;
}

.explanation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.35rem 0;
}

.explanation-grid article {
  padding: 1.1rem;
  background: #fff;
  border: 1px solid rgba(12, 56, 77, .08);
  border-radius: 12px;
}

.explanation-grid h3 {
  margin-bottom: .3rem;
  color: #17374d;
  font-size: 1rem;
}

.explanation-grid p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

.use-note {
  margin: 1.4rem 0 0;
  padding: .85rem 1rem;
  background: #fef9ea;
  border: 1px solid #eee3bd;
  border-radius: 10px;
}

.site-footer {
  margin-top: auto;
  background: #fafafa;
  border-top: 1px solid var(--border);
}

.footer-inner {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  color: var(--muted);
  font-size: .82rem;
}

.footer-inner strong {
  color: #2f4d5d;
}

.footer-inner p {
  margin: .1rem 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
}

.footer-links a {
  color: #24475c;
  font-weight: 700;
}

@media (max-width: 860px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .calculator-layout {
    max-width: 650px;
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .calculator-aside {
    padding: 0;
  }
}

@media (max-width: 680px) {
  .site-description {
    display: none;
  }

  .tools-hero,
  .calculator-hero {
    padding-top: 2.45rem;
  }

  .calculator-hero {
    padding-bottom: 7.7rem;
  }

  .content-section {
    padding: 2.65rem 0;
  }

  .section-heading {
    align-items: flex-start;
  }

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

  .tool-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 15px;
  }

  .tool-card-icon svg {
    width: 38px;
    height: 38px;
  }

  .benefit-grid,
  .explanation-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .wrap {
    padding-inline: .8rem;
  }

  .header-inner {
    min-height: 62px;
  }

  .header-section {
    min-height: 36px;
    padding-inline: .7rem;
  }

  .calculator-card {
    padding: .75rem;
    border-radius: 18px;
  }

  .calculator-display {
    min-height: 112px;
  }

  .calculator-keys {
    gap: .45rem;
  }

  .calc-key {
    min-height: 54px;
    border-radius: 10px;
  }

  .shortcut-list div {
    grid-template-columns: 105px 1fr;
  }
}

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