:root { color-scheme: light; font: 16px/1.5 "Helvetica Neue", Arial, sans-serif; color: #212121; background: #f5f4f2; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; }
header, footer { padding: 12px max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left)); }
header { display: flex; align-items: center; gap: 16px; background: #fff; border-bottom: 1px solid #ded9d4; padding-top: max(12px, env(safe-area-inset-top)); }
header img { width: 112px; height: auto; }
footer { background: #212121; color: white; padding-bottom: max(12px, env(safe-area-inset-bottom)); font-size: .85rem; }
main { width: min(100%, 760px); margin: 0 auto; padding: 20px; flex: 1; }
h1, h2 { line-height: 1.2; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.55rem, 7vw, 2.3rem); font-weight: 400; }
h2 { font-size: 1.2rem; }
p, dd { overflow-wrap: anywhere; }
button, .button, input, textarea { border: 1px solid #ded9d4; background: white; color: inherit; font: inherit; border-radius: 3px; padding: 9px 12px; min-height: 44px; }
button, .button { cursor: pointer; text-align: center; text-decoration: none; }
button:disabled { opacity: .6; cursor: default; }
button[aria-pressed=true] { background: #f3e4e2; color: #8f1c18; }
.primary { color: white; background: #212121; }
nav, .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.search { display: grid; gap: 5px; margin: 16px 0; }
.card { padding: 15px; background: white; border: 1px solid #ded9d4; margin-bottom: 10px; }
button.card { display: block; width: 100%; text-align: left; }
.card strong, .card small { display: block; }
.due { color: #8f1c18; }
dl { display: grid; grid-template-columns: minmax(7rem, 32%) minmax(0, 1fr); gap: 6px 12px; }
dt { color: #605b57; } dd { margin: 0; white-space: pre-wrap; }
form { display: grid; gap: 8px; margin: 14px 0; }
textarea { width: 100%; }
#message:empty { display: none; }
[hidden] { display: none !important; }

main { width: min(100%, 1080px); padding: 28px clamp(18px, 4vw, 48px); }
header, footer { padding-left: max(20px, calc((100vw - 984px) / 2), env(safe-area-inset-left)); }
header strong { font-weight: 500; }
header #demo { background: #f3e4e2; color: #8f1c18; padding: 3px 10px; border-radius: 3px; font-size: .85rem; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metrics > div { background: white; border: 1px solid #ded9d4; padding: 14px; }
.metrics span, .metrics strong { display: block; }
.metrics span { font-size: .88rem; color: #605b57; }
.metrics strong { font-size: 1.65rem; margin-top: 4px; }
.research-panel { margin-bottom: 20px; }
summary { cursor: pointer; font-weight: 600; }
fieldset { border: 0; padding: 0; margin: 2px 0; }
fieldset label { display: inline-block; margin-right: 12px; }
input[type=checkbox] { min-height: auto; accent-color: #8f1c18; }
#research-status:empty { display: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0; }
.toolbar .search { margin: 0; flex: 0 1 330px; }
#projects { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
#projects .card { margin: 0; }
#projects .card:hover { border-color: #8f1c18; }
.project-select { display: grid; grid-template-columns: 1fr 44px; background: white; border: 1px solid #ded9d4; }
#projects .project-select .card { border: 0; }
.project-select input { justify-self: center; align-self: center; width: 18px; height: 18px; margin: 0; }
#selection-bar { margin-bottom: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 500px) {
  main { padding-top: 18px; }
  .metrics { gap: 5px; }
  .metrics > div { padding: 8px; }
  .metrics span { font-size: .75rem; }
  .toolbar .search { flex-basis: 100%; }
}

#account-actions { margin-left: auto; }
.auth-card { max-width: 550px; }
.auth-card label { display: grid; gap: 4px; }
.auth-card form { gap: 13px; }
.auth-card input { width: 100%; }
.auth-card small { color: #605b57; }
#totp-qr { background: white; border: 1px solid #ded9d4; }
#totp-secret, #recovery-codes { overflow-wrap: anywhere; white-space: pre-wrap; }
.member { border-top: 1px solid #ded9d4; padding: 12px 0; }
.member p { margin: 3px 0 8px; }
.requested-member { outline: 2px solid #8f1c18; outline-offset: 3px; padding-inline: 10px; }
#research-key-form label { display: grid; gap: 4px; max-width: 500px; }
@media (max-width: 500px) {
  header { flex-wrap: wrap; }
  #account-actions button { padding: 6px 9px; }
}
