/* One stylesheet for every page. System fonts, no web fonts: nothing to download before the text shows. */
:root {
  --ink: #1d2327;
  --muted: #59636b;
  --line: #cfd6db;
  --paper: #ffffff;
  --panel: #f4f6f7;
  --accent: #1f5f8b;
  --accent-ink: #ffffff;
  --error: #a3261b;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

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

.site-header, .site-footer, main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  padding-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

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

.site-footer {
  display: flex;
  gap: 20px;
  margin-top: 48px;
  padding-top: 16px;
  padding-bottom: 32px;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}

h1 { font-size: 1.9rem; line-height: 1.2; margin: 28px 0 10px; }
h2 { font-size: 1.3rem; margin: 32px 0 8px; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 760px; margin-top: 0; }

.tool {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 24px;
  align-items: start;
  margin: 24px 0 8px;
  padding: 20px;
  background: var(--panel);
  border-radius: 10px;
}

.controls { display: grid; gap: 14px; }
.field { display: grid; gap: 4px; margin: 0; min-width: 0; }
fieldset.field { border: 0; padding: 0; }
.field > label, legend { font-weight: 600; font-size: 0.95rem; padding: 0; }
.row { display: flex; gap: 10px; align-items: end; }
.row > * { flex: 1 1 0; min-width: 0; }
.row select#units { flex: 0 0 72px; }

input[type="number"], select {
  font: inherit;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #9aa6ae;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
input[type="file"] { font: inherit; max-width: 100%; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid #f0b429;
  outline-offset: 2px;
}

.file-field {
  padding: 12px;
  border: 2px dashed #9aa6ae;
  border-radius: 8px;
  background: #fff;
}
.file-field.dragging { border-color: var(--accent); background: #eaf3f9; }

.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.checks label { font-weight: 400; display: flex; gap: 6px; align-items: center; }

.hint { margin: 0; font-size: 0.86rem; color: var(--muted); }
.summary { margin: 0; font-size: 0.95rem; }
.error { margin: 0; color: var(--error); font-weight: 600; }

button {
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
button:disabled { background: #9aa6ae; cursor: default; }
button.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); justify-self: start; }

.result { margin: 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.result a { font-weight: 700; }
.result span { color: var(--muted); font-size: 0.92rem; }

.preview { margin: 0; }
.preview canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.preview figcaption { font-size: 0.86rem; color: var(--muted); margin-top: 6px; }

.text { max-width: 760px; }
.text li { margin-bottom: 8px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 20px; }
.card {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.card:hover { border-color: var(--accent); }
.card strong { display: block; font-size: 1.1rem; color: var(--accent); margin-bottom: 4px; }

[hidden] { display: none !important; }

@media (max-width: 760px) {
  .tool { grid-template-columns: 1fr; padding: 14px; }
  h1 { font-size: 1.55rem; }
}
