:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #202a36;
  --muted: #5c6875;
  --line: #d9dee4;
  --accent: #0f766e;
  --accent-dark: #0b514c;
  --warm: #be6a2c;
  --soft: #e8f4f2;
  --warning: #9f5b14;
  --danger: #a62b1f;
  --shadow: 0 18px 44px rgba(32, 42, 54, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

input,
select,
button {
  font: inherit;
}

.site-header {
  background: #213140;
  color: #ffffff;
  padding: 24px;
}

.topbar,
.hero,
.page-shell,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.brand,
.site-nav a {
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

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

.language-switch {
  display: grid;
  gap: 6px;
  width: min(230px, 100%);
  font-weight: 700;
}

select,
input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 1px solid #b8c2cc;
  border-radius: 6px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
}

.hero {
  max-width: 920px;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.04;
}

h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
}

h3 {
  margin: 18px 0 8px;
}

.hero p {
  max-width: 780px;
  color: #dce8e5;
}

.page-shell {
  padding: 24px 0 34px;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.02fr) minmax(0, 0.98fr);
  gap: 18px;
  align-items: start;
}

.panel,
.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-weight: 800;
}

.unit-switch {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 12px 0 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.unit-switch legend {
  padding: 0 6px;
  font-weight: 900;
}

.unit-switch label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.unit-switch input {
  width: auto;
  min-height: auto;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button.secondary {
  background: #55616f;
}

.error {
  margin: 10px 0 0;
  min-height: 1.5em;
  color: var(--danger);
  font-weight: 800;
}

.result-panel {
  position: sticky;
  top: 14px;
}

.summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f9fbfb;
}

.empty-state {
  color: var(--muted);
}

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

.result-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.result-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.result-card .value {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 900;
}

.result-card.note {
  grid-column: 1 / -1;
  background: var(--soft);
}

.result-card.caution {
  grid-column: 1 / -1;
  border-color: #e2b06f;
  background: #fff8ec;
}

.disclaimer,
.card p,
.related {
  color: var(--muted);
}

.disclaimer {
  margin-top: 14px;
  font-size: 0.94rem;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.content-depth-pass,
.faq,
.related {
  grid-column: 1 / -1;
}

.card a {
  color: var(--accent-dark);
  font-weight: 800;
}

.site-footer {
  padding: 0 0 28px;
  color: var(--muted);
}

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

  .result-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 20px 16px;
  }

  .topbar,
  .hero,
  .page-shell,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .panel,
  .card {
    padding: 16px;
  }

  .field-grid,
  .result-card-grid {
    grid-template-columns: 1fr;
  }

  .actions button {
    width: 100%;
  }
}

@media print {
  .site-header,
  .content-grid,
  .site-footer,
  .panel,
  .actions {
    display: none;
  }

  .page-shell,
  .tool-grid {
    display: block;
    width: 100%;
    padding: 0;
  }

  .result-panel {
    position: static;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
}
