/* Common Ground Supervision — pilot UI. One stylesheet, no script, no web fonts.
   Calm and legible first: this is a working tool for people in the middle of a day. */

:root {
  --ink: #1d2a2c;
  --ink-soft: #55676a;
  --ground: #f5f3ee;
  --surface: #ffffff;
  --line: #d9d5cb;
  --brand: #1f5f5b;
  --brand-dark: #164744;
  --brand-tint: #e6f0ef;
  --alert: #8f2d1f;
  --alert-tint: #fbebe8;
  --ok: #24613a;
  --ok-tint: #e7f3ea;
  --note-tint: #fff6dc;
  --radius: 6px;
}

* { box-sizing: border-box; }

html { font-size: 100%; }

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

.wrap { max-width: 56rem; margin: 0 auto; padding: 0 1.25rem; }

.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: 0.5rem 0.75rem; z-index: 10; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- header ------------------------------------------------------------- */
.site-header { background: var(--brand); color: #fff; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 0.85rem; padding-bottom: 0.85rem; }
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; letter-spacing: 0.01em; }
.brand span { font-weight: 400; opacity: 0.85; }
.site-header nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; }
.site-header nav a, .site-header nav button.link { color: #fff; }
.site-header nav form { margin: 0; }

/* --- content ------------------------------------------------------------ */
main { padding-top: 1.75rem; padding-bottom: 2.5rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
}
.card.narrow { max-width: 32rem; margin-left: auto; margin-right: auto; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 0 0 0.75rem; }
p, ul, ol, dl, table { margin: 0 0 1rem; }
.card > :last-child { margin-bottom: 0; }

a { color: var(--brand-dark); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }

.quiet { color: var(--ink-soft); font-size: 0.95rem; }

/* --- forms -------------------------------------------------------------- */
label { display: block; font-weight: 600; margin: 1rem 0 0.3rem; }

input[type="text"], input[type="email"], input[type="password"] {
  display: block; width: 100%;
  font: inherit; color: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid #8a9a9c; border-radius: var(--radius);
  background: #fff;
}

button, a.button {
  display: inline-block;
  font: inherit; font-weight: 600;
  margin-top: 1.1rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--brand); border-radius: var(--radius);
  background: var(--brand); color: #fff;
  text-decoration: none; cursor: pointer;
}
button:hover, a.button:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

button.secondary, a.button.secondary { background: var(--surface); color: var(--brand-dark); }
button.secondary:hover, a.button.secondary:hover { background: var(--brand-tint); color: var(--brand-dark); }

button.small { margin-top: 0; padding: 0.3rem 0.7rem; font-size: 0.95rem; }

button.link {
  margin: 0; padding: 0; border: 0; background: none;
  font-weight: 400; text-decoration: underline; text-underline-offset: 0.15em;
}
button.link:hover { background: none; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid #f2b705; outline-offset: 2px;
}

/* --- messages ----------------------------------------------------------- */
.alert, .success, .note { padding: 0.7rem 0.9rem; border-radius: var(--radius); border-left: 4px solid; }
.alert { background: var(--alert-tint); border-color: var(--alert); color: var(--alert); font-weight: 600; }
.success { background: var(--ok-tint); border-color: var(--ok); color: var(--ok); font-weight: 600; }
.note { background: var(--note-tint); border-color: #b98900; }

.tag { display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--brand-tint); color: var(--brand-dark); font-size: 0.85rem; font-weight: 600; }

/* --- facts, tables, codes ---------------------------------------------- */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; }
dl.facts dt { color: var(--ink-soft); }
dl.facts dd { margin: 0; font-weight: 600; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.6rem 0.55rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; }
td form { margin: 0; }

