:root {
  --ink: #17211c;
  --muted: #65736d;
  --line: #dde5df;
  --paper: #fbfcf7;
  --white: #ffffff;
  --green: #1f8f66;
  --green-soft: #e3f4ec;
  --blue: #2768c6;
  --blue-soft: #e8f0fc;
  --coral: #cb5a48;
  --coral-soft: #fae9e5;
  --amber: #a96f16;
  --amber-soft: #f8ecd5;
  --violet: #6850b8;
  --violet-soft: #ece8fb;
  --shadow: 0 18px 50px rgba(35, 43, 38, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-width: 320px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(221, 229, 223, 0.9);
  background: rgba(251, 252, 247, 0.92);
  backdrop-filter: blur(14px);
}

.header-inner,
.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 68px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  box-shadow: 0 8px 24px rgba(23, 33, 28, 0.08);
}

.hero {
  padding: 42px 0 22px;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 34px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 850px;
  margin-bottom: 16px;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.98;
}

.page-title {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.lede {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.language-hero {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
}

.language-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 40px;
  align-items: center;
}

.language-card-grid {
  display: grid;
  gap: 10px;
}

.language-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 18px 20px;
  box-shadow: 0 12px 30px rgba(23, 33, 28, 0.06);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.language-card:hover {
  border-color: #b7c8bf;
  box-shadow: 0 16px 36px rgba(23, 33, 28, 0.09);
  transform: translateY(-1px);
}

.language-card span {
  font-size: 1.06rem;
  font-weight: 900;
}

.language-card small {
  color: var(--muted);
  line-height: 1.5;
}

.language-recommendation {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-top: 18px;
  border: 1px solid #b7d8c8;
  border-radius: 8px;
  background: var(--green-soft);
  padding: 12px 14px;
}

.language-recommendation strong {
  font-size: 0.92rem;
}

.language-recommendation a {
  color: var(--green);
  font-weight: 900;
}

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

.search-panel {
  padding: 18px;
}

.hero-category-menu {
  display: grid;
  width: min(220px, 100%);
  gap: 8px;
  justify-self: end;
}

.hero-category-menu a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(23, 33, 28, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.hero-category-menu a:hover,
.hero-category-menu a.is-active {
  border-color: #b7c8bf;
  color: var(--green);
  box-shadow: 0 14px 34px rgba(23, 33, 28, 0.08);
  transform: translateY(-1px);
}

.compact-category-panel {
  display: grid;
  gap: 10px;
  justify-self: end;
  width: min(460px, 100%);
}

.compact-category-button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 10px 14px;
  box-shadow: 0 10px 28px rgba(23, 33, 28, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.compact-category-button:hover {
  border-color: #b7c8bf;
  box-shadow: 0 14px 34px rgba(23, 33, 28, 0.08);
  transform: translateY(-1px);
}

.compact-category-button .icon-tile {
  margin-bottom: 0;
}

.compact-category-button strong,
.compact-category-button small {
  display: block;
}

.compact-category-button strong {
  margin-bottom: 3px;
  font-size: 1rem;
}

.compact-category-button small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.search-panel label,
.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.field label span {
  text-transform: none;
}

.search-input,
.field input,
.field select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 12px;
}

.number-hint {
  display: block;
  min-height: 1.15rem;
  margin-top: 5px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
}

.search-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.search-result {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
}

.search-result small {
  color: var(--muted);
  white-space: nowrap;
}

.section {
  padding: 42px 0;
}

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

.section-head h2 {
  margin-bottom: 6px;
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.category-card,
.calculator-card,
.info-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.category-card,
.calculator-card {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 18px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.category-card:hover,
.calculator-card:hover {
  transform: translateY(-2px);
  border-color: #b7c8bf;
  box-shadow: var(--shadow);
}

.icon-tile {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 7px;
  font-weight: 900;
  margin-bottom: 16px;
}

.color-green .icon-tile {
  background: var(--green-soft);
  color: var(--green);
}

.color-coral .icon-tile {
  background: var(--coral-soft);
  color: var(--coral);
}

.color-blue .icon-tile {
  background: var(--blue-soft);
  color: var(--blue);
}

.color-violet .icon-tile {
  background: var(--violet-soft);
  color: var(--violet);
}

.color-amber .icon-tile {
  background: var(--amber-soft);
  color: var(--amber);
}

.category-card h2,
.calculator-card h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.category-card p,
.calculator-card p {
  color: var(--muted);
  line-height: 1.55;
}

.card-link {
  margin-top: auto;
  color: var(--green);
  font-weight: 800;
}

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

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.breadcrumbs a {
  color: var(--green);
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 20px;
  align-items: start;
}

.calculator-shell {
  overflow: hidden;
}

.calculator-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.calculator-head h2 {
  margin-bottom: 4px;
  font-size: 1.2rem;
}

.calculator-head p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.calculator-form-sectioned {
  gap: 16px 14px;
}

.form-section-title {
  grid-column: 1 / -1;
  margin: 4px 0 -2px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
}

.form-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.field-full {
  grid-column: 1 / -1;
}

.converter-sentence-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 18px;
}

.sentence-control {
  flex: 1 1 132px;
  min-width: 120px;
}

.sentence-control input,
.sentence-control select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  padding: 0 12px;
}

.sentence-control input:focus,
.sentence-control select:focus {
  outline: 2px solid rgba(31, 143, 102, 0.22);
  border-color: var(--green);
}

.sentence-word {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 800;
  white-space: nowrap;
}

.is-hidden {
  display: none;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border-top: 1px solid var(--line);
}

.result-item {
  min-height: 112px;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.result-item:last-child {
  border-right: 0;
}

.result-item span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.result-item strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.05rem, 1.6vw, 1.45rem);
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: normal;
}

.bmi-standard-panel {
  border-top: 1px solid var(--line);
  padding: 16px;
}

.bmi-standard-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 12px;
}

