.form-intro {
  display: flex;
  gap: 20px;
  align-items: center;
  background: #e9eddf;
  border: 1px solid #dce3ce;
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 26px;
}
.form-intro .workflow-icon {
  margin: 0;
  position: static;
  flex-shrink: 0;
}
.form-intro strong {
  font-size: 13px;
  font-weight: 550;
}
.form-intro p {
  font-size: 11px;
  line-height: 1.8;
  margin: 5px 0 0;
  color: #77856b;
  max-width: 760px;
}
.helper-work {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 25px;
  align-items: start;
}
.helper-browser {
  position: sticky;
  top: 20px;
}
.helper-browser .field {
  font-size: 11px;
}
.helper-browser .search {
  margin-bottom: 18px;
}
.helper-browser .search input {
  font-size: 11px;
}
.helper-browser .filter-label {
  margin-bottom: 20px;
}
.helper-topic-list {
  max-height: 570px;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 5px;
}
.helper-topic-list > .section-number {
  margin-bottom: 12px;
}
.helper-topic-item {
  display: flex;
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 5px;
  padding: 13px 10px;
  gap: 10px;
  text-align: left;
  align-items: center;
  margin-bottom: 7px;
}
.helper-topic-item > span:first-child {
  color: #7e956c;
  font-size: 18px;
  width: 22px;
  flex-shrink: 0;
  text-align: center;
}
.helper-topic-item div {
  flex: 1;
}
.helper-topic-item strong {
  font-size: 10px;
  font-weight: 550;
  display: block;
}
.helper-topic-item small {
  font-size: 8px;
  color: #8d977f;
  display: block;
  margin-top: 5px;
}
.helper-topic-item > span:last-child {
  font-size: 17px;
  color: #99a38b;
}
.helper-topic-item.selected {
  border-color: #79966b;
  background: #eaf0e2;
}
.helper-topic-item:hover {
  border-color: #9bad8b;
}
.reference-top {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 25px;
}
.reference-top .hazard-symbol {
  height: 43px;
  width: 43px;
  font-size: 28px;
}
.reference-top .pill {
  margin-left: auto;
  font-size: 6px;
}
.reference-top h2 {
  margin-top: 6px;
  font-size: 24px;
}
.reference-explanation h3 {
  font-size: 12px;
  font-weight: 600;
  margin: 20px 0 5px;
}
.reference-explanation p {
  font-size: 11px;
  color: #7b8573;
  line-height: 1.9;
  margin: 0 0 18px;
}
.reference-panel .questions {
  background: #f3f5ed;
  padding: 14px 17px;
  border-radius: 5px;
  margin-top: 20px;
}
.reference-panel .questions ul {
  padding-left: 17px;
}
.wording-field {
  margin-top: 20px;
}
.wording-field > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 12px;
}
.wording-field label {
  font-size: 11px;
  font-weight: 550;
}
.wording-field textarea {
  width: 100%;
  border: 1px solid #dfe3d8;
  border-radius: 4px;
  padding: 12px;
  resize: vertical;
  color: var(--ink);
  background: #fdfefa;
  font-size: 12px;
  line-height: 1.8;
  outline: none;
}
.wording-field textarea:focus {
  border-color: #7c966d;
  box-shadow: 0 0 0 2px #edf2e7;
}
.form-prompts {
  border-left: 2px solid #b6c99e;
  padding: 10px 17px;
  margin: 23px 0 25px;
  background: #f5f7ef;
}
.form-prompts strong {
  font-size: 11px;
  font-weight: 550;
}
.form-prompts ul {
  padding-left: 17px;
  margin-bottom: 0;
  font-size: 10px;
  color: #7c886f;
  line-height: 1.9;
}
.reference-sources {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 25px;
  font-size: 10px;
  color: #87927b;
  line-height: 1.8;
}
.reference-sources summary {
  cursor: pointer;
  color: #5f7952;
  font-weight: 500;
  margin-bottom: 15px;
}
.reference-sources ul {
  padding-left: 17px;
  font-size: 9px;
}
.reference-sources a {
  font-size: 10px;
}
.reference-panel > .helper {
  font-size: 9px;
  margin: 0 0 18px;
}
.reference-panel .export-actions {
  margin-top: 18px;
}
.reference-panel #wording-reset button {
  margin-left: 10px;
}
.reference-panel .notice[hidden] {
  display: none;
}
@media (max-width: 1100px) {
  .helper-work {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
  }
  .reference-top {
    flex-wrap: wrap;
  }
  .reference-top .pill {
    margin-left: 56px;
  }
  .reference-top h2 {
    font-size: 21px;
  }
  .reference-panel {
    padding: 23px;
  }
  .helper-topic-item {
    padding: 12px 8px;
    gap: 7px;
  }
}
@media (max-width: 850px) {
  .helper-work {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .helper-browser {
    top: 15px;
  }
  .reference-top .pill {
    display: none;
  }
  .reference-panel {
    padding: 20px;
  }
  .wording-field textarea {
    font-size: 12px;
  }
}
@media (max-width: 650px) {
  .form-intro {
    padding: 17px;
    gap: 14px;
    align-items: flex-start;
  }
  .form-intro strong {
    font-size: 12px;
  }
  .form-intro p {
    font-size: 11px;
  }
  .helper-work {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .helper-browser {
    position: static;
  }
  .helper-browser .search input,
  .helper-browser .field textarea,
  .helper-browser .field select {
    font-size: 16px;
  }
  .helper-topic-list {
    display: flex;
    gap: 8px;
    overflow: auto;
    max-height: none;
    align-items: stretch;
    padding: 0 0 10px;
  }
  .helper-topic-list > .section-number {
    display: none;
  }
  .helper-topic-item {
    min-width: 200px;
    width: 200px;
    flex-shrink: 0;
    margin: 0;
    padding: 13px 10px;
  }
  .helper-topic-item strong {
    font-size: 11px;
  }
  .helper-topic-item small {
    font-size: 9px;
  }
  .helper-browser > .helper {
    margin-bottom: 0;
  }
  .helper-browser .filter-label {
    margin-bottom: 15px;
  }
  .reference-panel {
    padding: 21px 17px;
  }
  .reference-top h2 {
    font-size: 23px;
  }
  .reference-top .section-number {
    font-size: 8px;
  }
  .reference-explanation p {
    font-size: 12px;
  }
  .reference-explanation h3 {
    font-size: 13px;
  }
  .wording-field textarea {
    font-size: 16px;
    line-height: 1.6;
  }
  .wording-field label {
    font-size: 11px;
  }
  .wording-field .text-button {
    font-size: 10px;
    white-space: nowrap;
  }
  .form-prompts ul {
    font-size: 11px;
  }
  .reference-sources {
    font-size: 11px;
  }
  .reference-sources ul {
    font-size: 10px;
  }
  .reference-panel .questions {
    font-size: 11px;
  }
  .reference-panel .helper {
    font-size: 10px;
  }
  .reference-panel .control-list label {
    font-size: 12px;
  }
  .reference-panel .control-list small {
    font-size: 9px;
  }
}

/* Fill your form: hazards stacked on one form, recent topics, start cards, copy bar. */
.helper-stack {
  margin-bottom: 20px;
}
.helper-stack-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
}
.helper-stack-head h2 {
  margin: 0;
}
.helper-stack-head h2 small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.helper-area {
  flex: 0 1 340px;
  margin: 0;
}
.helper-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 4px;
}
.helper-chip,
.helper-chip-x {
  min-height: 48px;
  padding: 6px 14px;
  border: 1px solid #9fb59a;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.helper-chip {
  border-radius: 24px;
  text-align: left;
}
.helper-chip:hover,
.helper-chip-x:hover {
  background: #e6eee5;
}
.helper-stack-chip {
  display: inline-flex;
}
.helper-stack-chip .helper-chip {
  border-radius: 24px 0 0 24px;
  border-right: 0;
}
.helper-stack-chip .helper-chip[aria-pressed='true'] {
  background: #e6eee5;
  font-weight: 600;
}
.helper-chip-x {
  min-width: 48px;
  border-radius: 0 24px 24px 0;
  font-size: 18px;
}
.helper-repeat {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: end;
  margin-top: 12px;
}
.helper-repeat > .field {
  flex: 0 1 320px;
  margin: 0;
}
.helper-repeat-actions,
.helper-repeat-name {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: end;
}
.helper-repeat-name .field {
  margin: 0;
}
.helper-repeat .button,
.helper-repeat .text-button {
  min-height: 48px;
}
.helper-recent {
  margin: -6px 0 16px;
}
.helper-recent .helper-chips {
  margin-top: 6px;
}
.helper-recent .helper-chip {
  min-height: 48px;
  font-size: 13px;
}
.helper-topic-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
  margin-bottom: 7px;
}
.helper-topic-row .helper-topic-item {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.helper-stack-toggle {
  flex: 0 0 48px;
  min-height: 48px;
  border: 1px solid #9fb59a;
  border-radius: 5px;
  background: #fff;
  color: var(--green);
  font-size: 20px;
  cursor: pointer;
}
.helper-stack-toggle:hover {
  background: #e6eee5;
}
.helper-stack-toggle.is-on {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.reference-top [data-topic-stack] {
  margin-left: auto;
  align-self: start;
  min-height: 48px;
  white-space: nowrap;
}
.reference-top [data-topic-stack].is-on {
  border-color: var(--green);
}
.helper-start h2 {
  margin-top: 6px;
}
.helper-start-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.helper-start-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  min-height: 120px;
  padding: 16px;
  border: 1px solid #cdd8c8;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.helper-start-card:hover {
  border-color: var(--green);
  background: #f3f7f1;
}
.helper-start-card strong {
  font-size: 16px;
}
.helper-start-card small {
  color: var(--muted);
}
.edited-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 10px;
  background: #fff3d6;
  color: #6b4a00;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.edited-tag[hidden] {
  display: none;
}
.wording-field.is-edited textarea {
  border-left: 4px solid #d99a1e;
}
.control-list .control-choice > label {
  min-height: 48px;
}
.wording-field .text-button {
  min-height: 44px;
}
.form-intro-details {
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
}
.helper-copybar {
  position: sticky;
  bottom: var(--bottom-nav, 0px);
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 10px 16px;
  border: 1px solid #cdd8c8;
  border-radius: 10px 10px 0 0;
  background: #fff;
  box-shadow: 0 -4px 14px #0f2a2314;
}
.helper-copybar [data-copybar-label] {
  font-size: 14px;
  font-weight: 600;
}
.helper-copybar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.helper-copybar .button {
  min-height: 48px;
}
@media (max-width: 900px) {
  .helper-topic-row {
    margin: 0;
  }
  .reference-top {
    flex-wrap: wrap;
  }
  .helper-start-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .helper-copybar {
    padding: 8px 10px;
  }
  .helper-copybar-buttons {
    width: 100%;
  }
  .helper-copybar .button {
    flex: 1 1 auto;
    padding: 0 10px;
  }
}
@media (max-width: 560px) {
  /* The Copy all button carries the count, so the bar stays one row above the bottom bar. */
  .helper-copybar [data-copybar-label] {
    display: none;
  }
}
@media print {
  .helper-copybar,
  .helper-stack {
    display: none;
  }
}

