/* DNC Peptides. Light paper, black ink, coral and teal accents. */
:root {
  --ink: #1c2626;
  --muted: #556565;
  --paper: #fafbf9;
  --panel: #ffffff;
  --line: #d6e0da;
  --teal: #0f5f57;
  --teal-dark: #0a4942;
  --soft: #eaf3ef;
  --coral: #b63a2c;
  --peach: #fff1e9;
  --warn: #8a5a00;
  --warn-soft: #fff6e3;
  --radius: 14px;
  --accent: var(--teal);
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body { min-height: 100vh; }

a { color: var(--teal-dark); }
a:hover { text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--panel);
  padding: 10px 14px;
  z-index: 10;
}
.skip:focus { left: 8px; top: 8px; }

/* --- header ------------------------------------------------------------- */

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}
.brand img, .brand svg { width: 32px; height: 32px; }
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--accent-surface, var(--accent));
  color: var(--accent-ink, #fff);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.topnav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-left: auto; align-items: center; }
.topnav a { color: var(--ink); text-decoration: none; padding: 6px 2px; border-bottom: 2px solid transparent; }
.topnav a:hover, .topnav a[aria-current="page"] { border-bottom-color: var(--accent-edge, var(--accent)); }
.whoami { color: var(--muted); font-size: 0.85rem; }

/* --- layout ------------------------------------------------------------- */

main { max-width: 1080px; margin: 0 auto; padding: 22px 18px 64px; }
main.wide { max-width: 1240px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 6px; }
h2 { font-size: 1.2rem; margin: 26px 0 8px; }
h3 { font-size: 1.02rem; margin: 18px 0 6px; }
p { margin: 0 0 12px; }
.lede { font-size: 1.05rem; color: var(--muted); margin-bottom: 18px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 0 0 16px;
}
.card.narrow { max-width: 520px; margin: 48px auto; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.tile {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-edge, var(--accent));
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink);
}
.tile:hover { border-color: var(--accent); background: var(--soft); }
.tile h3 { margin: 0 0 4px; }
.tile p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* --- badges and notices -------------------------------------------------- */

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--accent-strong, var(--teal-dark));
  white-space: nowrap;
}
.badge.hold { background: var(--peach); border-color: #f0c6b5; color: var(--coral); }
.badge.warn { background: var(--warn-soft); border-color: #e8cf9a; color: var(--warn); }
.badge.grade { background: #fff; }
.badge.draft { background: #f1f1f1; color: #3a3a3a; }
.badge.ok { background: #e7f4ec; border-color: #b9ddc6; color: #15633a; }

.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-edge, var(--accent));
  background: var(--soft);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 14px;
}
.notice.hold { background: var(--peach); border-left-color: var(--coral); }
.notice.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.notice.ok { background: #e7f4ec; border-left-color: #15633a; }
.notice h3 { margin: 0 0 4px; font-size: 0.98rem; }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.mono { font-family: "Cascadia Mono", Consolas, "Courier New", monospace; font-size: 0.9rem; word-break: break-all; }

/* --- buttons and forms --------------------------------------------------- */

.btn, button, input[type="submit"] {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--accent-hover, var(--teal-dark));
  background: var(--accent-surface, var(--teal));
  color: var(--accent-ink, #fff);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover, button:hover { background: var(--accent-hover, var(--teal-dark)); color: var(--accent-ink, #fff); }
.btn.secondary, button.secondary {
  background: var(--panel);
  color: var(--accent-strong, var(--teal-dark));
  border-color: var(--line);
}
.btn.secondary:hover, button.secondary:hover { background: var(--soft); }
.btn.danger, button.danger { background: var(--coral); border-color: #8d2b20; }
.btn[aria-disabled="true"], button:disabled {
  background: #e6e9e7;
  color: #6c7a74;
  border-color: var(--line);
  cursor: not-allowed;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 0; }
.actions.right { justify-content: flex-end; }

fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; }
label { display: block; font-weight: 600; margin: 0 0 4px; }
.field { margin: 0 0 18px; }
.field > .help { color: var(--muted); font-size: 0.9rem; margin: 0 0 6px; }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="password"], input[type="search"], select, textarea {
  font: inherit;
  width: 100%;
  max-width: 560px;
  padding: 9px 10px;
  border: 1px solid #a8b5ae;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 92px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent-edge, var(--teal)); }
.choice { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 7px; font-weight: 400; }
.choice label, label.choice { font-weight: 400; margin: 0; }
.states { margin: 8px 0 0; padding: 8px 10px; background: var(--soft); border-radius: 8px; }
.states legend, .states .states-title { font-size: 0.85rem; font-weight: 700; color: var(--accent-strong, var(--teal-dark)); }
.states .choice { display: inline-flex; margin: 0 14px 0 0; font-size: 0.9rem; }
.err { color: var(--coral); font-weight: 600; }
.errorbox { border: 1px solid var(--coral); background: var(--peach); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; }
.errorbox ul { margin: 6px 0 0 18px; }

/* --- tables -------------------------------------------------------------- */

table { border-collapse: collapse; width: 100%; margin: 0 0 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 0.95rem; }
th { background: var(--soft); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
.table-wrap { overflow-x: auto; }
.repeat-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0 0 12px; background: #fcfdfc; }
.repeat-row h4 { margin: 0 0 8px; font-size: 0.95rem; }

/* --- disclosure tiles ---------------------------------------------------- */

details.tilebox {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  margin: 0 0 10px;
}
details.tilebox > summary {
  cursor: pointer;
  padding: 13px 15px;
  font-weight: 700;
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
details.tilebox > summary:hover { background: var(--soft); }
details.tilebox[open] > summary { border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; }
details.tilebox .tilebody { padding: 2px 15px 14px; }
details.tilebox .summaryline { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
details.sub { border-style: dashed; margin-left: 0; }
.sourcelist { margin: 8px 0 0; padding: 0; list-style: none; }
.sourcelist li { font-size: 0.88rem; padding: 4px 0; border-top: 1px dotted var(--line); }
.sourcelist li:first-child { border-top: 0; }

.stage { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stepbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.stepbar li {
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef1ef;
  color: var(--muted);
  border: 1px solid var(--line);
}
.stepbar li.done { background: var(--soft); color: var(--accent-strong, var(--teal-dark)); }
.stepbar li.now { background: var(--accent-surface, var(--teal)); color: var(--accent-ink, #fff); border-color: var(--accent-hover, var(--teal-dark)); font-weight: 700; }

.progress {
  height: 10px;
  background: #e8ece9;
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0 12px;
  max-width: 360px;
}
.progress span { display: block; height: 100%; background: var(--teal); }

.taskrow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-edge, var(--accent));
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 10px;
  background: var(--panel);
}
.taskrow .when { font-weight: 700; }
.taskrow form { display: inline; }

footer.sitefoot {
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.85rem;
  padding: 16px 18px 40px;
}
footer.sitefoot .inner { max-width: 1080px; margin: 0 auto; }

body.plain { display: grid; place-items: start center; }

@media (max-width: 620px) {
  main { padding: 16px 12px 56px; }
  h1 { font-size: 1.35rem; }
  .topnav { width: 100%; margin-left: 0; }
  th, td { font-size: 0.9rem; padding: 7px 8px; }
  .btn, button { width: 100%; text-align: center; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn, .actions button { width: 100%; }
}

@media print {
  .topnav, .actions { display: none; }
}

/* --- utility classes ------------------------------------------------------ */
/* These replace inline style attributes, which the content security policy
   blocks on purpose. */

.mt-xs { margin-top: 6px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 14px; }
.mb-md { margin: 0 0 14px; }
.m-0 { margin: 0; }
.tight { margin: 6px 0 0; }
.tight-xs { margin: 4px 0 0; }
.sourcehead { margin: 10px 0 2px; }
.inline-form { display: inline; }
.inline-label { display: inline; font-weight: 400; }
.narrow-form { max-width: 520px; }
.narrow-form.sign-in { max-width: 460px; }
.state-menu { width: auto; max-width: 220px; padding: 4px 6px; }
.mark-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--line);
  vertical-align: middle;
  margin-right: 6px;
}

/* A progress bar with no inline width: the browser draws the value. */
progress.progress {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  max-width: 360px;
  height: 10px;
  margin: 6px 0 12px;
  border: 0;
  border-radius: 999px;
  background: #e8ece9;
  color: var(--teal);
}
progress.progress::-webkit-progress-bar { background: #e8ece9; border-radius: 999px; }
progress.progress::-webkit-progress-value { background: var(--accent-edge, var(--teal)); border-radius: 999px; }
progress.progress::-moz-progress-bar { background: var(--accent-edge, var(--teal)); border-radius: 999px; }