.bmi-standard-head h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.bmi-standard-head p {
  max-width: 330px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  text-align: right;
}

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

.bmi-standard-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 10px;
  text-align: center;
}

.bmi-standard-item strong,
.bmi-standard-item span {
  display: block;
}

.bmi-standard-item strong {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.bmi-standard-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.bmi-standard-item.is-active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.bmi-standard-item.is-active span {
  color: var(--green);
}

.fire-chart-panel {
  border-top: 1px solid var(--line);
  padding: 16px;
}

.fire-chart-panel[hidden] {
  display: none;
}

.fire-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 12px;
}

.fire-chart-head h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.fire-chart-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.fire-chart-stack {
  display: grid;
  gap: 12px;
}

.fire-chart-box h3 {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.fire-chart {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdf9;
}

.fire-chart-axis {
  stroke: #cfd9d1;
  stroke-width: 1;
}

.fire-chart-assets,
.fire-chart-target,
.fire-chart-debt {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fire-chart-assets {
  stroke: var(--green);
}

.fire-chart-target {
  stroke: #d67642;
  stroke-dasharray: 7 7;
}

.fire-chart-debt {
  stroke: #316b9f;
}

.fire-chart-cross {
  fill: var(--green);
  stroke: var(--white);
  stroke-width: 2;
}

.fire-chart-payoff {
  fill: #316b9f;
  stroke: var(--white);
  stroke-width: 2;
}

.fire-chart-label,
.fire-chart-tick,
.fire-chart-legend text {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.schedule-panel {
  border-top: 1px solid var(--line);
  padding: 16px;
  max-width: 100%;
  overflow: hidden;
}

.schedule-panel[hidden] {
  display: none;
}

.schedule-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 12px;
}

.schedule-head h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.schedule-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.schedule-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 100%;
}

.schedule-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--white);
}

.schedule-table th,
.schedule-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
  font-size: clamp(0.78rem, 1.4vw, 0.95rem);
}

.schedule-table th:first-child,
.schedule-table td:first-child {
  width: 4.75rem;
  text-align: left;
}

.schedule-table th {
  background: #eef5f0;
  color: var(--ink);
  font-size: clamp(0.68rem, 1.2vw, 0.78rem);
  text-transform: uppercase;
}

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

.schedule-cards {
  display: none;
}

.schedule-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 12px;
}

.schedule-card + .schedule-card {
  margin-top: 10px;
}

.schedule-card div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.schedule-card div:last-child {
  border-bottom: 0;
}

.schedule-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.schedule-card strong {
  text-align: right;
  font-size: 0.94rem;
}

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

.schedule-total-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf6;
  padding: 12px;
}

.schedule-total-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.schedule-total-item strong {
  display: block;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.content-stack {
  display: grid;
  gap: 14px;
}

.guide-card {
  display: grid;
  gap: 18px;
}

.guide-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.guide-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.info-card {
  padding: 18px;
}

.info-card h2,
.info-card h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.info-card p,
.info-card li {
  color: var(--muted);
  line-height: 1.65;
}

.info-card ul {
  padding-left: 20px;
  margin-bottom: 0;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.faq-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.faq-item strong {
  display: block;
  margin-bottom: 5px;
}

.notice {
  border-left: 4px solid var(--coral);
}

.site-footer {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.footer-links {
  display: flex;
  gap: 14px;
}

@media (max-width: 980px) {
  .hero-grid,
  .calculator-layout,
  .language-grid {
    grid-template-columns: 1fr;
  }

  .category-grid,
  .calculator-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 640px) {
  .header-inner,
  .wrap {
    width: min(100% - 22px, 1180px);
  }

  .hero {
    padding-top: 28px;
  }

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

  .language-hero {
    min-height: auto;
  }

  .converter-sentence-form {
    gap: 8px;
  }

  .sentence-control {
    flex-basis: min(100%, 150px);
  }

  .sentence-word {
    font-size: 1rem;
  }

  .result-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .section-head,
  .footer-inner {
    display: block;
  }

  .schedule-panel {
    padding: 14px;
  }

  .schedule-head {
    display: block;
  }

  .schedule-head p {
    margin-top: 6px;
    text-align: left;
  }

  .fire-chart-head {
    display: block;
  }

  .fire-chart-head p {
    margin-top: 6px;
    text-align: left;
  }

  .bmi-standard-head {
    display: block;
  }

  .bmi-standard-head p {
    margin-top: 6px;
    text-align: left;
  }

  .bmi-standard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-scroll {
    display: none;
  }

  .schedule-cards {
    display: block;
  }

  .schedule-totals {
    grid-template-columns: 1fr;
  }

  .hero-category-menu {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-self: stretch;
  }

  .compact-category-panel {
    justify-self: stretch;
    width: 100%;
  }

  .compact-category-button {
    min-height: 68px;
  }

  .footer-links {
    margin-top: 12px;
    flex-wrap: wrap;
  }
}
