/* WAI Chapter Portal. Colors, type, and layout from the approved design
   (docs/design/WAI_Chapter_Portal_Demo.html). No inline styles are used, so the
   Content Security Policy can block them. */
:root{--navy:#051C40;--sky:#1086C7;--sky-dk:#0B5E8C;--coral:#FD7476;--mist:#F3F6FB;--line:#DCE3EE;--ink:#1B2A41;--muted:#4A5A72;--ok:#1E6B3A;--ok-bg:#E4F4EA;--warn:#8A4B00;--warn-bg:#FFF1DD;--bad:#A3261F;--bad-bg:#FCE8E6;--info:#0B4A75;--info-bg:#E3EEFA}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:Lato,Arial,sans-serif;color:var(--ink);background:var(--mist);font-size:16px;line-height:1.5}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--coral);outline-offset:2px}
a{color:var(--sky-dk)}
.skip{position:absolute;left:-9999px;top:0;background:#fff;padding:8px 12px;z-index:20}
.skip:focus{left:8px;top:8px}
.sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Test version bar */
.testbar{background:#FFF4D6;color:#4A3600;text-align:center;padding:8px 16px;font-size:14px}
.testbar strong{font-weight:900}
.tabs{display:flex;justify-content:center;gap:8px;padding:10px 16px;background:#fff;border-bottom:1px solid var(--line);flex-wrap:wrap}
.tabs a,.tabs button{border:2px solid var(--navy);background:#fff;color:var(--navy);border-radius:999px;padding:7px 18px;font-weight:700;cursor:pointer;min-height:44px;text-decoration:none;display:inline-flex;align-items:center}
.tabs a[aria-current="page"]{background:var(--navy);color:#fff}

header.top{background:var(--navy);color:#fff;padding:18px 32px;display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;border-bottom:4px solid var(--coral)}
header.top .brand{font-size:13px;color:#C9D6EA}
header.top h1{margin:0;font-size:24px;font-weight:900}
header.top .who{text-align:right;font-size:14px;color:#C9D6EA}
header.top .who strong{display:block;color:#fff;font-size:17px}
header.top .btn.link{color:#fff;min-height:36px;padding:4px 0}
main{max-width:940px;margin:0 auto;padding:28px 20px 64px}
.card{background:#fff;border:1px solid var(--line);border-radius:10px;padding:24px 28px;margin-bottom:20px}
h2{margin:0 0 6px;font-size:21px;color:var(--navy)}
h2 .n{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:var(--navy);color:#fff;font-size:15px;margin-right:10px;vertical-align:2px}
h3{margin:18px 0 6px;color:var(--navy);font-size:17px}
h4{margin:14px 0 4px;color:var(--navy);font-size:15px}
.lead{margin:0 0 14px;color:var(--muted)}
.lead.flush,.flush{margin:0}
.big-title{font-size:28px}
.btn{border:2px solid var(--sky-dk);background:var(--sky-dk);color:#fff;border-radius:8px;padding:9px 16px;font-weight:700;cursor:pointer;min-height:44px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.btn.ghost{background:#fff;color:var(--sky-dk)}
.btn.link{border:none;background:none;color:var(--sky-dk);text-decoration:underline;padding:6px 4px;min-height:44px}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.big{font-size:18px;padding:13px 26px;background:var(--coral);border-color:var(--coral);color:var(--navy);font-weight:900}
.btn.sm{min-height:40px;padding:5px 12px;font-size:14px}
label.l,.l{display:block;font-size:14px;font-weight:700;color:var(--muted);margin-bottom:4px}
.req{color:var(--bad)}
.f{width:100%;padding:9px 11px;border:2px solid #8FA3BF;border-radius:8px;background:#fff;min-height:44px}
.f:focus{border-color:var(--sky)}
.f.badf{border-color:var(--bad)}
textarea.f{min-height:96px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px 16px}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.row.space{justify-content:space-between}
.row.center{justify-content:center}
.mt{margin-top:14px}
.mt0{margin-top:0}
.badge{display:inline-block;border-radius:20px;padding:3px 11px;font-size:13px;font-weight:700;white-space:nowrap;margin:2px 2px 2px 0}
.ok{background:var(--ok-bg);color:var(--ok)}.warn{background:var(--warn-bg);color:var(--warn)}.bad{background:var(--bad-bg);color:var(--bad)}.info{background:var(--info-bg);color:var(--info)}
/* Chapter type badges (staff dashboard). Each type has its own color, with its
   text label kept. Coral and red are not used: they mean warnings. Text
   contrast: sky 5.98:1, purple 8.11:1, amber 6.82:1 (WCAG AA needs 4.5:1). */
.badge.type{border:1px solid}
.type-intl{background:#DDF0FA;color:#0B5E8C;border-color:#1086C7}
.type-student{background:#EEE6F7;color:#5B2C83;border-color:#8C5CB8}
.type-prov{background:#FDF0C2;color:#6A4E00;border-color:#C99A1E}
.type-std{background:#F1F3F6;color:#3D4A5C;border-color:#8FA3BF}
/* "Not started": neutral grey, so it does not read as a warning (9.1:1). */
.neutral{background:#EEF1F5;color:#3D4A5C}

/* Staff dashboard */
progress{width:100%;height:18px;accent-color:var(--sky-dk)}
.attention{list-style:none;margin:0;padding:0}
.attention-item{border:1px solid var(--line);border-radius:8px;padding:12px 14px;margin-bottom:10px;background:#FCFDFF}
.attention-title{font-weight:700;margin:6px 0 2px}
.history{list-style:none;margin:0;padding:0}
.history>li{border-left:3px solid var(--line);padding:4px 0 8px 12px;margin-bottom:6px}
th[aria-sort] .sort{background:none;border:none;color:#fff;font-weight:700;cursor:pointer;padding:0;min-height:36px;text-align:left}
th[aria-sort] .sort:focus-visible{outline-color:var(--coral)}
.count{font-weight:400}
.search{max-width:420px}
summary{cursor:pointer;font-weight:700;color:var(--navy);min-height:32px}
.msg{border-left:5px solid var(--coral);background:var(--mist);border-radius:6px;padding:12px 16px;margin:12px 0}
.msg.ok{border-color:var(--ok);background:var(--ok-bg);color:var(--ok)}
.msg.bad{border-color:var(--bad);background:var(--bad-bg);color:var(--bad)}
.msg.warn{border-color:var(--warn);background:var(--warn-bg);color:var(--warn)}
.msg ul{margin:6px 0 0;padding-left:20px}
.hint{font-size:14px;color:var(--muted);margin-top:4px}
.note{font-size:14px;color:var(--muted);margin:-2px 0 8px}
.err{font-size:14px;color:var(--bad);margin-top:4px;font-weight:700}
table{width:100%;border-collapse:collapse;font-size:15px}
th{text-align:left;background:var(--navy);color:#fff;padding:9px 12px;font-weight:700}
td{border-bottom:1px solid var(--line);padding:10px 12px;vertical-align:middle}
td.actions{text-align:right}
.inline-select{width:auto;display:inline-block;min-width:170px}
.check{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border:2px solid var(--line);border-radius:8px;margin-bottom:10px;cursor:pointer}
.check input{width:22px;height:22px;margin-top:2px;flex:none}
.check.on{border-color:var(--ok);background:#F6FBF8}
fieldset{border:none;padding:0;margin:0}
legend{padding:0;font-weight:700;color:var(--navy);margin-bottom:8px}
.choice{display:flex;gap:10px;align-items:center;padding:10px 12px;border:2px solid var(--line);border-radius:8px;margin-bottom:8px;cursor:pointer;background:#fff}
.choice input{width:20px;height:20px;flex:none}
.agree{max-height:330px;overflow:auto;border:1px solid var(--line);border-radius:8px;padding:6px 18px;background:#FCFDFF;font-size:15px}
.agree li{margin:6px 0}
.panel{background:var(--mist);border:1px solid var(--line);border-radius:10px;padding:18px 20px;margin-top:14px}
.panel.ask{border:2px solid var(--sky-dk);background:#F4F9FD}
.persona{display:flex;justify-content:space-between;align-items:center;gap:12px;border:2px solid var(--line);border-radius:10px;padding:14px 16px;margin-bottom:10px;cursor:pointer;background:#fff;width:100%;text-align:left}
.persona:hover{border-color:var(--sky)}
.persona small{display:block;color:var(--muted)}
.signin{max-width:560px;margin:30px auto}
.done{text-align:center}
.cert{max-width:420px;width:100%;margin:16px auto;display:block;border:1px solid var(--line);box-shadow:0 6px 24px rgba(5,28,64,.18);background:#fff;transform:rotate(-1.5deg)}
@media (prefers-reduced-motion:no-preference){.cert{animation:land .7s ease-out}@keyframes land{from{opacity:0;transform:translateY(24px) rotate(2deg)}to{opacity:1;transform:rotate(-1.5deg)}}}
@font-face{font-family:"Pagella Bold Italic";src:url("/cert/Pagella-BoldItalic.ttf") format("truetype");font-display:swap}
@font-face{font-family:"Pagella";src:url("/cert/Pagella-Regular.ttf") format("truetype");font-display:swap}
@font-face{font-family:"Great Vibes";src:url("/cert/GreatVibes-Regular.ttf") format("truetype");font-display:swap}
.cert .t-title,.cert .t-name{font-family:"Pagella Bold Italic",Georgia,serif;fill:#1B2A41}
.cert .t-body{font-family:"Pagella",Georgia,serif;fill:#1B2A41}
.cert .t-sign{font-family:"Great Vibes",cursive;fill:#1B2A41}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:20px}
.stat{background:#fff;border:1px solid var(--line);border-radius:10px;padding:16px}
.stat b{display:block;font-size:30px;color:var(--navy)}
.stat span{color:var(--muted);font-size:14px}
.email{border:1px solid var(--line);border-radius:8px;padding:16px 18px;background:#FCFDFF;margin-bottom:12px}
.email pre,pre.report{white-space:pre-wrap;word-break:break-word;font-family:Consolas,Menlo,monospace;font-size:14px;margin:8px 0 0}
.ver{font-size:14px;color:var(--muted)}
.ver li{margin:3px 0}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--navy);color:#fff;padding:12px 18px;border-radius:8px;box-shadow:0 6px 20px rgba(0,0,0,.25);z-index:9;max-width:90%}
.loading{color:var(--muted);text-align:center;padding:40px 0}
[hidden]{display:none!important}

/* Phones */
@media (max-width:640px){
  header.top{padding:14px 18px}
  header.top .who{text-align:left}
  main{padding:18px 12px 48px}
  .card{padding:18px 16px}
  .stats{grid-template-columns:1fr 1fr}
  .stack thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
  .stack tr{display:block;border:1px solid var(--line);border-radius:8px;margin-bottom:10px;padding:6px 0;background:#fff}
  .stack td{display:flex;justify-content:space-between;gap:12px;border:none;padding:6px 12px;text-align:right}
  .stack td::before{content:attr(data-label);font-weight:700;color:var(--muted);text-align:left}
  .stack td.actions{display:block;text-align:left}
  .stack td.actions::before{display:block;margin-bottom:4px}
  .inline-select{width:100%}
}

/* Read-only chapter details (Nov 12, 2026) */
.ro-field .l { margin-bottom: 2px; }
.ro { padding: 8px 0; border-bottom: 1px solid #e3e6ea; min-height: 1.5em; overflow-wrap: anywhere; }
.ro.long { white-space: pre-wrap; }

/* Financial Report (Nov 12, 2026) */
table.fin { width: 100%; max-width: 560px; border-collapse: collapse; margin: 8px 0 16px; }
table.fin th, table.fin td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #e3e6ea; vertical-align: middle; }
table.fin td:last-child, table.fin th:last-child { text-align: right; width: 12rem; }
table.fin tfoot th, table.fin tfoot td, table.fin tbody th { font-weight: 700; }
table.fin input.amount { text-align: right; max-width: 11rem; }
table.fin output { font-variant-numeric: tabular-nums; }

/* Pilot feedback stars (web/chapter.js) */
fieldset.stars { border: 0; padding: 0; margin: 0; display: flex; gap: 4px; flex-wrap: wrap; }
fieldset.stars legend { font-weight: 600; margin-bottom: 6px; }
.star { cursor: pointer; font-size: 2rem; line-height: 1; color: var(--line, #c9ced6); }
.star.on { color: #b8860b; }
.star input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star input:focus-visible + span { outline: 3px solid #1a5fb4; outline-offset: 2px; }

/* The Portal FAQ link (web/chapter.js): stands out with a coral border (Nov 16, 2026). */
/* The Portal FAQ button (Nov 18, 2026): WAI coral (#FD7476) with navy text, 6.37 to 1 (readable text needs 4.5 to 1). Light blue text on coral was 2.25 to 1 at best, so it was not used. */
.faq-link { display: inline-block; background: #FD7476; color: #051C40; border: 2px solid #FD7476; border-radius: 6px; padding: 4px 12px; font-weight: 700; text-decoration: none; }
.faq-link:hover, .faq-link:focus-visible { background: #FD7476; color: #051C40; border-color: #051C40; text-decoration: underline; }

/* Financial Report information icons (Nov 18, 2026): WAI navy #051C40 with
   white, 17 to 1. The description shows on hover, keyboard focus, or a tap,
   and stays while the pointer is over it. */
.cat-tip { position: relative; display: inline-block; margin-left: 6px; vertical-align: middle; }
.info-tip { width: 24px; height: 24px; min-width: 24px; padding: 0; border: 2px solid var(--navy); border-radius: 50%; background: var(--navy); color: #fff;
  font: italic 700 14px/1 Georgia, "Times New Roman", serif; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.info-tip:hover, .info-tip[aria-expanded="true"] { background: #fff; color: var(--navy); }
.cat-tip .tip { display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 5; width: max-content; max-width: min(18rem, 70vw);
  background: var(--navy); color: #fff; padding: 8px 12px; border-radius: 6px; font-size: 14px; font-weight: 400; line-height: 1.4; text-align: left;
  box-shadow: 0 4px 14px rgba(0,0,0,.2); white-space: normal; }
.cat-tip:hover .tip, .info-tip:focus-visible + .tip, .info-tip[aria-expanded="true"] + .tip { display: block; }
