/* Prototype chrome on top of the portal's own core.min.css / app.min.css */
:root {
  --nofa-red: #a3172f;
  --nofa-green: #2e8b3d;
  --nofa-navy: #2d3e4e;
  --chg-add: #28a745;
  --chg-add-bg: #eaf7ed;
  --chg-del: #eb5757;
  --chg-del-bg: #fdecec;
  --chg-mod: #e2a128;
  --chg-mod-bg: #fff6e3;
  --q: #2f80ed;
}

body { background: #f4f5f7; }

/* ---------- top bar ---------- */
.proto-top {
  background: var(--nofa-navy);
  color: #fff;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 8px 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.proto-top a { color: #fff; }
.top-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.proto-top img { height: 40px; width: 40px; border-radius: 50%; background: #fff; }
.proto-top .brand { font-weight: 500; font-size: 1.05rem; line-height: 1.2; }
.proto-top .brand:hover { text-decoration: none; opacity: .9; }
.proto-top .brand small { display: block; font-weight: 300; opacity: .8; font-size: .8rem; }
.top-nav { display: flex; gap: 4px; }
.top-item {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: rgba(255,255,255,.85) !important; font-size: .9rem; font-weight: 500; line-height: 1;
  cursor: pointer; transition: background .15s, color .15s;
}
.top-item .bi { font-size: 1rem; }
.top-item:hover, .top-item:focus { background: rgba(255,255,255,.1); color: #fff !important; text-decoration: none; outline: none; }
.top-item.active { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.2); color: #fff !important; }
.top-item .count { background: rgba(255,255,255,.2); border-radius: 10px; padding: 2px 7px; font-size: .75rem; }
.top-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.signed-in { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: rgba(255,255,255,.85); }
.signed-in[hidden] { display: none; }
.top-exit { border: 0; background: transparent; color: rgba(255,255,255,.85); font-size: 1.15rem; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.top-exit:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- OSP heading (portal-style grey header) ---------- */
.proto-bar {
  background: #e0e0e0;
  border-bottom: 1px solid #c1c9d0;
  padding: 10px 24px;
}
.proto-bar .page-heading { margin: 0; }

/* ---------- version switch, right above the form ---------- */
.view-switch {
  display: flex;
  gap: 0;
  position: sticky;
  top: 56px;
  z-index: 20;
  background: #f4f5f7;
  padding: 10px 0;
  margin-bottom: 4px;
}
.view-switch button {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #c1c9d0;
  background: #fff;
  color: #444;
  padding: 8px 14px;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.view-switch button + button { border-left: 0; }
.view-switch button:first-child { border-radius: .4rem 0 0 .4rem; }
.view-switch button:last-child { border-radius: 0 .4rem .4rem 0; }
.view-switch button:hover { background: #eef1f4; }
.view-switch button .bi { font-size: 1.4rem; opacity: .7; }
.view-switch button b { display: block; font-size: 1.05rem; font-weight: 500; line-height: 1.2; }
.view-switch button small { display: block; font-size: .78rem; opacity: .75; }
.view-switch button.active, .view-switch button.active:hover { background: var(--nofa-navy); border-color: var(--nofa-navy); color: #fff; }
.view-switch button.active .bi { opacity: 1; }
.view-switch button[data-view="changes"] { background: #fdf5f6; color: var(--nofa-red); }
.view-switch button[data-view="changes"]:hover { background: #f9e8eb; }
.view-switch button[data-view="changes"].active, .view-switch button[data-view="changes"].active:hover { background: #fbf0f2; border-color: #e3bcc4; color: var(--nofa-red); box-shadow: inset 0 -3px 0 var(--nofa-red); }

/* ---------- left column: change list (Review Changes view only) ---------- */
.osp-layout { max-width: 1480px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.side-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 140px); /* fits before the page scrolls too */
  margin-top: 10px;
  font-size: .86rem;
}
.side-col > * { background: #fff; border: 1px solid #dde1e5; border-radius: .4rem; padding: .9rem 1rem; }
.chg-nav { display: none; }
body.view-changes .chg-nav { display: block; flex: 0 1 auto; min-height: 0; max-height: 1100px; overflow-y: auto; }
.osp-links { flex: none; }
.chg-nav h6 { font-size: 1rem; margin-bottom: .3rem; }
.chg-nav p { color: #555; margin-bottom: .6rem; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; align-items: center; padding-bottom: .7rem; border-bottom: 1px solid #eee; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 2px; vertical-align: -1px; }
.legend .l-add::before { background: var(--chg-add); }
.legend .l-del::before { background: var(--chg-del); }
.legend .l-mod::before { background: var(--chg-mod); }
.legend .l-rep::before { background: var(--q); }
.legend .l-draft::before { background: #fff; outline: 2px dashed #b7791f; outline-offset: -2px; }
.osp-links h6 { font-size: 1rem; margin-bottom: .5rem; }
.osp-links ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 4px; }
.osp-links li { display: flex; }
.osp-links li > a { flex: 1; }
.osp-links a { display: block; border: 1px solid #dde1e5; border-radius: .3rem; padding: .3rem .5rem; color: #333; line-height: 1.2; font-size: .8rem; }
.osp-links a small { display: block; color: #777; font-size: .68rem; }
.osp-links a:hover { background: #f4f5f7; text-decoration: none; }
.osp-links a.current { background: var(--nofa-navy); border-color: var(--nofa-navy); color: #fff; }
.osp-links a.current small { color: rgba(255,255,255,.75); }
.chg-list { list-style: none; padding: 0; margin: .4rem 0 0; }
.chg-list .sec { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--nofa-navy); margin: .8rem 0 .2rem; }
.chg-list a { display: block; border-left: 3px solid #ccc; padding: .3rem .5rem; margin: 2px 0; color: #333; border-radius: 0 3px 3px 0; }
.chg-list a:hover { background: #f4f5f7; text-decoration: none; }
.chg-list a.active { background: #e9f3ff; }
.chg-list a .kind { display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.chg-list a .ttl { display: block; line-height: 1.3; }
.chg-list a small { display: block; color: #777; }
.chg-list a.t-added { border-left-color: var(--chg-add); } .chg-list a.t-added .kind { color: #1d7a32; }
.chg-list a.t-modified { border-left-color: var(--chg-mod); } .chg-list a.t-modified .kind { color: #a8740f; }
.chg-list a.t-removed { border-left-color: var(--chg-del); } .chg-list a.t-removed .kind { color: #c03030; }
.chg-list a.t-replaced { border-left-color: var(--q); } .chg-list a.t-replaced .kind { color: #1f5fbf; }
.chg-list a.t-draft { border-left: 3px dashed #b7791f; } .chg-list a.t-draft .kind { color: #8a5a12; }
.proto-sheet [id] { scroll-margin-top: 140px; }

/* ---------- page body ---------- */
.proto-page { max-width: 1280px; margin: 0 auto; padding: 16px 24px 64px; }
.proto-sheet { background: #fff; border: 1px solid #dde1e5; border-radius: .4rem; padding: 1rem 1.5rem; }
.version-banner { border-radius: .3rem; padding: .6rem .9rem; margin-bottom: 1rem; font-size: .92rem; }
.version-banner.b2026 { background: #eef1f4; }
.version-banner.b2027 { background: #e9f3ff; }
.version-banner.bchg { background: #fff8e6; }

/* ---------- version visibility ---------- */
body.view-2026 [data-v="2027"] { display: none !important; }
body.view-2027 [data-v="2026"] { display: none !important; }
body:not(.view-changes) .only-changes { display: none !important; }
body.view-changes .collapsible-old.collapsed > .old-body { display: none; }

/* ---------- change markup (Changes view only) ---------- */
body.view-changes [data-chg] { position: relative; border-left: 4px solid transparent; padding-left: 10px; margin-left: -14px; border-radius: 2px; }
body.view-changes [data-chg][data-type="added"] { border-left-color: var(--chg-add); background: var(--chg-add-bg); }
body.view-changes [data-chg][data-type="removed"] { border-left-color: var(--chg-del); background: var(--chg-del-bg); }
body.view-changes [data-chg][data-type="removed"] :is(label, p, th, td, div, span) { text-decoration-color: var(--chg-del); }
body.view-changes [data-chg][data-type="removed"] .form-label,
body.view-changes [data-chg][data-type="removed"] th { text-decoration: line-through; }
body.view-changes [data-chg][data-type="removed"] input,
body.view-changes [data-chg][data-type="removed"] textarea { opacity: .5; }
body.view-changes [data-chg][data-type="modified"] { border-left-color: var(--chg-mod); background: var(--chg-mod-bg); }
body.view-changes span[data-chg] { margin-left: 0; padding: 0 4px; border-left: 0; border-radius: 3px; }
body.view-changes [data-chg][data-type="replaced"] { border-left-color: var(--q); background: transparent; }

.chg-badge {
  display: none;
  position: absolute;
  right: 4px;
  top: 4px;
  z-index: 5;
  font-size: .72rem;
  font-weight: 500;
  border: 0;
  border-radius: 10px;
  padding: 2px 9px;
  color: #fff;
  cursor: pointer;
  text-decoration: none !important;
}
body.view-changes .chg-badge { display: inline-block; }
body.view-changes span[data-chg] .chg-badge { position: static; margin-left: 4px; padding: 0 6px; }
.chg-badge.added { background: var(--chg-add); }
.chg-badge.removed { background: var(--chg-del); }
.chg-badge.modified { background: var(--chg-mod); }
.chg-badge.replaced { background: var(--q); }
.chg-badge .bi { margin-left: 3px; }

/* ---------- popover for change details and notes ---------- */
.proto-pop {
  position: absolute;
  z-index: 50;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 1px solid #c1c9d0;
  border-radius: .4rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: .8rem 1rem;
  font-size: .88rem;
}
.proto-pop h6 { font-size: .9rem; margin-bottom: .4rem; }
.proto-pop .quote { border-left: 3px solid #c1c9d0; padding: .2rem .6rem; color: #555; margin: .5rem 0; font-style: italic; white-space: pre-line; }
.proto-pop .src { font-size: .8rem; color: #555; }
.proto-pop .q-link { display: block; margin-top: .5rem; color: var(--q); }
.proto-pop .close { position: absolute; right: 8px; top: 4px; font-size: 1.2rem; }

/* ---------- feedback ---------- */
.fb-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #6c7a89;
  padding: 1px 6px;
  margin-left: 6px;
  font-size: 1.15rem;
  line-height: 1;
  border-radius: 6px;
  vertical-align: middle;
  opacity: .45;
  transition: opacity .15s, background .15s, color .15s;
}
.fb-host:hover > .fb-btn, .fb-btn:focus { opacity: 1; color: var(--q); background: #e9f3ff; border-color: #c9defa; }
.fb-btn:hover { opacity: 1; color: #fff; background: var(--q); border-color: var(--q); }
.fb-btn.has-note { opacity: 1; color: #fff; background: var(--q); border-color: var(--q); }
.proto-pop textarea { width: 100%; min-height: 90px; font-size: .88rem; }

.notes-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100vw;
  background: #fff;
  border-left: 1px solid #c1c9d0;
  box-shadow: -8px 0 24px rgba(0,0,0,.12);
  z-index: 60;
  display: none;
  flex-direction: column;
}
.notes-panel.open { display: flex; }
.notes-panel header { padding: .8rem 1rem; border-bottom: 1px solid #e0e0e0; display: flex; align-items: center; }
.notes-panel header h6 { margin: 0; flex: 1; }
.notes-panel .list { overflow-y: auto; flex: 1; padding: .6rem 1rem; }
.notes-panel .note { border-bottom: 1px solid #eee; padding: .5rem 0; font-size: .86rem; }
.notes-panel .note .where { color: #555; font-size: .78rem; }
.notes-panel .note .where a { color: var(--q); }
.notes-panel footer { padding: .7rem 1rem; border-top: 1px solid #e0e0e0; display: flex; gap: 6px; flex-wrap: wrap; }

.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px rgba(47,128,237,.55); } 100% { box-shadow: 0 0 0 4px rgba(47,128,237,0); } }

/* ---------- landing / login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--nofa-navy); padding: 16px; }
.login-card { background: #fff; border-radius: .5rem; padding: 2rem; width: 100%; max-width: 380px; text-align: center; }
.login-card img { width: 140px; margin-bottom: 1rem; }
.hero { display: flex; align-items: center; gap: 24px; margin: 8px 0 24px; }
.hero img { width: 110px; height: 110px; }
.hero h1 { font-size: 1.6rem; margin: 0 0 .3rem; }
.hero p { margin: 0; color: #555; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.osp-card { background: #fff; border: 1px solid #dde1e5; border-radius: .5rem; padding: 1rem 1.2rem; display: flex; flex-direction: column; }
.osp-card h5 { margin-bottom: .3rem; }
.osp-card .kind { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #777; }
.osp-card p { font-size: .9rem; color: #444; flex: 1; }
.osp-card.pending { opacity: .65; }
.pill { display: inline-block; font-size: .72rem; border-radius: 10px; padding: 1px 8px; font-weight: 500; }
.pill.ready { background: var(--chg-add-bg); color: #1d7a32; }
.pill.soon { background: #eef1f4; color: #555; }
.pill.open { background: #e9f3ff; color: #1f5fbf; }
.pill.answered { background: var(--chg-add-bg); color: #1d7a32; }
.section-title { font-size: 1.1rem; margin: 2rem 0 .8rem; }
.panel { background: #fff; border: 1px solid #dde1e5; border-radius: .5rem; padding: 1rem 1.2rem; }
.doc-list a { display: inline-flex; align-items: center; gap: 6px; }
.q-item { border-bottom: 1px solid #eee; padding: .8rem 0; }
.q-item:last-child { border-bottom: 0; }
.q-item .num { font-weight: 700; color: var(--nofa-navy); margin-right: 6px; }
.q-item .meta { font-size: .8rem; color: #666; margin-top: .3rem; }
.q-item .answer { background: var(--chg-add-bg); border-radius: .3rem; padding: .4rem .7rem; margin-top: .4rem; font-size: .9rem; }

@media (max-width: 991px) {
  .osp-layout { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .osp-main { display: contents; }
  .side-col { position: static; max-height: none; margin: 0 0 12px; order: 1; }
  body.view-changes .chg-nav { max-height: 45vh; }
  .osp-main > *:not(.view-switch) { order: 2; }
}
@media (max-width: 720px) {
  .proto-top, .proto-bar { padding: 8px 16px; }
  .proto-top { gap: 8px; }
  .proto-top { grid-template-columns: auto 1fr auto; gap: 8px; }
  .proto-top .brand, .top-item .lbl, .signed-in { display: none !important; }
  .top-nav { justify-content: center; }
  .top-item { padding: 0 10px; }
  .proto-top .brand { font-size: .9rem; }
  .view-switch { position: static; flex-direction: column; }
  .view-switch button { border-left: 1px solid #c1c9d0 !important; border-radius: 0 !important; }
  .proto-page { padding: 12px 16px 48px; }
  .proto-sheet { padding: .8rem; overflow-x: auto; }
  .hero { flex-direction: column; text-align: center; }
}

/* per-view banners */
.vb { display: none; }
body.view-2026 .vb-2026, body.view-2027 .vb-2027, body.view-changes .vb-changes { display: block; }
.toggle-old-btn { margin: .5rem 0 1rem; }

/* wording not final (highlighted in NOFA's documents) */
body.view-changes [data-draft] { position: relative; outline: 2px dashed var(--chg-mod); outline-offset: 2px; border-radius: 2px; }
body.view-changes [data-draft] > .chg-badge.draft { display: inline-block; }
.chg-badge.draft { background: #b7791f; }
body.view-changes [data-chg] > .chg-badge.draft { right: 110px; }

/* modal (notes on the questions page) */
.proto-modal { position: fixed; inset: 0; background: rgba(20,30,40,.45); z-index: 70; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.proto-modal-box { background: #fff; border-radius: .5rem; width: 100%; max-width: 560px; padding: 1.2rem 1.4rem; box-shadow: 0 16px 40px rgba(0,0,0,.25); }
.proto-modal-box h6 { font-size: 1rem; }
.proto-modal-box .src { font-size: .85rem; color: #555; }
.q-head { display: flex; align-items: flex-start; gap: 8px; }
.q-head .q-title { flex: 1; }
.q-item .my-note { background: #e9f3ff; border-radius: .3rem; padding: .4rem .7rem; margin-top: .5rem; font-size: .9rem; white-space: pre-line; }
.q-item .my-note .by { display: block; font-size: .75rem; color: #555; margin-top: .2rem; white-space: normal; }

/* home page: Your notes (everyone's notes) */
.notes-board { padding: 0; }
.nb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: .8rem 1.2rem; border-bottom: 1px solid #eee; }
.nb-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.nb-chip { border: 1px solid #dde1e5; background: #fff; border-radius: 14px; padding: 3px 10px; font-size: .82rem; color: #333; cursor: pointer; }
.nb-chip span { color: #888; margin-left: 2px; }
.nb-chip:hover { background: #f4f5f7; }
.nb-chip.active { background: var(--nofa-navy); border-color: var(--nofa-navy); color: #fff; }
.nb-chip.active span { color: rgba(255,255,255,.75); }
.nb-list { max-height: 800px; overflow-y: auto; padding: .4rem 1.2rem 1rem; }
.nb-group h3 { font-size: .95rem; font-weight: 500; margin: 1rem 0 .4rem; position: sticky; top: 0; background: #fff; padding: .3rem 0; z-index: 1; }
.nb-group h3 a { color: var(--nofa-navy); }
.nb-note { display: flex; gap: 10px; padding: .6rem .7rem; border: 1px solid #eef0f2; border-radius: .4rem; margin-bottom: 6px; }
.nb-note.mine { background: #f5f9ff; border-color: #dbe8fb; }
.nb-avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; background: #dfe5ea; color: var(--nofa-navy); font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.nb-note.mine .nb-avatar { background: var(--q); color: #fff; }
.nb-body { flex: 1; min-width: 0; }
.nb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .82rem; }
.nb-view { font-size: .72rem; color: #666; background: #eef1f4; border-radius: 8px; padding: 0 6px; }
.nb-time { margin-left: auto; color: #888; font-size: .78rem; }
.nb-item { display: block; font-size: .82rem; color: #555; margin: .15rem 0 .25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-item::before { content: "On: "; color: #999; }
.nb-text { font-size: .92rem; white-space: pre-line; }
