:root {
  font: 16px/1.5 system-ui, sans-serif;
  color: #213932;
  background: #f4f6f0;
  --accent: #235d49;
  --line: #d9e3d9;
  --muted: #52665c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.top { background: #1c4036; color: #fff; }
.wrap { width: min(1420px, calc(100% - 2.5rem)); margin-inline: auto; }
main { padding: 2rem 0 4rem; }
.masthead { display: flex; justify-content: space-between; align-items: center; min-height: 4rem; }
.brand { color: inherit; text-decoration: none; font-size: 1.2rem; font-weight: 750; }
.brand span { color: #b9dfaa; margin-left: .65rem; font-weight: 500; }
h1, h2, h3, p { margin-top: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.75rem, 4vw, 2.65rem); line-height: 1.08; letter-spacing: -.035em; margin-bottom: 1.2rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; background: var(--accent); color: #fff; border: 1px solid transparent; border-radius: .55rem; padding: .56rem .92rem; }
button:disabled { opacity: .55; cursor: wait; }
button.quiet, .photo-picker { background: #edf4ed; border-color: var(--line); color: #254c3e; }
.photo-picker {
  display: block; text-align: center; cursor: pointer; font: inherit;
  border: 1px solid var(--line); border-radius: .55rem; padding: .56rem .92rem;
}
button:hover:not(:disabled), .photo-picker:hover { filter: brightness(.94); }
label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 620; }
input, select, textarea { color: inherit; width: 100%; min-width: 0; padding: .5rem; border: 1px solid #aebfb4; border-radius: .4rem; background: white; }
form { display: grid; gap: .75rem; }
.panel { background: white; border: 1px solid var(--line); border-radius: .9rem; padding: clamp(.9rem, 2vw, 1.45rem); min-width: 0; }
.intro, .profile-controls, .actions { display: flex; align-items: end; gap: .65rem; flex-wrap: wrap; }
.intro { justify-content: space-between; margin-bottom: 1.25rem; }
.intro h1 { margin-bottom: 0; }
.profile-controls select { min-width: 10rem; }
nav { display: flex; gap: .4rem; margin-bottom: 1rem; }
.tab { background: transparent; color: var(--accent); }
.tab[aria-pressed=true] { background: #dcebdc; }
.layout { display: grid; grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.documents { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .4rem; }
.documents button { width: 100%; text-align: left; overflow-wrap: anywhere; }
.documents button[aria-current=true] { border-color: var(--accent); }
.document-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; align-items: baseline; }
.review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1rem; }
.preview { width: 100%; min-height: 16rem; max-height: 75vh; object-fit: contain; border: 1px solid var(--line); border-radius: .45rem; background: #f4f6f4; }
fieldset { border: 1px solid var(--line); border-radius: .55rem; margin: 0; min-width: 0; padding: .7rem; }
fieldset:disabled input { opacity: .85; }
.rows { display: grid; gap: .65rem; }
.measurement { display: grid; gap: .55rem; grid-template-columns: 1fr 1fr; }
.measurement .wide { grid-column: 1 / -1; }
.measurement button { justify-self: start; grid-column: 1 / -1; }
.muted { color: var(--muted); }
.notice, .warning { padding: .7rem 1rem; background: #fff4de; border-radius: .5rem; color: #684717; }
.series { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: .85rem; margin: 1rem 0; }
.chart { display: block; width: min(100%, 40rem); aspect-ratio: 2.7; }
.chart text { font-size: 12px; fill: var(--muted); }
.chart circle { fill: var(--accent); stroke: white; stroke-width: 2; }
.chart a:focus circle, .chart a:hover circle { stroke: #cc722b; stroke-width: 4; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; overflow-wrap: anywhere; }
td, th { text-align: left; vertical-align: top; padding: .4rem; border-bottom: 1px solid var(--line); }
summary { cursor: pointer; }
#summary { margin-top: 1rem; }
#summary article { margin-block: 1.25rem; }
#period + p { margin: .75rem 0 0; }
@media (max-width: 940px) { .review { grid-template-columns: 1fr; } }
@media (max-width: 650px) { .layout { grid-template-columns: 1fr; } }
@media print {
  .top, .intro, .composer, nav, #trends-view > :not(#summary), #summary button { display: none; }
  body, #summary { background: white; }
  .wrap { width: 100%; }
}

.transcript-actions { margin-top: .65rem; }
textarea { resize: vertical; }

.landing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: start; gap: 1rem; max-width: 64rem; margin-inline: auto; }
.sign-in { display: inline-block; margin-bottom: .6rem; }
.example-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.example-paper { background: #f4f6f0; border: 1px solid var(--line); border-radius: .55rem; padding: .85rem; }
.example-grid dt { color: var(--muted); }
.example-grid dd { margin: 0 0 .5rem; font-weight: 650; }
.example-outcome { margin-top: 1rem; }
.example-outcome summary { cursor: pointer; color: var(--accent); }
.example-chart { margin: 1rem 0; }
.example-chart > div { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .65rem; margin-top: .45rem; }
.example-bar { height: .6rem; border-radius: .3rem; background: var(--accent); }
.example-bar-first { width: 82.5%; opacity: .7; }
.example-bar-last { width: 86.25%; }
.composer { max-width: 34rem; margin-bottom: 1rem; display: grid; gap: .8rem; }
.composer p { margin: 0; }
.composer button { justify-self: start; }
#archive-list.archive-list-alone { max-width: 34rem; grid-column: 1 / -1; }
#archive-list[hidden] + #document { grid-column: 1 / -1; }
#review-title, #add-title, #trends-title { scroll-margin-top: 1rem; }
#review-status:empty, #add-status:empty { display: none; }
.review-tabs { display: flex; gap: .4rem; margin-bottom: 1rem; }
.confirmed-actions { margin-top: 1rem; }
@media (max-width: 650px) {
  #document { grid-row: 1; }
  .landing { grid-template-columns: 1fr; }
  .example-grid { grid-template-columns: 1fr; }
  .profile-controls { width: 100%; }
  .profile-controls select { min-width: 0; }
  table { font-size: .82rem; }
  td, th { padding-inline: .25rem; }
  th, td:first-child { white-space: nowrap; }
}
