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

[hidden] {
  display: none !important;
}

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1c2430;
  background: #f3f5f8;
}

body {
  margin: 0;
}

.top,
.layout,
.foot {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
}

.top {
  padding-top: 28px;
  padding-bottom: 8px;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.9rem;
  line-height: 1.2;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.3rem;
}

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

.lead {
  margin: 0;
  max-width: 70ch;
  color: #3b4757;
}

noscript {
  display: block;
  max-width: 980px;
  margin: 12px auto;
  padding: 12px 16px;
  background: #fff4d6;
  border: 1px solid #e0b84a;
}

.panel {
  margin: 18px 0;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #d6dce5;
  border-radius: 8px;
}

.hint {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: #55606f;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px 16px;
  margin-top: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

label {
  margin-bottom: 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

.unit-tag {
  font-weight: 400;
  color: #55606f;
}

input,
select {
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  color: inherit;
  background: #ffffff;
  border: 1px solid #9aa5b4;
  border-radius: 6px;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid #7fb0ff;
  outline-offset: 1px;
}

button {
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  color: #ffffff;
  background: #1f5fbf;
  border: 1px solid #184c99;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  background: #184c99;
}

button:disabled {
  color: #3b4757;
  background: #e3e8ef;
  border-color: #b9c2ce;
  cursor: not-allowed;
}

.error,
.warning {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
}

.error {
  color: #7a1010;
  background: #fde8e8;
  border: 1px solid #e59a9a;
}

.warning {
  margin-bottom: 12px;
  color: #6b4a00;
  background: #fff4d6;
  border: 1px solid #e0b84a;
}

.presets {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px dashed #b9c2ce;
}

.canvas-wrap {
  width: 100%;
  background: #fbfcfd;
  border: 1px solid #d6dce5;
  border-radius: 6px;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
}

.summary {
  display: grid;
  grid-template-columns: minmax(140px, max-content) 1fr;
  gap: 4px 16px;
  margin: 0;
}

.summary dt {
  font-weight: 600;
}

.summary dd {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid #e3e8ef;
  white-space: nowrap;
}

th {
  background: #f3f5f8;
}

.disclosure {
  padding: 14px 16px;
  background: #fff9e8;
  border: 2px solid #e0b84a;
  border-radius: 6px;
}

.disclosure h3 {
  margin-top: 0;
}

.disclosure ul {
  margin: 0;
  padding-left: 20px;
}

.disclosure li {
  margin-bottom: 6px;
}

.unlock {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 18px;
}

.unlock .field {
  flex: 1 1 260px;
}

.status {
  min-height: 1.5em;
  margin: 10px 0 0;
  font-weight: 600;
}

.status.good {
  color: #17603a;
}

.status.bad {
  color: #7a1010;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.download {
  flex: 1 1 260px;
}

.prose ul {
  padding-left: 20px;
}

.prose li {
  margin-bottom: 6px;
}

.prose h2 {
  margin-top: 22px;
}

.prose h2:first-child {
  margin-top: 0;
}

.foot {
  padding-top: 4px;
  padding-bottom: 32px;
  font-size: 0.9rem;
  color: #55606f;
}

.foot a,
.crumbs a,
.article a {
  color: #1f5fbf;
}

.crumbs {
  margin: 0 0 10px;
  font-size: 0.9rem;
}

.article {
  max-width: 820px;
}

.article p {
  margin: 0 0 12px;
}

.article h2 {
  margin-top: 24px;
}

.article ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.article li {
  margin-bottom: 6px;
}

.article .table-wrap {
  margin-bottom: 12px;
}

.article .disclosure {
  margin-top: 24px;
}

.disclosure h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.formula {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  white-space: nowrap;
}

.cta {
  margin: 18px 0 0;
  font-weight: 600;
}

.notfound {
  max-width: 640px;
  margin: 80px auto;
  padding: 0 16px;
}

@media (max-width: 520px) {
  .panel {
    padding: 14px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .summary {
    grid-template-columns: 1fr;
  }

  .summary dd {
    margin-bottom: 6px;
  }
}