/* Category pills: wrap in the side column, scroll sideways on phones. */
.helper-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
}
.helper-pill {
  min-height: 36px;
  padding: 4px 11px;
  border: 1px solid #9fb59a;
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.helper-pill:hover {
  background: #e6eee5;
}
.helper-pill[aria-pressed='true'] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.helper-stack-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.helper-stack-toggle-text {
  display: none;
}
/* Concise / Detailed stays at the top of the topic while scrolling. */
.wording-modes.helper-modes {
  position: sticky;
  top: 0;
  z-index: 6;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 6px;
  padding: 8px 12px;
  box-shadow: 0 4px 10px #0f2a2310;
}
.wording-modes.helper-modes [role='group'] {
  align-self: center;
}
.wording-modes.helper-modes strong {
  font-size: 13px;
}
.wording-modes.helper-modes button {
  min-height: 44px;
  padding: 8px 16px;
  font-size: 14px;
}
.helper-modes-note {
  margin: 0 0 18px;
  font-size: 12px;
}
.field-count {
  padding: 2px 8px;
  border-radius: 10px;
  background: #eef1ea;
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.field-count[hidden] {
  display: none;
}
.field-count.is-near {
  background: #fff3d6;
  color: #6b4a00;
}
.field-count.is-over {
  background: #fde8e4;
  color: #8a2f12;
  font-weight: 600;
}
.wording-field > div:first-child {
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  justify-content: flex-start;
}
.wording-field > div:first-child .text-button {
  margin-left: auto;
}
.source-detail-collapsed {
  margin: 16px 0;
}
/* The copy confirmation sits above the copy bar instead of over it. */
body:has(.helper-copybar) #toast {
  bottom: calc(84px + var(--bottom-nav, 0px));
}
@media (max-width: 900px) {
  .helper-category-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .helper-category-pills::-webkit-scrollbar {
    display: none;
  }
  .helper-pill {
    min-height: 48px;
    font-size: 14px;
  }
  .helper-topic-row {
    flex-direction: column;
    gap: 0;
  }
  .helper-topic-row .helper-topic-item {
    border-radius: 5px 5px 0 0;
  }
  .helper-stack-toggle {
    flex: none;
    width: 100%;
    border-top: 0;
    border-radius: 0 0 5px 5px;
    font-size: 15px;
  }
  .helper-stack-toggle-text {
    display: inline;
    font-size: 14px;
    font-weight: 600;
  }
}
