:root {
  --bg: #F5F6F3; --surface: #FFFFFF; --line: #E4E6E1; --line-2: #DDE0DA; --soft: #FAFBF9;
  --ink: #1C2430; --ink-2: #3D4651; --muted: #5B6470;
  --teal: #0F6E6E; --teal-dark: #0B5F58; --teal-soft: #E3F2EF;
  --blue: #2849A0; --blue-soft: #E8EEFB;
  --amber: #8A4A06; --amber-soft: #FBF0E1; --amber-mid: #D9A35A;
  --grey-soft: #EEF0F2; --danger: #A12B2B; --danger-soft: #FBEAEA;
  --radius: 16px;
  --display: Manrope, Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--teal); } a:hover { color: #0A4F4F; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.25; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
.boot { padding: 80px; text-align: center; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Layout */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.nav { flex: 1 1 232px; max-width: 260px; background: var(--surface); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 3px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 20px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--teal); display: flex; align-items: center; justify-content: center; flex: 0 0 34px; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 17px; display: block; }
.brand-sub { font-size: 12px; color: var(--muted); display: block; }
.nav a.item { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); font-size: 14px; text-decoration: none; }
.nav a.item:hover { background: var(--soft); }
.nav a.item.active { background: var(--teal-soft); color: var(--teal-dark); font-weight: 600; }
.nav .sep { height: 1px; background: var(--line); margin: 12px 10px; }
.nav .who { margin-top: auto; padding: 14px 10px 0; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.badge { font-size: 12px; font-weight: 600; background: var(--blue); color: #fff; border-radius: 999px; padding: 1px 8px; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 40px 60px; display: flex; flex-direction: column; gap: 24px; max-width: 1200px; }
.row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-3 { flex: 3 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.col-2 { flex: 2 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.page-head .sub { color: var(--muted); margin-top: 6px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.crumb { font-size: 13px; color: var(--muted); }
.crumb a { text-decoration: none; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.card.accent { border: 2px solid var(--teal); }
.card.dark { background: var(--ink); color: #fff; border: 0; }
.card.dark .muted { color: #C9CFD6; }
.card.teal { background: var(--teal); color: #fff; border: 0; }
a.card { text-decoration: none; color: inherit; }
a.card:hover { border-color: #C4C9C2; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid #EEF0EC; text-decoration: none; color: inherit; }
.list-row:first-child { border-top: 0; }
.list-row .t { font-weight: 600; }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 14px; }

/* Pills */
.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; background: var(--grey-soft); color: var(--ink-2); }
.pill.teal { background: var(--teal-soft); color: var(--teal-dark); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--danger-soft); color: var(--danger); }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--soft); color: var(--ink); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: #0C5E5E; color: #fff; }
.btn.warn { color: var(--amber); border-color: var(--amber); }
.btn.danger { color: var(--danger); border-color: #E3B5B5; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.icon { width: 42px; padding: 0; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--teal); font-weight: 600; cursor: pointer; font-size: 14px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  min-height: 44px; padding: 10px 13px; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; font-size: 15px; font-weight: 400; width: 100%; }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid #9CD3CB; outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-2); }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--teal); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--soft); cursor: pointer; text-align: left; }
.choice.on { border: 2px solid var(--teal); background: var(--teal-soft); }
.choice.vote { align-items: center; justify-content: center; min-height: 60px; font-weight: 700; font-size: 16px; }
.choice.vote.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.search { max-width: 360px; }

/* Text */
.rich { font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.rich p + p, .rich p + ul, .rich ul + p { margin-top: 10px; }
.rich ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* Progress */
.bar { height: 8px; background: var(--grey-soft); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.bar.teal > span { background: var(--teal); }
.stackbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 3px; background: var(--grey-soft); }
.stackbar span { display: block; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 10px; }

/* Stats */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-family: var(--display); font-size: 28px; font-weight: 800; }
.stat span { font-size: 13px; color: var(--muted); }

/* Comments & feed */
.comment { display: flex; gap: 12px; }
.avatar { flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.comment .body { display: flex; flex-direction: column; gap: 3px; font-size: 14px; line-height: 1.5; min-width: 0; }
.comment .body .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.feed-item { display: flex; gap: 12px; font-size: 14px; line-height: 1.45; text-decoration: none; color: inherit; }
.feed-item .dot { margin-top: 6px; }

/* Ranked list */
.rank-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--soft); }
.rank-num { flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.rank-item .lbl { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; padding: 8px 10px 8px 0; }
table.t td { border-top: 1px solid #EEF0EC; padding: 11px 10px 11px 0; vertical-align: middle; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.tab.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Sign-in */
.signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.signin-box { width: 100%; max-width: 430px; display: flex; flex-direction: column; gap: 22px; }
.signin .brand { justify-content: center; padding: 0; }
.signin .card { padding: 30px; gap: 16px; }
.code-input { letter-spacing: 0.4em; font-size: 22px !important; text-align: center; font-weight: 700 !important; }

/* Document (Agreed changes) */
.doc { max-width: 880px; width: 100%; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 44px 52px; display: flex; flex-direction: column; gap: 26px; }
.doc header { border-bottom: 1px solid var(--line); padding-bottom: 20px; display: flex; flex-direction: column; gap: 6px; }
.doc .entry { background: var(--soft); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.doc .ba { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--teal-dark); }

/* Modal & toast */
.modal-back { position: fixed; inset: 0; background: rgba(20, 26, 34, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 620px; padding: 26px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,0.2); max-width: 90vw; }
.toast.err { background: var(--danger); }
.notice { background: var(--amber-soft); color: #6B3A05; border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.5; }
.notice.teal { background: var(--teal-soft); color: #0B4F49; }
.notice.blue { background: var(--blue-soft); color: #1F3A80; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--teal); font-size: 14px; }
pre.code { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 12px; white-space: pre-wrap; overflow-x: auto; }

/* Link back to the division home page (Adjuvant) */
.hub-back { display: inline-flex; align-items: center; align-self: flex-start; min-height: 36px; padding: 0 10px; margin-bottom: 6px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.hub-back:hover { background: var(--soft); color: var(--ink); }

@media (max-width: 760px) {
  .nav .hub-back { width: 100%; margin-bottom: 0; }
  .nav { max-width: none; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { width: 100%; padding-bottom: 8px; }
  .nav .sep { display: none; }
  .nav a.item { min-height: 38px; }
  .nav .who { width: 100%; flex-direction: row; justify-content: space-between; padding-top: 8px; }
  .main { padding: 20px 16px 48px; }
  .doc { padding: 26px 20px; }
  .doc .ba { grid-template-columns: 1fr; }
}
@media print {
  .nav, .no-print, #toast-root { display: none !important; }
  body, .main { background: #fff; padding: 0; }
  .doc { border: 0; padding: 0; max-width: none; }
  .doc .entry { break-inside: avoid; }
}
