@font-face {
  font-family: Lato;
  src: url('/lato-regular.woff') format('woff');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('/open-sans-regular.woff') format('woff');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('/open-sans-semibold.woff') format('woff');
  font-weight: 600;
  font-display: swap;
}
:root {
  color-scheme: light;
  --brand: #2caa46;
  --spring: #77dd77;
  --honey: #ffcf25;
  --green: #217735;
  --deep-green: #185e29;
  --tint: #edf8ed;
  --paper: #f8faf7;
  --ink: #26352b;
  --muted: #58645b;
  --line: #d4dfd4;
  --field-line: #889a8b;
  --heading: Lato, 'Trebuchet MS', Arial, sans-serif;
  font: 16px/1.55 'Open Sans', Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; touch-action: manipulation; }
button { cursor: pointer; color: inherit; border: 0; background: none; }
button:disabled { cursor: wait; opacity: .6; }
:where(button, input, textarea, select, svg, summary):focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.mast { background: #fff; border-bottom: 1px solid var(--line); }
.bar, main { width: min(calc(100% - 2.5rem), 68rem); margin-inline: auto; }
.bar { min-height: 91px; display: flex; align-items: center; justify-content: space-between; }
.bar #nav { margin-left: auto; }
#login-heading { margin: 0 0 0 .4rem; white-space: nowrap; font-size: clamp(1.6rem, 3vw, 2.5rem); }
.brand-logo { display: block; width: 207px; height: auto; margin-left: -32px; }
main { padding: clamp(1.75rem, 4vw, 3.4rem) 0 5rem; outline: 0; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { color: var(--green); font-family: var(--heading); font-weight: 400; line-height: 1.14; }
h1 { margin: .1em 0 .27em; font-size: clamp(2.25rem, 4.5vw, 3.55rem); letter-spacing: -.035em; }
h2 { margin-bottom: .6em; font-size: clamp(1.5rem, 2.7vw, 2rem); letter-spacing: -.02em; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { color: var(--muted); }
.lead { font-size: 1.04rem; max-width: 60ch; margin: 0 0 2rem; }

.primary, .secondary, .plain, .back {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 10px 18px; border-radius: 7px; font-weight: 600;
}
.primary { color: #fff; background: var(--green); border: 1px solid var(--green); }
.primary:hover { background: var(--deep-green); border-color: var(--deep-green); }
.secondary { border: 1px solid #7ca585; color: var(--green); background: #fff; }
.secondary:hover, .plain:hover, .back:hover { background: var(--tint); }
.plain, .back { color: var(--green); padding: 8px 11px; }
.back { margin: 0 0 1rem -11px; font-size: .92rem; }

.login {
  width: min(100%, 57rem); margin: clamp(1rem, 5vh, 4rem) auto;
  display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 36px #172f1d0b;
}
.login-intro {
  min-height: 385px;
  background: url('/woodlands-garden.webp') 45% center / cover no-repeat;
}
.login-form { padding: clamp(1.6rem, 4vw, 3.15rem); align-self: center; }
.login-form h2 { font-size: 2.1rem; margin-bottom: 1.2rem; }
.login-form .primary { width: 100%; margin-top: 1.4rem; }

label, .field-label, legend { display: block; font-weight: 600; font-size: .95rem; }
input:not([type=checkbox]):not([type=radio]), textarea, select {
  display: block; width: 100%; min-height: 46px; margin-top: .38rem;
  border: 1px solid var(--field-line); border-radius: 6px; background: #fff;
  color: var(--ink); padding: .66rem .78rem;
}
textarea { min-height: 92px; resize: vertical; }
label + label { margin-top: 1rem; }
.homegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.25rem; }
.home-card, .panel, .record {
  border: 1px solid var(--line); border-radius: 11px; background: #fff;
}
.home-card {
  border-top: 4px solid var(--brand); padding: clamp(1.4rem, 3vw, 2.05rem);
  display: flex; align-items: flex-start; flex-direction: column;
}
.home-card + .home-card { border-top-color: var(--honey); }
.home-card p { flex: 1; }
.card-heading, .card-actions { display: flex; align-items: center; gap: .75rem; }
.card-heading { margin-bottom: .9rem; }
.card-actions { flex-wrap: wrap; margin-top: auto; }
.home-card h2 { margin: 0; }
.home-card .primary, .home-card .secondary { margin-top: .6rem; }
.card-icon {
  font-size: 1.45rem; line-height: 1; display: grid; place-items: center;
  color: var(--green); background: var(--tint); border-radius: 8px; height: 46px; width: 46px; flex: 0 0 46px;
}
.home-card + .home-card .card-icon { background: #fff6d7; color: #785900; }
.form-shell, .completed-header { max-width: 54rem; }
.panel { padding: clamp(1.2rem, 3.5vw, 2.1rem); margin-bottom: 1rem; }
.panel h2 { margin-bottom: 1.15rem; padding-bottom: .7rem; border-bottom: 1px solid #d8ecd8; }
.fields { display: grid; gap: 1.2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields > label, .fields fieldset { margin: 0; min-width: 0; }
.wide { grid-column: 1 / -1; }
.stack > * + * { margin-top: 1.25rem; }
fieldset { padding: 0; border: 0; margin: 0; min-width: 0; }
legend { margin-bottom: .5rem; }
.choices { display: flex; gap: .55rem; flex-wrap: wrap; }
.choice {
  min-height: 44px; border: 1px solid var(--line); background: #fbfdfb;
  display: inline-flex; align-items: center; gap: .55rem; border-radius: 7px;
  padding: .55rem .8rem; font-weight: 400; cursor: pointer;
}
.choice:has(input:checked) { background: var(--tint); color: var(--deep-green); border-color: var(--green); }
.choice input { width: 18px; height: 18px; accent-color: var(--green); margin: 0; }
.choice + .choice { margin: 0; }
.hint { font-size: .93rem; color: var(--muted); margin: .2rem 0 1rem; }
.pad { position: relative; border: 1px solid var(--field-line); border-radius: 7px; overflow: hidden; background: #fff; }
.pad.map { width: min(100%, 355px); aspect-ratio: 570/554; background: #fff url('/body-map.png') center/100% 100% no-repeat; }
.pad.illustrated-map {
  width: min(100%, 36rem);
  aspect-ratio: 3 / 2;
  background-image: url('/body-map-illustrated-v1.webp');
}
.pad.sign { aspect-ratio: 3.4; max-width: 35rem; }
.pad.sign::before { content: ''; position: absolute; bottom: 21%; left: 6%; right: 6%; border-bottom: 1px dashed #adbaaf; }
.pad svg { display: block; position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.pad.editable svg { cursor: crosshair; }
.tools { display: flex; gap: .4rem; margin-top: .2rem; }
.tools button { font-size: .88rem; padding: 8px 11px; min-height: 40px; }
.tools button:disabled { opacity: .46; cursor: default; }
.actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 1.35rem 0; }
.error { color: #97352c; font-weight: 600; margin: .5rem 0; }
.error:empty { display: none; }
.list { display: grid; gap: .7rem; margin-top: 1.3rem; }
.record { display: flex; align-items: center; text-align: left; gap: 1rem; padding: 1rem 1.2rem; width: 100%; }
.record:hover { border-color: var(--brand); background: #fbfefb; }
.filters { display: flex; align-items: end; gap: .8rem; }
.filters label { flex: 1; margin: 0; min-width: 0; }
.filters label:first-child { flex: 2; }
.filters input, .filters select { height: 46px; }
.identity-line { display: inline-flex; align-items: baseline; gap: .42em; min-width: 0; max-width: 100%; white-space: nowrap; }
.identity-line > :not(strong) { flex: none; }
.identity-line strong { overflow: hidden; text-overflow: ellipsis; }
.reference { color: var(--muted); font-size: .92em; }
.record-identity { margin: .4rem 0 1.1rem; overflow-x: auto; }
.record-identity .identity-line { max-width: none; }
.record-identity strong { overflow: visible; }
.completed-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; }
.export-icons { display: flex; gap: .375rem; }
.export-icon {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px;
  background: #fff; border: 1px solid var(--line); border-radius: 7px; cursor: default;
}
.export-icon:is(:hover, :focus-visible) { background: var(--tint); border-color: #7ca585; }
.export-icon:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.export-tip {
  position: absolute; z-index: 1; right: -1px; bottom: calc(100% + 7px); visibility: hidden;
  width: max-content; padding: .35rem .65rem; border-radius: 5px; background: var(--ink);
  color: white; font-size: .875rem; line-height: 1.4; pointer-events: none;
}
.export-tip::after {
  content: ''; position: absolute; top: 100%; right: 17px;
  border: 5px solid transparent; border-top-color: var(--ink);
}
.export-icon:is(:hover, :focus-visible) .export-tip { visibility: visible; }
.badge { flex: none; }
.record small, .meta { color: var(--muted); font-size: .87rem; }
.badge { display: inline-block; border-radius: 20px; padding: .23rem .65rem; background: #fff2c1; color: #694d00; font-size: .82rem; font-weight: 600; }
.badge.incomplete { background: #ecf0f4; color: #394b60; }
.badge.completed { background: var(--tint); color: var(--deep-green); }
.record .badge { margin-left: auto; }
.data { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1rem 2rem; margin: 0; }
.data dt { font-size: .84rem; color: var(--muted); font-weight: 600; }
.data dd { margin: .25rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sig-block { margin: 1rem 0; }
.sig-block .pad { margin-top: .5rem; max-width: 25rem; }
.policy { border-left: 3px solid var(--spring); padding-left: 1rem; color: var(--muted); font-size: .95rem; }
.empty { padding: 1.2rem; border: 1px dashed var(--field-line); border-radius: 8px; }
.topline { margin-bottom: .8rem; }
.notice { background: var(--deep-green); color: #fff; border-radius: 7px; padding: .65rem 1rem; box-shadow: 0 2px 8px #0002; }
#notice { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); max-width: 90%; z-index: 3; pointer-events: none; }
dialog { border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: 11px; width: min(92%, 25rem); padding: 1.6rem; color: var(--ink); }
dialog::backdrop { background: #112e1bd1; }
dialog .primary { margin-top: 1rem; }

@media (max-width: 650px) {
  .bar, main { width: calc(100% - 2rem); }
  .bar { min-height: 72px; }
  .brand-logo { width: 160px; margin-left: -20px; }
  .login { grid-template-columns: 1fr; margin: 0 auto; }
  .login-intro { min-height: 155px; background-position: center 47%; }
  .filters { gap: .4rem; }
  .filters label { font-size: .84rem; }
  .filters label:first-child { flex: 1.15; }
  .filters input, .filters select { padding-inline: .36rem !important; }
  .identity-line { font-size: .85rem; }
  .record { padding-inline: .7rem; }
  .login-form { padding: 1.45rem; }
  .homegrid, .fields { grid-template-columns: 1fr; }
  .record { flex-wrap: wrap; gap: .5rem; }
  .record .badge { margin-left: 0; }
  .record > span:first-child { width: 100%; }
  .pad.sign { aspect-ratio: 2.7; }
  .actions .primary { max-width: 100%; }
}

.account-list { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.account-row { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.account-row > div { flex: 1 1 15rem; min-width: 0; }
.account-row > span, .account-email { color: var(--muted); font-size: .9rem; }
.account-email { overflow-wrap: anywhere; }
.remove-user { color: #97352c; }

#nav { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; min-width: 0; }
.current-user { overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: .25rem; min-width: 0; white-space: nowrap; }
#signout { min-width: 0; gap: .3em; }
#manage-users-nav { flex: none; }
@media (max-width: 500px) {
  .bar:has(#signout) { flex-wrap: wrap; }
  #nav:has(#signout) { flex: 1 0 100%; padding-bottom: .5rem; }
}

button.export-icon { padding: 0; cursor: pointer; }
.sharepoint-picker { width: min(92%, 34rem); max-height: 85vh; overflow: auto; }
.sharepoint-picker .actions { justify-content: flex-end; align-items: center; }
.sharepoint-picker .actions .primary { margin: 0; }
.sp-breadcrumb { padding: .6rem 0; color: var(--muted); overflow-wrap: anywhere; }
.sp-breadcrumb .plain { padding: .25rem 0; }
.sp-folders { display: grid; gap: .35rem; max-height: 35vh; overflow-y: auto; }
.sp-folder { text-align: left; padding: .65rem .85rem; overflow-wrap: anywhere; }
.sp-folder::after { content: '›'; float: right; margin-left: .5rem; }
.sp-status { overflow-wrap: anywhere; }
.sharepoint-picker [hidden] { display: none; }
