/* Survey B tool – participant styles (no external resources). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #f4f2ee; color: #1f2328;
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}
main { max-width: 720px; margin: 0 auto; padding: 12px 14px 40px; }
h1 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 .6em; }
h2 { font-size: 1.15rem; margin: 0 0 .5em; }
h2.dim { margin: 1.2em 0 .5em; color: #3d4a5c; }
p { margin: 0 0 .7em; }
.muted { color: #5b6470; font-size: .93rem; }
.small { font-size: .9rem; }
.card { background: #fff; border: 1px solid #dcd8d0; border-radius: 10px; padding: 16px; margin: 0 0 14px; }
fieldset.card { min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: .4em; float: left; width: 100%; }
legend + * { clear: both; }
.info { background: #eef4fb; border-color: #c4d7ee; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.notice { background: #fff7e0; border-color: #e8d28a; border: 1px solid #e8d28a; border-radius: 8px; padding: 12px 14px; }
.error { color: #a1261c; font-weight: 600; min-height: 0; }
.error:empty { display: none; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.facts dt { color: #5b6470; }
.facts dd { margin: 0; }
.code { font-weight: 700; font-size: 1.1rem; letter-spacing: .03em; }
.step { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: #5b6470; margin: .4em 0; }
.rolebar { margin: .2em 0 .6em; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
.choice { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; padding: 8px 4px; border-bottom: 1px solid #eee; cursor: pointer; }
.choice:last-of-type { border-bottom: 0; }
.choice input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; }
.desc { display: block; color: #5b6470; font-size: .9rem; }
input[type=text], textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #b9b4aa; border-radius: 8px; background: #fffefc;
}
textarea { resize: vertical; min-height: 3.2em; overflow: hidden; }
input:focus, textarea:focus, button:focus-visible { outline: 3px solid #4a7cc0; outline-offset: 1px; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.indent { margin: 6px 0 4px 30px; width: calc(100% - 30px); }
.btn {
  font: inherit; font-weight: 600; padding: 12px 18px; border-radius: 8px; border: 1px solid #8f8a80;
  background: #fff; color: #1f2328; cursor: pointer; min-height: 48px;
}
.btn.primary { background: #1f4e79; border-color: #1f4e79; color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { font: inherit; background: none; border: 0; color: #1f4e79; padding: 8px 0; cursor: pointer; text-decoration: underline; }
.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.passrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eee; }
.tag { font-size: .85rem; background: #f0e6c8; padding: 1px 8px; border-radius: 10px; }
.tag.done { background: #d4ecd9; }
.passrow + .btn, .card > .btn.primary { margin-top: 12px; }
.aim .aimtext, .aimbox .aimtext { font-weight: 600; margin-bottom: 10px; }
.aimbox { border-left: 5px solid #1f4e79; }
.aim.missing { border: 2px solid #a1261c; }
.toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.toggle {
  flex: 1 1 140px; font: inherit; padding: 12px 10px; min-height: 48px; border-radius: 8px;
  border: 2px solid #8f8a80; background: #fff; cursor: pointer;
}
.toggle.on { background: #1f4e79; border-color: #1f4e79; color: #fff; font-weight: 600; }
.toggle:disabled { cursor: not-allowed; opacity: .75; }
.status {
  position: sticky; top: 0; z-index: 10; padding: 8px 14px; font-size: .9rem; text-align: center;
  border-bottom: 1px solid rgba(0,0,0,.1);
}
.status.ok { background: #e3f1e6; color: #1d4d2a; }
.status.busy { background: #eef4fb; color: #1f3d63; }
.status.warn { background: #fff1c7; color: #5b4300; font-weight: 600; }
.status.err { background: #fbe1de; color: #7a1a12; font-weight: 600; }
.foot { max-width: 720px; margin: 0 auto; padding: 0 14px 30px; color: #6b7480; font-size: .8rem; }
@media (max-width: 480px) {
  body { font-size: 16px; }
  .card { padding: 13px; }
  .indent { margin-left: 0; width: 100%; }
  .facts { grid-template-columns: 1fr; }
}
.card fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.signout { margin-top: 8px; }

/* ---- v1.1: dropdowns, exact aim text, mobile navigation ---- */
.aimtext { white-space: pre-wrap; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
select {
  width: 100%; font: inherit; min-height: 50px; padding: 10px 40px 10px 12px; border: 2px solid #8f8a80; border-radius: 8px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%231f4e79' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center;
  -webkit-appearance: none; appearance: none; color: #1f2328;
}
label.sub { margin-top: 12px; }
.dd { margin: 4px 0; }
.dd-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left;
  font: inherit; min-height: 50px; padding: 10px 14px; border: 2px solid #8f8a80; border-radius: 8px; background: #fff; cursor: pointer; color: #1f2328;
}
.dd-toggle.open { border-color: #1f4e79; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.dd-caret { color: #1f4e79; font-size: 1.1rem; }
.dd-toggle.open .dd-caret { transform: rotate(180deg); }
.dd-panel {
  border: 2px solid #1f4e79; border-top: 0; border-radius: 0 0 8px 8px; background: #fff;
  max-height: 60vh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 10px;
}
.dd-panel .choice { padding: 11px 2px; }
.opt-name { font-weight: 600; }
.dd-done { position: sticky; bottom: 0; background: #fff; padding: 10px 0; border-top: 1px solid #e5e2dc; }
.dd-done .btn { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 2px; background: #e6eef7; color: #1f3d63; border-radius: 16px; padding: 2px 2px 2px 12px; font-size: .92rem; }
.chip-x { font: inherit; font-size: 1.15rem; line-height: 1; border: 0; background: none; color: #1f3d63; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }
.chip-x:hover { background: #cfdcec; }
.other-input { margin-top: 10px; }
@media (max-width: 600px) {
  /* thumb-friendly: navigation always reachable at the bottom of the screen */
  .nav { position: sticky; bottom: 0; z-index: 5; background: #f4f2ee; margin: 14px -14px 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid #dcd8d0; }
  .nav .btn { flex: 1; }
  .nav .btn.primary { flex: 2; }
}

/* ---- v1.2: aim clarity, facets, suggestion ---- */
.lead { color: #5b6470; font-size: .92rem; margin-bottom: 4px; }
.q { margin-top: 12px; }
.qlabel { font-weight: 600; margin-bottom: 8px; }
.link.small { font-size: .92rem; padding: 10px 0 4px; min-height: 40px; }
table.facets { width: 100%; border-collapse: collapse; margin: 6px 0 4px; font-size: .92rem; }
table.facets th, table.facets td { text-align: left; vertical-align: top; padding: 7px 8px; border-bottom: 1px solid #e5e2dc; }
table.facets th { background: #f4f2ee; font-weight: 600; }
table.facets td.fcode { white-space: nowrap; color: #5b6470; width: 1%; }
.fh { font-size: 1.02rem; margin: 0 0 8px; color: #1f4e79; }
legend.fh { float: none; }
.enact-do .field { margin: 10px 0 0; }
.enact-do label { font-weight: 400; }
.suggest { background: #eef7ef; border: 1px solid #b9d9bf; border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.suggest p { margin: 0 0 4px; }
details.aimlist { margin: 0 0 14px; }
details.aimlist summary { cursor: pointer; color: #1f4e79; padding: 8px 0; }
details.aimlist li { margin-bottom: 6px; font-weight: 400; }

/* ---- v1.3: process information, one aim per screen ---- */
.stepper { display: flex; gap: 4px; margin: 4px 0 12px; }
.stp { flex: 1; min-width: 0; text-align: center; color: #6b7480; font-size: .72rem; line-height: 1.2; }
.stp::before { content: ""; display: block; height: 5px; border-radius: 3px; background: #dcd8d0; margin-bottom: 5px; }
.stp.done::before { background: #7fa7cf; }
.stp.cur::before { background: #1f4e79; }
.stp.cur { color: #1f2328; font-weight: 600; }
.stp-n { display: none; }
.stp-t { display: block; overflow-wrap: anywhere; }
.prog { margin: 0 0 10px; }
.prog-l { font-size: .85rem; color: #5b6470; margin: 0 0 4px; }
.prog-bar { height: 6px; background: #e5e2dc; border-radius: 3px; overflow: hidden; }
.prog-fill { height: 100%; background: #1f4e79; }
.dimline { font-weight: 600; color: #3d4a5c; margin: 0 0 10px; }
ol.howto { padding-left: 1.3em; margin: 0 0 12px; }
ol.howto li { margin-bottom: 6px; }

/* ---- v1.4: aim box, three answers, sticky aim in B2, details box ---- */
.aimquote { background: #eef4fb; border: 1px solid #c4d7ee; border-radius: 8px; padding: 12px 14px; margin: 4px 0 12px; }
.aimquote .aimtext { color: #1f4e79; font-weight: 600; margin: 0; font-size: 1.05rem; }
.qlabel { font-weight: 400; }
.qlabel strong { font-weight: 700; }
.toggles.three .toggle:last-child { flex-basis: 100%; }
.facetsec { margin-top: 12px; }
.facetsec > .qlabel { font-weight: 600; margin-bottom: 4px; }
.aimbox.sticky {
  position: sticky; top: var(--stick, 38px); z-index: 4; background: #fff; border: 1px solid #c4d7ee; border-left: 5px solid #1f4e79;
  border-radius: 0 8px 8px 0; padding: 10px 14px; margin: 0 0 6px; max-height: 34vh; overflow-y: auto; box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.aimbox.sticky .aimtext { color: #1f4e79; font-weight: 600; margin: 0; }
.aimlabel { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: #5b6470; margin: 0 0 2px; }
.facetbox { margin: 0 0 12px; }
.inrole { margin: -4px 0 8px; color: #3d4a5c; }
ul.guide { padding-left: 1.2em; margin: 0 0 10px; }
ul.guide li { margin-bottom: 4px; }
details.more > summary { cursor: pointer; font-weight: 600; color: #1f4e79; padding: 6px 0; min-height: 40px; }
details.more[open] > summary { margin-bottom: 10px; }
.subsec { border-top: 1px solid #e5e2dc; padding-top: 12px; margin-top: 12px; }
fieldset.subsec { border-left: 0; border-right: 0; border-bottom: 0; padding: 12px 0 0; }
.resp { padding-top: 12px; }
.resp.missing, .aim.missing { border: 2px solid #a1261c; }

.toggles.stack { flex-direction: column; }
.toggles.stack .toggle { flex-basis: auto; width: 100%; }

/* ---- v1.5: equal agree buttons, introduction screens, dimension colours ---- */
.toggles.equal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.toggles.equal .toggle { padding-left: 4px; padding-right: 4px; }
.introhead { display: flex; justify-content: space-between; align-items: center; margin: 0 0 8px; }
.intro-step { margin: 0; font-size: .85rem; color: #5b6470; }
.introdots { display: flex; gap: 6px; }
.introdots span { width: 9px; height: 9px; border-radius: 50%; background: #d9d5cd; }
.introdots span.done { background: #8fb0d2; }
.introdots span.on { background: #1f4e79; width: 22px; border-radius: 5px; }
.card.intro h2 { margin-top: 0; }
.keybox { background: #1f4e79; color: #fff; border-radius: 10px; padding: 14px 16px; margin: 12px 0 14px; }
.keybox .keylabel { margin: 0 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.keybox .keytext { margin: 0; font-size: 1.2rem; font-weight: 700; line-height: 1.35; }
.wheel svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 8px auto 4px; }
ul.dimlegend { list-style: none; padding: 0; margin: 8px 0 0; }
ul.dimlegend li { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.dimdot { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 38px; height: 26px; border-radius: 13px;
  background: var(--dim-main, #1f4e79); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .03em; }
.fwcard { padding: 0; overflow: hidden; border: 1px solid var(--dim-main, #ccc); }
.fwhead { display: flex; align-items: center; gap: 8px; background: var(--dim-main, #1f4e79); color: #fff; padding: 9px 12px; }
.fwcode { font-size: .75rem; font-weight: 700; background: rgba(255,255,255,.22); border-radius: 10px; padding: 1px 7px; }
.fwname { font-weight: 700; flex: 1; }
.fwcount { font-size: .8rem; background: #fff; color: var(--dim-dark, #1f4e79); border-radius: 10px; padding: 1px 8px; font-weight: 700; }
ul.fwlist { margin: 0; padding: 8px 12px 10px 30px; background: var(--dim-light, #fff); }
ul.fwlist li { padding: 3px 0; font-size: .92rem; color: #1d2a3a; font-weight: 400; margin: 0; }
ul.fwlist li::marker { color: var(--dim-main, #888); }
.dimtrack { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin: 0 0 10px; }
.dimtrack .dt { text-align: center; font-size: .7rem; font-weight: 700; padding: 5px 0; border-radius: 6px;
  border: 2px solid var(--dim-main); color: var(--dim-dark); background: #fff; opacity: .55; }
.dimtrack .dt.done { background: var(--dim-main); color: #fff; opacity: .8; }
.dimtrack .dt.cur { background: var(--dim-main); color: #fff; opacity: 1; transform: scale(1.08); box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.dimstart { background: var(--dim-light); border: 2px solid var(--dim-main); border-radius: 10px; padding: 10px 14px; margin: 0 0 10px; }
.dimstart p { margin: 0; }
.dimdone { color: var(--dim-dark); font-size: .85rem; font-weight: 600; opacity: .8; margin-bottom: 3px !important; }
.dimnew { color: var(--dim-dark); font-size: 1.02rem; }
.dimcount { color: #5b6470; font-size: .85rem; }
.dimchip { color: var(--dim-dark, inherit); font-weight: 700; }
.card.aim { border-top: 5px solid var(--dim-main, #1f4e79); }
.aim .aimquote, .aimbox .aimquote { background: var(--dim-light, #eef4fb); border-color: var(--dim-main, #c4d7ee); }
.aim .aimquote .aimtext { color: var(--dim-dark, #1f4e79); }
.aimbox.sticky { border-left-color: var(--dim-main, #1f4e79); background: var(--dim-light, #fff); }
.aimbox.sticky .aimtext { color: var(--dim-dark, #1f4e79); }
.aimbox.sticky .aimlabel { color: var(--dim-dark, #5b6470); }
