:root {
  scrollbar-gutter: stable;
  --paper: #fffdf7;
  --canvas: #f6f3ea;
  --ink: #252b24;
  --green: #315b45;
  --sage: #dfe6d4;
  --clay: #b46849;
  --red: #9e452b;
  --muted: #59635b;
  --rule: #b9bfb2;
  --line: 1px solid var(--rule);
  --shadow: 4px 4px 0 #315b4526;
  --radius: 4px;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:
    ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --serif: Georgia, "Times New Roman", serif;
  --app-sidebar-width: 248px;
  --app-header-height: 68px;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
[hidden] {
  display: none !important;
}
a {
  color: var(--green);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2px;
}
a,
button,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--green);
  outline-offset: 2px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 32px;
  border-bottom: var(--line);
  background: var(--surface-input);
}
header nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 32px;
  font-size: 20px;
}
header nav > a {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}
header nav form {
  border-left: var(--line);
  padding-left: 24px;
}
header .quiet {
  white-space: nowrap;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
form {
  margin: 0;
}
main {
  max-width: 1200px;
  margin: auto;
  padding: 36px 40px;
}
.app main {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
}
h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 3.5vw, 48px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -1.2px;
  margin: 8px 0 24px;
  overflow-wrap: anywhere;
}
h2 {
  font-family: var(--serif);
  overflow-wrap: anywhere;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.6px;
  margin: 0 0 16px;
}
p {
  margin: 10px 0 20px;
}
.card {
  border: 1px solid var(--border-control);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
  background: var(--surface-input);
}
.narrow {
  max-width: 520px;
  margin: 40px auto;
}
.narrow h1 {
  font-size: 40px;
}
.muted {
  color: var(--muted);
  font-size: 14px;
}
:where(label) {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 18px;
}
input,
select {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 7px;
  padding: 10px 16px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius);
  background: var(--surface-input);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[type="file"] {
  padding: 4px 8px;
}
input::file-selector-button {
  border: var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  margin-right: 12px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}
input[readonly] {
  background: var(--sage);
}
select {
  cursor: pointer;
}
button,
.button {
  display: inline-block;
  max-width: 100%;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--green);
  color: var(--paper);
  padding: 10px 20px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  text-decoration: none;
}
button:hover,
.button:hover {
  background: var(--action-primary);
}
button:active,
.button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 light-dark(#315b4526, #080d0866);
}
button:disabled {
  background: var(--surface-canvas);
  border-color: var(--rule);
  color: var(--text-muted);
  cursor: default;
  transform: none;
  box-shadow: none;
}
.secondary {
  background: var(--paper);
  border-color: var(--muted);
  color: var(--ink);
  box-shadow: none;
}
.secondary:hover {
  background: var(--sage);
}
.secondary:active {
  transform: none;
  box-shadow: none;
}
.quiet {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--green);
  padding: 0;
  font-size: inherit;
  font-weight: 650;
  text-decoration: underline;
}
.quiet:hover {
  background: none;
}
.quiet:active {
  transform: none;
  box-shadow: none;
}
dt {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  margin-top: 16px;
}
dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}
#notice,
.notice {
  background: var(--sage);
  border: 1px solid var(--border-control);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px 0 24px;
  overflow-wrap: anywhere;
}
#notice {
  background: var(--surface-canvas);
  border-color: var(--focus-ring);
  color: var(--red);
}
hr {
  border: 0;
  border-top: var(--line);
  margin: 28px 0;
}
.success {
  color: var(--green);
  font-weight: 650;
}
.danger {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 4px 4px 0 light-dark(#b4684926, #080d0866);
}
.danger:hover {
  background: var(--status-error-text);
}
.danger.secondary {
  background: var(--paper);
  color: var(--red);
  box-shadow: none;
}
.danger.secondary:hover {
  background: var(--surface-canvas);
}
.danger.quiet {
  background: none;
  color: var(--red);
  box-shadow: none;
}
@media (max-width: 1100px) {
  header {
    padding-left: 28px;
    padding-right: 28px;
  }
  main {
    padding: 28px;
  }
}
@media (max-width: 800px) {
  header {
    padding: 18px 20px;
    gap: 16px;
  }
  header nav {
    gap: 16px;
    font-size: 16px;
  }
  header nav form {
    padding-left: 16px;
  }
  main,
  .app main {
    padding: 24px 20px;
  }
  h1 {
    font-size: 38px;
  }
  .card {
    padding: 22px;
  }
}
@media (max-width: 550px) {
  :root {
    font-size: 16px;
  }
  header {
    padding: 16px;
  }
  header nav {
    gap: 12px;
    font-size: 14px;
  }
  header nav form {
    padding-left: 12px;
  }
  main,
  .app main {
    padding: 24px 16px;
  }
  h1,
  .narrow h1 {
    font-size: 34px;
    letter-spacing: -0.8px;
  }
  h2 {
    font-size: 26px;
  }
  .card {
    padding: 18px;
  }
  .narrow {
    margin: 16px auto;
  }
  input,
  select {
    font-size: 16px;
    padding: 10px 12px;
  }
  button,
  .button {
    font-size: 16px;
    padding: 10px 16px;
  }
  input[type="file"] {
    font-size: 14px;
    padding: 6px;
  }
  .muted {
    font-size: 14px;
  }
}
/* Task-oriented layouts retain the shared visual language. */
textarea {
  display: block;
  width: 100%;
  padding: 12px;
  border: var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  min-height: 100px;
  margin-top: 7px;
  resize: vertical;
}

summary {
  display: block;
  cursor: pointer;
  font-weight: 500;
  padding: 12px 0;
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
.disclosure-indicator {
  display: inline-block;
  width: 3ch;
  margin-right: 0.6em;
  flex-shrink: 0;
  font-family: var(--mono);
}
.disclosure-indicator::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
}
details[open] > summary > .disclosure-indicator::before {
  content: "";
  transform: rotate(45deg);
}
details > form {
  margin: 16px 0;
}
.count {
  font-size: 14px;
  padding: 2px 6px;
  color: var(--ink);
  background: var(--sage);
}

.action-row {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}
progress {
  display: block;
  width: 100%;
  accent-color: var(--green);
  margin: 8px 0;
}
@media (max-width: 900px) {
  header {
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px;
  }
}

@media (max-width: 1100px) {
  header {
    flex-wrap: wrap;
    gap: 16px;
  }
}

/* Shared form and list rules keep both modules consistent. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
input[type="checkbox"],
input[type="radio"] {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--green);
}
:is(main, .card, .action-row) > * {
  min-width: 0;
}
h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
select[multiple] {
  min-height: 100px;
}
@media (min-width: 901px) and (max-width: 1200px) {
  header {
    gap: 12px;
    padding: 12px 16px;
  }
}
@media (max-width: 550px) {
  header {
    gap: 10px;
    padding: 12px 16px;
  }
}
@media (max-width: 800px) {
  .app main {
    padding: 20px 16px;
  }
}
@media (min-width: 651px) {
  html:has(body.app) {
    scrollbar-gutter: stable;
  }
}