.setup-key, .codes .code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
  font-variant-numeric: slashed-zero;
}
.setup-key {
  font-size: 1.35rem; letter-spacing: 0.06em; word-spacing: 0.35em; line-height: 1.9;
  background: var(--brand-tint); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
ol.codes { list-style: decimal inside; columns: 2; column-gap: 2rem; padding: 0.9rem 1rem; background: var(--brand-tint); border: 1px solid var(--line); border-radius: var(--radius); }
ol.codes .code { font-size: 1.1rem; letter-spacing: 0.05em; padding: 0.15rem 0; break-inside: avoid; }

/* --- slice UI-2: forms, the instrument, the portfolio ------------------- */
.crumb { margin: 0 0 0.75rem; font-size: 0.95rem; }
.card.narrow-form form { max-width: 34rem; }
.field { margin: 0; }
.hint { margin: 0 0 0.3rem; color: var(--ink-soft); font-size: 0.92rem; }

select, textarea, input[type="date"], input[type="file"] {
  display: block; width: 100%;
  font: inherit; color: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid #8a9a9c; border-radius: var(--radius);
  background: #fff;
}
textarea { resize: vertical; min-height: 5rem; }
select:focus-visible, textarea:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }

.deid-notice {
  margin: 0.4rem 0 0; padding: 0.5rem 0.75rem;
  background: var(--note-tint); border-left: 4px solid #b98900; border-radius: var(--radius);
  font-size: 0.9rem; line-height: 1.45;
}
.attribution { margin-top: 1rem; color: var(--ink-soft); font-size: 0.85rem; }
.prose { white-space: pre-line; }
.alert ul, ul.plain { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.alert p { margin: 0; }
ul.todo { padding-left: 1.2rem; }
ul.todo li { margin-bottom: 0.4rem; }

button.danger { background: var(--surface); color: var(--alert); border-color: var(--alert); }
button.danger:hover { background: var(--alert-tint); color: var(--alert); border-color: var(--alert); }
button.spaced { margin-top: 0.75rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.actions button { margin-top: 0; }
.tag.label { background: var(--note-tint); color: #6b5200; }

ul.pills { list-style: none; margin: 0 0 0.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
ul.pills a { display: inline-block; padding: 0.2rem 0.65rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--surface); }
ul.pills a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
ul.pills a[aria-current="page"] .quiet { color: #fff; }

details { margin: 0 0 1rem; }
details summary { cursor: pointer; color: var(--brand-dark); }
details[open] summary { margin-bottom: 0.5rem; }
details.cluster-choice { border-top: 1px solid var(--line); padding: 0.6rem 0; margin: 0; }
details.cluster-choice:first-of-type { border-top: 0; }

fieldset.item { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 0.9rem 0 0.8rem; min-width: 0; }
fieldset.item legend { padding: 0; float: left; width: 100%; margin-bottom: 0.5rem; font-weight: 400; }
fieldset.item .choices, fieldset.item .answer { clear: both; }
.code { font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; font-size: 0.82rem; color: var(--ink-soft); margin-right: 0.35rem; }
.kind { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--brand-dark); background: var(--brand-tint); border-radius: 3px; padding: 0.05rem 0.35rem; margin-right: 0.35rem; }
.choices { display: flex; flex-wrap: wrap; gap: 0.35rem 1.4rem; }
label.choice { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; font-weight: 400; cursor: pointer; }
label.choice input { width: 1.1rem; height: 1.1rem; accent-color: var(--brand); }
label.choice.unanswered { color: var(--ink-soft); }
.answer { margin: 0; }

/* --- footer ------------------------------------------------------------- */
.site-footer { color: var(--ink-soft); font-size: 0.9rem; padding-bottom: 2rem; }

@media (max-width: 34rem) {
  .card { padding: 1.1rem 1.1rem; }
  ol.codes { columns: 1; }
  th:nth-child(2), td:nth-child(2) { display: none; }
}

@media print {
  .site-header, .site-footer, .crumb, form, a.button { display: none; }
  body { background: #fff; }
  .card { border: 0; padding: 0; }
}
