.safety-open { overflow: hidden; }
.safety-dialog { width: min(100%, 720px); max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; padding: 0; border: 0; background: #f5f7f9; color: #20262d; overflow-y: auto; overscroll-behavior: contain; }
.safety-dialog::backdrop { background: rgb(20 28 36 / 60%); }
.safety-dialog button { min-height: 44px; padding: 10px 14px; border: 1px solid #ccd5dc; border-radius: 9px; background: white; color: #20262d; font-weight: 650; cursor: pointer; }
.safety-dialog button:focus-visible, .safety-dialog input:focus-visible, .safety-dialog textarea:focus-visible, .safety-dialog select:focus-visible, .safety-dialog summary:focus-visible { outline: 3px solid #d95f12; outline-offset: 2px; }
.safety-dialog button:disabled { opacity: .6; cursor: wait; }
.safety-dialog h1 { font-size: 23px; line-height: 1.2; margin: 4px 0 10px; }
.safety-dialog h2 { font-size: 21px; margin: 0 0 15px; }
.safety-dialog h3 { font-size: 17px; margin: 18px 0 10px; }
.safety-dialog p { line-height: 1.5; overflow-wrap: anywhere; }
.safety-header { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; padding: max(20px, env(safe-area-inset-top)) 20px 16px; background: #292c30; color: white; }
.safety-header p { font-size: 13px; margin: 0; color: #e2e5e8; }
.safety-header .safety-eyebrow { color: #ffb078; font-size: 11px; font-weight: 750; letter-spacing: 1.3px; }
.safety-header button { flex-shrink: 0; }
.safety-record-bar { padding: 12px 20px; background: #e7edf2; font-size: 13px; display: grid; gap: 10px; }
.safety-record-bar label { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.safety-record-bar select { min-height: 38px; max-width: 100%; min-width: 0; border: 1px solid #b9c5ce; background: white; border-radius: 6px; padding: 6px; }
.safety-intro, .safety-notice { margin: 16px 20px; font-size: 14px; }
.safety-notice { color: #285b40; }
.safety-tabs { padding: 0 16px 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.safety-tabs button { font-size: 14px; text-align: left; }
.safety-tabs [aria-pressed="true"] { background: #fff0e4; border-color: #d95f12; color: #873a09; }
.safety-page { padding: 20px; background: white; }
.safety-page[hidden], .safety-dialog [hidden] { display: none !important; }
.safety-field { display: grid; gap: 7px; font-size: 14px; font-weight: 650; margin: 16px 0; min-width: 0; }
.safety-field input, .safety-field textarea, .safety-field select { display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 46px; padding: 11px; background: white; border: 1px solid #b9c5ce; color: #20262d; border-radius: 8px; font-size: 16px; font-weight: 400; }
.safety-field textarea { resize: vertical; line-height: 1.5; }
.safety-field :disabled { opacity: 1; color: #45474a; background: #f5f7f9; -webkit-text-fill-color: #45474a; }
.safety-field small { font-size: 12px; color: #596774; font-weight: 400; line-height: 1.5; }
.safety-reference { font-size: 13px; color: #596774; }
.safety-step, .safety-check { min-width: 0; margin: 22px 0; padding: 14px; border: 1px solid #cfd8e0; border-radius: 10px; }
.safety-step legend, .safety-check legend { padding: 0 6px; font-size: 14px; line-height: 1.5; font-weight: 650; }
.safety-risk { border: 1px solid #cfd8e0; border-radius: 10px; margin: 12px 0; overflow: hidden; }
.safety-risk summary { padding: 15px; cursor: pointer; background: #f5f7f9; line-height: 1.4; font-weight: 650; }
.safety-risk summary span:first-child { display: inline; }
.safety-risk summary span:last-child { display: block; font-size: 12px; font-weight: 400; margin-top: 6px; color: #596774; }
.safety-risk-body { padding: 0 14px 16px; }
.safety-risk-body p { font-size: 14px; }
.safety-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.safety-confirm { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.5; padding: 12px 0; }
.safety-confirm input { flex: 0 0 24px; width: 24px; height: 24px; margin: 0; accent-color: #d95f12; }
.safety-model { font-size: 14px; line-height: 1.5; }
.safety-model summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-weight: 650; }
.safety-footer { position: sticky; bottom: 0; padding: 10px 16px max(14px, env(safe-area-inset-bottom)); background: #f5f7f9; border-top: 1px solid #cfd8e0; }
.safety-footer p { margin: 0 0 8px; font-size: 13px; }
.safety-footer p:empty { display: none; }
.safety-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.safety-actions button { flex: 1; font-size: 14px; white-space: nowrap; }
.safety-dialog .safety-primary { background: #d95f12; color: white; border-color: #d95f12; }
.safety-dialog .is-error { color: #a72d2d !important; font-weight: 650; }
.run-safety { width: 100%; margin: 10px 0 0; padding: 12px; min-height: 44px; text-align: center; border: 1px solid #ccd5dc; border-radius: 10px; background: #f7f9fb; color: #20262d; display: flex; gap: 10px; justify-content: center; font-size: 13px; font-weight: 650; }
@media (min-width: 600px) { .safety-tabs { grid-template-columns: repeat(4,1fr); } .safety-page { padding: 26px; } }
.safety-signature { margin: 20px 0; }
.safety-signature svg { display: block; width: 100%; aspect-ratio: 1000 / 260; border: 1px solid #aab7c2; border-radius: 8px; background: #fff; touch-action: none; user-select: none; margin-bottom: 8px; }
.safety-signature polyline { fill: none; stroke: #20262d; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
#safety-delivery:not(:empty) { margin: 0 20px 16px; padding: 14px; background: #e7f5ec; border-radius: 8px; font-size: 14px; line-height: 1.5; }
#safety-delivery a { color: #245640; font-weight: 650; }

.run-safety[hidden] { display: none; }

.safety-workplace-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 8px; }
.safety-workplace-choices button { text-align: left; white-space: normal; min-width: 0; overflow-wrap: anywhere; }
.safety-workplace-choices strong, .safety-workplace-choices span { display: block; }
.safety-workplace-choices span { font-size: 13px; line-height: 1.4; font-weight: 400; margin-top: 5px; }
@media (max-width: 420px) { .safety-workplace-choices { grid-template-columns: 1fr; } }

.safety-workplace-choices button:disabled { cursor: not-allowed; }

.safety-choices { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.safety-choices button { flex:1; min-width:140px; white-space:normal; }
.safety-choices button[aria-pressed="true"] { background:#e7f5ec; border-color:#368356; color:#205235; }
.safety-choices button[data-value="stop"][aria-pressed="true"] { background:#fff0ec; border-color:#a72d2d; color:#a72d2d; }
.safety-adjust { margin:12px 0; }.safety-adjust summary { padding:10px 0; font-size:14px; cursor:pointer; }
.safety-adjust textarea { box-sizing:border-box;width:100%;padding:10px;font:inherit;border:1px solid #b9c5ce;border-radius:8px; }
.safety-preflight { margin:20px 0;padding:16px;background:#edf3f8;border-radius:10px; }
.safety-preflight button { width:100%; }.safety-check .safety-choices { margin-bottom:0; }

/* Shared mobile workflow: compact overview, expandable areas, one primary action. */
.safety-header{background:var(--panel-head,#454749);border-bottom:2px solid var(--orange,#ff7800)}
.safety-header h1{font-size:20px}
.safety-page{padding:16px}
.safety-page h2{font-size:18px;margin-bottom:14px}
.safety-job-overview{padding:14px;background:white;border:1px solid #d6dce4;border-radius:10px;margin-bottom:12px;font-size:14px}
.safety-job-overview p{margin:6px 0}.safety-job-overview small{color:#626870}
.safety-flow-group{border:1px solid #d6dce4;border-radius:10px;background:white;margin:12px 0;padding:0 14px;min-width:0}
.safety-flow-group>summary{padding:15px 0;cursor:pointer;font-size:15px;font-weight:700;line-height:1.4}
.safety-flow-group>.safety-field:first-of-type{margin-top:0}
.safety-flow-group>button:last-child{margin-bottom:14px}
.safety-flow-group .safety-check{margin:12px 0}
.safety-record-bar{background:transparent;padding:12px 16px;font-size:12px}
.safety-record-bar .safety-flow-group{margin:4px 0 0}
.safety-record-bar .safety-flow-group>summary{font-size:13px;padding:10px 0}
.safety-record-bar label{padding-bottom:12px}
.safety-tabs{gap:5px;padding:10px 16px}.safety-tabs button{font-size:12px;padding:8px 5px}
.safety-dialog .safety-field{margin:12px 0;gap:5px;font-size:13px}
.safety-risk summary{background:white;font-size:15px}.safety-risk summary span:last-child{font-size:12px;margin-top:4px}
.safety-risk-body h3{font-size:15px}.safety-risk-body>p{font-size:13px}
.safety-lift-choice.safety-check{border:0;padding:0;margin:0 0 12px}
.safety-lift-choice .safety-actions{display:grid;grid-template-columns:1fr;gap:10px}
.safety-lift-choice .safety-actions button{white-space:normal;text-align:left;padding:13px}
.safety-lift-choice>details{margin-top:14px;border-top:1px solid #e5e7eb}
#safety-lift-plan{border:0;padding:0;margin:0}#safety-lift-plan>legend{display:none}
#safety-lift-plan .safety-flow-group{background:#f8f9fa}
.safety-footer .safety-actions{display:flex;flex-direction:column;gap:9px}
.safety-footer .safety-actions button{width:100%;flex:none;white-space:normal}
.safety-footer [data-action=next]{background:var(--orange-dark,#d95f12);color:white;border-color:var(--orange-dark,#d95f12)}
.safety-footer [data-action=save]{font-size:13px;background:transparent;color:#626870;min-height:36px}
.safety-confirm input[type=checkbox]{display:block;flex:0 0 20px;width:20px;height:20px;margin:2px 0 0}

.safety-risk-progress{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:12px}.safety-risk-progress p{font-size:13px;margin:0}.safety-risk-progress button{font-size:13px}

/* Guided lift plan: one short section at a time, using the mobile form controls. */
.lift-guided{margin-top:12px}
.lift-guided .safety-flow-group{margin:10px 0}
.lift-guided .lift-prompt{font-size:14px;font-weight:650;margin:16px 0 8px}
.lift-shortcuts{display:flex;flex-wrap:wrap;gap:8px}
.lift-shortcuts button{flex:1 1 120px;font-size:14px}
.lift-shortcuts button[aria-pressed="true"]{background:#fff0e4;border-color:#d95f12;color:#873a09}
.lift-guided .lift-next,.lift-chart-button{display:block;width:100%;box-sizing:border-box;text-align:center;margin:14px 0;padding:12px;border-radius:9px;min-height:44px;font-weight:650}
.lift-guided .lift-next{background:var(--orange-dark,#d95f12);border-color:var(--orange-dark,#d95f12);color:white}
.lift-chart-button{border:1px solid #d95f12;background:#fff0e4;color:#873a09;text-decoration:none}
.lift-numbers{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:360px){.lift-numbers{grid-template-columns:1fr}}

.lift-pending{font-size:13px;color:#596774;margin:8px 0 14px}
.lift-guided .lift-later{background:transparent;border:0;color:#596774;text-decoration:underline;padding:8px 0;text-align:left;font-size:13px}
.lift-guided .safety-adjust{margin:12px 0}
