/* ============================================================
   100 realistic safety / compliance audit questions.
   Generated from a stem × topic matrix so each question reads
   distinct without us hand-writing 100 unique sentences.
   Exports: window.WORKSHOP_QUESTIONS  (array of {id, num, text, example, eyebrow})
   ============================================================ */

const TOPICS = [
  {
    eyebrow: "Leadership · Visible Felt Leadership",
    items: [
      ["A current, approved Sustainability Policy exists and is communicated to personnel.",
       "Signed policy, revision history, distribution list, induction materials."],
      ["Leadership conducts visible safety walks at least monthly, with documented findings and follow-ups.",
       "Walk schedule, completed walk reports, action register entries."],
      ["Safety walk outcomes are reinforced through coaching, performance reviews, and recognition.",
       "Coaching logs, performance review templates, recognition register."],
      ["A formal shift-end handover programme is in place between supervisors and incoming crews.",
       "Handover template, signed handover records, audit observations."],
      ["The visible-felt-leadership programme is integrated into supervisor onboarding.",
       "Onboarding curriculum, sign-off sheets, competency assessment."],
      ["Senior leaders publicly acknowledge safety milestones and near-miss reporting.",
       "Town-hall slides, internal newsletter clippings, recognition awards."],
      ["Leadership KPIs explicitly include lagging and leading safety indicators.",
       "Scorecard, KPI definitions, reporting cadence evidence."],
      ["A documented stop-work authority is communicated to all personnel.",
       "Policy, posters, induction quiz, recent stop-work case studies."],
      ["Behavioural safety observations are aggregated and trended quarterly.",
       "Observation database export, trend reports, review meeting minutes."],
      ["Site leadership reviews safety performance at least monthly with documented actions.",
       "Meeting minutes, action register, trend charts."],
    ],
  },
  {
    eyebrow: "Risk · Hazard Identification",
    items: [
      ["A current, site-wide hazard register exists and is reviewed annually.",
       "Register export, revision log, review sign-off."],
      ["Job Safety Analyses (JSAs) are completed for all non-routine tasks.",
       "JSA database, recent JSA samples, completion audit."],
      ["Change management triggers a risk re-assessment for all material changes.",
       "MOC procedure, MOC log, attached risk re-assessments."],
      ["Critical controls are identified for each material unwanted event.",
       "Bowtie analyses, critical-control register, verification schedule."],
      ["Critical-control verification is performed on a documented cadence.",
       "Verification schedule, recent completed verifications, exception log."],
      ["A documented process exists for elevating risks above tolerance to leadership.",
       "Escalation procedure, recent escalations, leadership minutes."],
      ["Contractor activities are risk-assessed using the same framework as direct employees.",
       "Contractor JSA samples, contractor pre-job briefings."],
      ["Lessons learned from incidents are fed back into the hazard register.",
       "Incident reports, register revision history, cross-reference matrix."],
      ["Annual risk-assessment workshops include front-line operators.",
       "Workshop minutes, attendance list, output documents."],
      ["A documented procedure exists for reassessing risks after significant near-misses.",
       "Procedure, recent near-miss reports, attached reassessments."],
    ],
  },
  {
    eyebrow: "Incident · Reporting & Investigation",
    items: [
      ["All incidents and near-misses are reported within 24 hours via a documented channel.",
       "Incident management system records, reporting timestamp audit."],
      ["A structured investigation methodology (e.g. ICAM, 5-Whys) is applied to all significant incidents.",
       "Investigation reports, methodology training records."],
      ["Investigation findings are reviewed by leadership before closure.",
       "Closure approval workflow, recent investigation closeouts."],
      ["Corrective actions from investigations are tracked to completion with due dates.",
       "Action register export, overdue-action report."],
      ["Trend analysis on incident causes is performed at least quarterly.",
       "Quarterly trend reports, leadership review minutes."],
      ["Investigation reports are shared with relevant peer sites or business units.",
       "Distribution log, peer-site acknowledgements."],
      ["A 'just culture' framework is documented and applied during investigations.",
       "Just-culture procedure, training records, applied case examples."],
      ["High-potential near-misses are investigated to the same depth as actual incidents.",
       "HPNM register, comparison of investigation depth, sample reports."],
      ["Investigation outcomes are communicated to the workforce within an agreed timeframe.",
       "Toolbox-talk records, internal alerts, communication log."],
      ["A documented process exists for re-opening closed investigations when new evidence emerges.",
       "Procedure, recent reopen examples, sign-off."],
    ],
  },
  {
    eyebrow: "Training · Competency",
    items: [
      ["A skills matrix exists for all safety-critical roles and is reviewed annually.",
       "Matrix export, revision log, review sign-off."],
      ["Training records are maintained in a system with expiry dates and refresher cadence.",
       "Training system export, sample certificates, refresher report."],
      ["A competency assessment is performed before personnel are authorised for safety-critical tasks.",
       "Competency assessment templates, signed authorisations."],
      ["New starters complete induction before commencing work on site.",
       "Induction register, sign-off records, exception log."],
      ["Refresher training is documented and tracked for expiry.",
       "Refresher schedule, completion register, overdue report."],
      ["Contractor inductions are equivalent in scope to employee inductions.",
       "Induction content comparison, contractor sign-off."],
      ["Training effectiveness is evaluated through competency-based assessment.",
       "Assessment results, scoring rubric, evaluation reports."],
      ["A documented process exists for revoking authorisations when competence lapses.",
       "Procedure, recent revocation records, communication log."],
      ["High-risk tasks require dual sign-off by trained personnel.",
       "Sign-off templates, completed task records, audit findings."],
      ["Training needs analysis is performed for each operational role annually.",
       "TNA documents, role descriptions, training plan output."],
    ],
  },
  {
    eyebrow: "Emergency · Preparedness & Response",
    items: [
      ["A site emergency response plan is documented and reviewed annually.",
       "ERP document, revision log, review sign-off."],
      ["Emergency drills are conducted on a documented schedule covering all credible scenarios.",
       "Drill schedule, drill reports, lessons-learned register."],
      ["Emergency response team members are trained and assessed for competency.",
       "ERT roster, training records, competency assessments."],
      ["Emergency equipment is inspected and tested on a documented cadence.",
       "Inspection register, equipment tags, exception reports."],
      ["Liaison arrangements with external emergency services are documented and current.",
       "MOUs, contact lists, recent joint-exercise records."],
      ["After-action reviews are conducted for every drill and actual emergency.",
       "AAR reports, action register, follow-up audits."],
      ["Evacuation routes and assembly points are clearly marked and unobstructed.",
       "Site signage audit, photographic evidence, inspection records."],
      ["Personnel accountability systems are tested during drills.",
       "Mustering reports, headcount discrepancies, drill AARs."],
      ["A documented business continuity plan integrates with the emergency response plan.",
       "BCP document, ERP cross-reference, exercise records."],
      ["Crisis communication protocols are documented and tested annually.",
       "Comms protocol, test records, media-response templates."],
    ],
  },
  {
    eyebrow: "Permits · Work Control",
    items: [
      ["A documented permit-to-work system covers all high-risk work activities.",
       "PTW procedure, permit types, recent issued permits."],
      ["Permit issuers are trained, assessed, and re-authorised on a documented cadence.",
       "Authorisation register, competency assessment records."],
      ["Permits include cross-references to relevant JSAs and isolations.",
       "Sample permits showing references, audit of permit completeness."],
      ["A documented isolation/lockout procedure is applied for all energy sources.",
       "Procedure, isolation certificates, recent compliance audits."],
      ["Confined-space entries follow a documented permit and gas-testing protocol.",
       "Permits, gas-test records, attendant rosters."],
      ["Hot work permits include a documented fire-watch requirement.",
       "Permit template showing fire-watch sign-off, recent hot-work records."],
      ["Working-at-height activities require fall-protection plan sign-off.",
       "Plans, equipment inspection records, rescue-plan evidence."],
      ["A documented process exists for permit suspension and reinstatement.",
       "Procedure, recent suspension records, reinstatement sign-off."],
      ["Daily permit reviews are conducted by area supervisors.",
       "Review register, supervisor sign-off, audit findings."],
      ["Permit closeouts are reviewed before equipment return-to-service.",
       "Closeout templates, return-to-service sign-off."],
    ],
  },
  {
    eyebrow: "Contractor · Management",
    items: [
      ["A documented contractor prequalification process is applied to all contractors.",
       "Prequal procedure, completed prequal records, exception log."],
      ["Contractor safety performance is reviewed at scoped intervals during the contract.",
       "Performance review records, KPI dashboards, action register."],
      ["Contractor inductions include site-specific hazards and emergency procedures.",
       "Induction content, sign-off records, attendance register."],
      ["High-risk contractor activities trigger enhanced oversight from the site team.",
       "Risk-tier matrix, oversight records, joint-inspection logs."],
      ["A documented contractor demobilisation review evaluates HSE performance.",
       "Demob review template, completed reviews, lessons-learned register."],
      ["Contractor incidents are investigated using the same methodology as employee incidents.",
       "Investigation reports, methodology cross-reference, action register."],
      ["A documented escalation process exists for chronic contractor non-conformance.",
       "Escalation procedure, recent escalation examples, contract amendments."],
      ["Contractor personnel are listed in the site competency and authorisation register.",
       "Register export showing contractor entries, sample authorisations."],
      ["Joint contractor-employee safety committees meet on a documented cadence.",
       "Committee terms of reference, meeting minutes, attendance records."],
      ["Sub-contractor flow-down obligations for HSE are included in head contracts.",
       "Contract clauses, sub-contractor acknowledgements, audit findings."],
    ],
  },
  {
    eyebrow: "Health · Occupational Hygiene",
    items: [
      ["A documented occupational health programme covers all credible exposure risks.",
       "Programme document, exposure register, monitoring schedule."],
      ["Personal exposure monitoring is performed on a risk-based schedule.",
       "Monitoring schedule, sample results, trend reports."],
      ["Health surveillance is provided for personnel in exposed roles.",
       "Surveillance register, sample medical records, exception log."],
      ["Hearing conservation includes annual audiometry for noise-exposed personnel.",
       "Audiometry register, exposure assessment, sample results."],
      ["A documented fitness-for-work programme covers fatigue and substance management.",
       "Programme document, training records, sample assessments."],
      ["Manual-handling assessments are performed for all credible manual-handling tasks.",
       "Assessment register, sample assessments, control measures."],
      ["Ergonomic risk assessments are performed for office and operational workstations.",
       "Assessment register, sample assessments, improvement actions."],
      ["A documented hazardous-substances inventory is maintained and accessible.",
       "Inventory export, SDS access audit, recent additions log."],
      ["Mental-health support resources are documented and communicated to personnel.",
       "EAP brochures, communication records, utilisation reports."],
      ["Heat-stress controls are documented for relevant work environments.",
       "Heat-stress procedure, monitoring records, training register."],
    ],
  },
  {
    eyebrow: "Assurance · Audit & Review",
    items: [
      ["An annual HSE audit plan is approved and tracked to completion.",
       "Approved plan, completion report, deferred-audit register."],
      ["Internal audits are performed by personnel independent of the audited area.",
       "Auditor competency records, audit assignment matrix."],
      ["Audit findings are tracked in a corrective action register with due dates.",
       "Register export, overdue-action report, closure evidence."],
      ["A documented management review of the HSE management system occurs annually.",
       "Review agenda, minutes, output actions."],
      ["External audit findings are integrated with internal audit follow-up tracking.",
       "Action register showing source field, recent external-audit closures."],
      ["A documented self-assessment process supports compliance with this standard.",
       "Self-assessment template, completed self-assessments, action records."],
      ["Performance against this standard is reported to leadership on a documented cadence.",
       "Reporting dashboard, recent leadership-review minutes."],
      ["A documented process exists for raising HSE concerns confidentially.",
       "Procedure, recent confidential reports (anonymised), action evidence."],
      ["Corrective action effectiveness is verified after closure.",
       "Verification records, sample re-audits, effectiveness reviews."],
      ["This standard's compliance posture is benchmarked annually against peer sites.",
       "Benchmarking report, peer-site contact log, gap-analysis output."],
    ],
  },
  {
    eyebrow: "Equipment · Inspections & Maintenance",
    items: [
      ["A documented preventive maintenance programme exists for all safety-critical equipment.",
       "PM schedule, work-order export, completion-rate report."],
      ["Safety-critical equipment is identified through a documented criticality analysis.",
       "Criticality register, methodology document, recent reviews."],
      ["Pre-use inspections are documented for mobile equipment.",
       "Inspection forms, completion register, exception report."],
      ["Equipment defect reporting includes a documented escalation path.",
       "Defect log, escalation records, repair turnaround report."],
      ["Lifting equipment is inspected and certified on a documented statutory cadence.",
       "Certification register, inspection tags, recent certificates."],
      ["Pressure systems are inspected on a documented statutory cadence.",
       "Inspection register, recent reports, defect log."],
      ["A documented out-of-service tagging procedure is applied to defective equipment.",
       "Procedure, tag examples, return-to-service records."],
      ["Critical-control verification covers physical equipment inspections.",
       "Verification schedule, sample verification records, exception log."],
      ["A documented spares-management policy ensures critical spares are available.",
       "Spares list, stock-level reports, recent stockout incidents."],
      ["Equipment commissioning includes a documented HSE acceptance step.",
       "Commissioning procedure, sample acceptance records, sign-offs."],
    ],
  },
];

const QUESTIONS = (() => {
  const out = [];
  let n = 0;
  TOPICS.forEach((topic, ti) => {
    topic.items.forEach((item, ii) => {
      n += 1;
      const sec = ti + 1;
      const sub = 1; // flat list — but use a hierarchical-looking number
      out.push({
        id: "q" + String(n).padStart(3, "0"),
        num: sec + "." + sub + "." + (ii + 1),
        text: item[0],
        example: "Example of evidence: " + item[1],
        eyebrow: topic.eyebrow,
        index: n,
      });
    });
  });
  return out;
})();

window.WORKSHOP_QUESTIONS = QUESTIONS;
