:root {
  --ink: #1b2430;
  --muted: #556070;
  --line: #d5dbe3;
  --paper: #ffffff;
  --wash: #f4f6f9;
  --accent: #0b5cad;
  --accent-ink: #ffffff;
  --bad: #fff1d6;
  --good: #e3f4e6;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

.site-header,
main,
.site-footer {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.92rem;
}

a {
  color: var(--accent);
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

h1 {
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 2.5rem 0 0.75rem;
}

h3 {
  font-size: 1.08rem;
  margin: 1.5rem 0 0.5rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

li {
  margin-bottom: 0.4rem;
}

.lead {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 46rem;
}

.prose {
  max-width: 46rem;
}

code,
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

caption {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  background: var(--wash);
  border-bottom: 1px solid var(--line);
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th.note,
td.wrap {
  white-space: normal;
  min-width: 14rem;
}

thead th {
  background: var(--wash);
}

tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: 0;
}

td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.steps li {
  margin-bottom: 0.9rem;
}

.guides {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1rem;
}

.guides li {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem;
  margin: 0;
}

.guides a {
  font-weight: 600;
}

.guides p {
  margin: 0.4rem 0 0;
  font-size: 0.94rem;
  color: var(--muted);
}

.btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}

.terms {
  font-size: 0.92rem;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

.tool {
  margin: 2rem 0 2.5rem;
  padding: 0.25rem 1.25rem 1.25rem;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool h2 {
  margin-top: 1.25rem;
}

.tool label {
  font-weight: 600;
}

.tool input[type="text"] {
  font: inherit;
  width: 22rem;
  max-width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--muted);
  border-radius: 6px;
}

.tool input[type="file"] {
  font: inherit;
  max-width: 100%;
}

.tool button {
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

.tool button:disabled {
  border-color: var(--line);
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.tool button:focus-visible,
.tool input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.tool table {
  background: var(--paper);
}

.msg {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.msg.error {
  background: var(--bad);
  border-color: #c98a1b;
}

.msg.ok {
  background: var(--good);
  border-color: #3c8a4a;
}

.choice {
  padding: 0.8rem 1rem 0.1rem;
  margin-bottom: 1rem;
  background: var(--bad);
  border: 1px solid #c98a1b;
  border-radius: 6px;
}

.facts {
  display: grid;
  grid-template-columns: minmax(9rem, 16rem) 1fr;
  gap: 0.3rem 1rem;
  font-size: 0.94rem;
}

.facts dt {
  font-weight: 600;
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.lines {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.unlock {
  margin-top: 1.5rem;
  padding: 0 1rem 0.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.site-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.2rem;
  }

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