:root {
  --line: #d8e1eb;
  --muted: #465970;
  --light: #f5f8fb;
  --ink: #142033;
  --blue-dark: #0756c9;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); font: 1rem/1.55 system-ui, sans-serif; }
.shell { width: min(94%, 70rem); margin-inline: auto; }
.brand { display: flex; align-items: center; gap: .7rem; font-weight: 700; }
button, input, textarea, select { font: inherit; max-width: 100%; }
.button { min-height: 44px; padding: .65rem 1rem; border: 1px solid var(--line); border-radius: .5rem; cursor: pointer; }
.button-primary { background: var(--blue-dark); color: white; }
.button-secondary { background: white; color: var(--ink); }
button:disabled { opacity: .6; cursor: default; }
:focus-visible { outline: 3px solid var(--blue-dark); outline-offset: 3px; }
.document-tool-header {
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
}

.document-tool {
  max-width: 800px;
  margin-block: clamp(30px, 7vw, 64px);
}

.document-tool h1 {
  margin-block: 0 12px;
  font-size: clamp(1.85rem, 5vw, 3rem);
  line-height: 1.15;
}

.document-tool-lead,
.document-tool-note {
  color: var(--muted);
  line-height: 1.65;
}

.document-tool-panel {
  margin-block: 24px 18px;
  padding: clamp(14px, 4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--light);
}

.document-tool form:not([hidden]),
#document-fields,
.document-tool label {
  display: grid;
  gap: 10px;
}

.document-tool form h2,
#document-notice {
  margin: 0;
}

.document-tool input,
.document-tool select,
.document-tool textarea {
  min-width: 0;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #78889f;
  border-radius: 8px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.document-tool textarea {
  resize: vertical;
}

.document-context-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 10px;
}

.document-tool .document-review-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.document-tool .document-review-check input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  flex: 0 0 auto;
}

.document-tool .button {
  justify-self: start;
}

.document-tool-actions,
.document-tool-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 10px;
}

.document-tool-links a:link,
.document-tool-links a:visited,
.document-tool > p a {
  color: var(--blue-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#document-status:empty {
  margin: 0;
}

@media (max-width: 420px) {
  .document-tool-actions {
    flex-direction: column;
    align-items: start;
  }
}
