:root {
  color-scheme: light;
  --ink: #242426;
  --muted: #626772;
  --line: #d9dee7;
  --paper: #f3f5f8;
  --panel: #ffffff;
  --dark: #303033;
  --red: #e21f36;
  --red-dark: #b81325;
  --green: #12784a;
  --green-soft: #e5f4ed;
  --amber: #b76a0a;
  --amber-soft: #fff1db;
  --shadow: 0 14px 40px rgba(29, 34, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.visually-hidden {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

a {
  color: var(--red-dark);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.02;
  margin-bottom: 12px;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.2;
  margin-bottom: 14px;
}

h3 {
  font-size: 1rem;
  line-height: 1.25;
  margin-bottom: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--dark);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.hint {
  margin: 9px 0 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  background: #eef1f5;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.button:hover,
.big-action:hover,
.chip:hover,
.link-button:hover,
.job-strip:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--red);
  color: #fff;
}

.button.secondary {
  border: 1px solid var(--line);
  background: #fff;
}

.button.quiet {
  background: #fff;
  border: 1px solid var(--line);
}

.button.danger {
  background: #fde7ea;
  color: var(--red-dark);
}

.button.full-width {
  width: 100%;
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 152px;
  height: auto;
  display: block;
}

.role-switcher {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.role-tab {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eef1f5;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.role-tab.active {
  background: var(--dark);
  color: #fff;
}

.role-tab.alerting {
  background: var(--red-dark);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(226, 31, 54, 0.2);
  animation: emergencyTabPulse 1s ease-in-out infinite;
}

.workspace {
  width: min(1760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 26px;
  margin-bottom: 22px;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
}

.hero-strip .eyebrow {
  color: #ffb4bd;
}

.hero-strip h1 {
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  margin-bottom: 8px;
}

.hero-strip p:last-child {
  margin-bottom: 0;
  color: #d9dce1;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.role-view {
  display: none;
}

.role-view.active {
  display: block;
}

.mobile-frame {
  max-width: 450px;
  margin: 0 auto;
  padding: 16px;
  border-radius: 8px;
  background: #111214;
  box-shadow: var(--shadow);
}

.worker-controls,
.worker-context {
  display: contents;
}

.phone-status,
.worker-head,
.job-detail,
.expand-panel,
.gps-box {
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.phone-status {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 10px;
  color: #fff;
  background: #202124;
  border-color: #202124;
  font-size: 0.9rem;
}

.worker-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding: 18px;
  margin-bottom: 10px;
}

.worker-head h2,
.worker-head p {
  margin-bottom: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill.green {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.red {
  background: #fde7ea;
  color: var(--red-dark);
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.big-action {
  min-height: 86px;
  padding: 14px;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 1.04rem;
  font-weight: 900;
}

.big-action.green {
  background: var(--green);
}

.big-action.dark {
  background: var(--dark);
}

.big-action.red {
  background: var(--red);
}

.big-action.amber {
  background: var(--amber);
}

.emergency-button {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 78px;
  margin-bottom: 10px;
  padding: 14px;
  border: 2px solid #fff;
  border-radius: 8px;
  background: var(--red-dark);
  color: #fff;
  cursor: pointer;
  font-size: 1.12rem;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 0 0 2px var(--red-dark);
}

.emergency-button span {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.job-detail,
.expand-panel,
.gps-box {
  padding: 16px;
  margin-bottom: 10px;
}

.job-heading,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.job-heading h3,
.job-heading p,
.section-head h2,
.section-head p {
  margin-bottom: 0;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
}

.detail-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.detail-value {
  font-weight: 700;
}

.job-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.job-buttons .danger {
  grid-column: 1 / -1;
}

.expand-panel {
  display: none;
}

.expand-panel.open {
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choice-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.chip.active {
  background: var(--dark);
  color: #fff;
}

.gps-box {
  display: grid;
  gap: 14px;
  background: #f8fafc;
}

.gps-box > div p:last-child {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0;
}

.gps-status {
  min-height: 22px;
  color: var(--green);
  font-weight: 800;
}

.photo-preview {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.photo-preview p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.photo-preview figure {
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.photo-preview img {
  width: 86px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
}

.photo-preview figcaption {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.supervisor-photo-review {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 360px));
  gap: 12px;
  justify-content: start;
  margin-top: 18px;
}

.empty-photo-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.supervisor-photo-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.supervisor-photo-card.approved {
  border-color: rgba(18, 120, 74, 0.35);
  background: var(--green-soft);
}

.supervisor-photo-card.retake {
  border-color: rgba(226, 31, 54, 0.35);
  background: #fff1f3;
}

.supervisor-photo-card figure {
  margin: 0;
}

.supervisor-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: #e8edf4;
}

.photo-card-meta {
  display: grid;
  gap: 7px;
}

.photo-card-meta strong {
  font-size: 1rem;
}

.photo-card-meta span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.photo-review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.office-review-panel {
  border-top: 4px solid var(--red);
}

.office-job-review {
  display: grid;
  gap: 14px;
}

.office-job-card {
  display: grid;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.office-job-card.ready {
  border-color: rgba(18, 120, 74, 0.35);
  background: linear-gradient(180deg, #f8fafc 0%, #eef8f3 100%);
}

.office-job-card header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

.office-job-card h3 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.office-job-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.office-job-meta span {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
}

.office-job-meta strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.office-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.location-review {
  display: grid;
  gap: 14px;
}

.location-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.location-card.alert {
  border-color: rgba(226, 31, 54, 0.5);
  background: #fff1f3;
  box-shadow: inset 5px 0 0 var(--red-dark);
}

.location-card header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

.location-card h3 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.location-alert-note {
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--red-dark);
  font-weight: 900;
  line-height: 1.45;
}

.activity-log {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.4;
}

.activity-log.compact {
  margin-top: 14px;
  font-size: 0.88rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.surface {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(29, 34, 43, 0.06);
}

.span-two {
  grid-column: span 2;
}

.job-table {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.8fr auto;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-row.header {
  min-height: auto;
  border: 0;
  padding-top: 0;
  padding-bottom: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.table-row.urgent {
  border-color: var(--red-dark);
  background: #fff1f3;
  box-shadow: inset 4px 0 0 var(--red-dark);
  font-weight: 900;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
}

.status-dot.green {
  background: var(--green);
}

.status-dot.amber {
  background: var(--amber);
}

.status-dot.red {
  background: var(--red-dark);
}

.link-button {
  color: var(--red-dark);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.link-button.inline {
  margin-left: 8px;
  padding: 0;
  text-decoration: underline;
}

.task-list,
.source-list,
.check-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.45;
}

.task-list strong,
.source-list strong,
.check-list strong {
  color: var(--ink);
}

.metric-stack {
  display: grid;
  gap: 10px;
}

.metric-stack div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.metric-stack div:last-child {
  border-bottom: 0;
}

.metric-stack strong {
  font-size: 1.7rem;
}

.metric-stack span {
  color: var(--muted);
  text-align: right;
}

.board-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.board-column {
  min-height: 210px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.board-column h3 {
  margin-bottom: 12px;
}

.job-strip {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  border: 0;
  border-left: 4px solid var(--dark);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 0.15s ease;
}

.job-strip span,
.job-strip small {
  color: var(--muted);
}

.job-strip.active {
  border-left-color: var(--green);
}

.job-strip.warning {
  border-left-color: var(--amber);
}

.job-strip.urgent {
  border-left-color: var(--red-dark);
  background: #fff1f3;
}

.job-strip.done {
  border-left-color: var(--red);
}

.approval-list,
.permission-list,
.roadmap {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.approval-list label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.approval-list input {
  width: auto;
  min-height: auto;
}

.approval-status {
  justify-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 900;
}

.approval-status.approved {
  background: var(--green-soft);
  color: var(--green);
}

.sap-panel {
  border-color: rgba(226, 31, 54, 0.35);
}

.sap-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 18px;
  margin-top: 18px;
}

.integration-note {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: #5c3708;
  line-height: 1.45;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.kpi {
  display: grid;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.kpi strong {
  font-size: 2rem;
  line-height: 1;
}

.kpi span,
.permission-list span,
.roadmap span {
  color: var(--muted);
}

.permission-list span,
.roadmap span {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.permission-list span:last-child,
.roadmap span:last-child {
  border-bottom: 0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: 320px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateY(120%);
  transition: transform 0.2s ease;
  font-weight: 800;
}

.toast.visible {
  transform: translateY(0);
}

.modal {
  width: min(680px, calc(100% - 24px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(17, 18, 20, 0.56);
}

.modal-box {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 24px;
  background: #fff;
}

.modal-box h2 {
  margin-bottom: 0;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.modal-list {
  margin-top: 8px;
}

.drawing-plan {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.lane {
  min-height: 50px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  font-weight: 900;
}

.lane.closed {
  background: repeating-linear-gradient(135deg, var(--red), var(--red) 12px, var(--red-dark) 12px, var(--red-dark) 24px);
}

.lane.taper {
  background: repeating-linear-gradient(90deg, var(--amber), var(--amber) 18px, #f1a433 18px, #f1a433 36px);
}

.lane.open {
  background: var(--green);
}

.drawing-note {
  color: var(--muted);
  line-height: 1.45;
}

.emergency-copy {
  margin-bottom: 0;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.45;
}

.movement-copy {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.45;
}

.emergency-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.emergency-call {
  background: var(--red-dark);
  color: #fff;
}

.emergency-ack {
  background: #fff;
  color: var(--red-dark);
}

.supervisor-emergency-panel {
  scroll-margin-top: 120px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 24px;
  border: 3px solid #fff;
  border-radius: 8px;
  background: var(--red-dark);
  color: #fff;
  box-shadow: 0 0 0 4px var(--red-dark), 0 18px 44px rgba(184, 19, 37, 0.28);
  animation: emergencyPulse 1.2s ease-in-out infinite;
}

.movement-supervisor-panel {
  scroll-margin-top: 120px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 24px;
  border: 3px solid #fff;
  border-radius: 8px;
  background: #8a4700;
  color: #fff;
  box-shadow: 0 0 0 4px #8a4700, 0 18px 44px rgba(138, 71, 0, 0.26);
}

.movement-supervisor-panel[hidden] {
  display: none;
}

.movement-supervisor-panel .eyebrow,
.movement-supervisor-panel h2,
.movement-supervisor-panel p {
  margin-bottom: 0;
  color: #fff;
}

.movement-supervisor-panel h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.movement-supervisor-panel p:last-child {
  margin-top: 8px;
  font-weight: 800;
  line-height: 1.4;
}

.supervisor-emergency-panel[hidden] {
  display: none;
}

.supervisor-emergency-panel .eyebrow {
  color: #fff;
}

.supervisor-emergency-panel h2,
.supervisor-emergency-panel p {
  margin-bottom: 0;
}

.supervisor-emergency-panel h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.supervisor-emergency-panel p:last-child {
  margin-top: 8px;
  font-weight: 800;
  line-height: 1.4;
}

.supervisor-emergency-actions,
.emergency-alert-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.emergency-alert-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 18, 20, 0.72);
}

.movement-alert-shell {
  position: fixed;
  inset: 0;
  z-index: 38;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(36, 36, 38, 0.48);
}

.movement-alert-shell[hidden] {
  display: none;
}

.movement-alert-card {
  width: min(560px, 100%);
  padding: 24px;
  border: 3px solid #fff;
  border-radius: 8px;
  background: #8a4700;
  color: #fff;
  box-shadow: 0 24px 60px rgba(36, 36, 38, 0.36);
}

.movement-alert-card .eyebrow,
.movement-alert-card h2,
.movement-alert-card p {
  color: #fff;
}

.movement-alert-card h2 {
  font-size: clamp(1.7rem, 5vw, 2.5rem);
}

.movement-alert-card p {
  font-weight: 800;
  line-height: 1.45;
}

.emergency-alert-shell[hidden] {
  display: none;
}

.emergency-alert-card {
  width: min(760px, 100%);
  padding: clamp(22px, 5vw, 38px);
  border: 4px solid #fff;
  border-radius: 8px;
  background: var(--red-dark);
  color: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  animation: emergencyPulse 1s ease-in-out infinite;
}

.emergency-alert-card .eyebrow {
  color: #fff;
}

.emergency-alert-card h2 {
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 0.98;
  margin-bottom: 14px;
}

.emergency-alert-card p {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.45;
}

.emergency-sound-status {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
}

.urgent-text {
  color: var(--red-dark);
}

@keyframes emergencyPulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px var(--red-dark), 0 18px 44px rgba(184, 19, 37, 0.28);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(226, 31, 54, 0.34), 0 18px 58px rgba(184, 19, 37, 0.48);
  }
}

@keyframes emergencyTabPulse {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-1px);
  }
}

@media (min-width: 901px) {
  .topbar {
    grid-template-columns: auto minmax(360px, 1fr);
    justify-content: start;
  }

  .role-switcher {
    justify-self: center;
  }

  .hero-strip {
    width: 100%;
    min-height: 144px;
  }

  .worker-layout.active {
    display: block;
  }

  .worker-layout .mobile-frame {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: minmax(380px, 470px) minmax(420px, 1fr);
    gap: 22px;
    align-items: start;
    margin: 0 auto;
    padding: 18px;
  }

  .worker-controls,
  .worker-context {
    display: grid;
    gap: 10px;
  }

  .worker-context {
    grid-template-columns: minmax(0, 1fr);
  }

  .worker-context .job-detail:first-child {
    min-height: 0;
  }

  .worker-context .detail-list {
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
  }

  .worker-context .detail-list div {
    grid-template-columns: 72px 1fr;
  }

  .worker-context .job-buttons {
    grid-template-columns: repeat(3, 1fr);
  }

  .worker-context .job-buttons .danger {
    grid-column: auto;
  }

  .worker-context .gps-box {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .worker-context .gps-status {
    grid-column: 1 / -1;
  }

  .photo-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-preview p {
    grid-column: 1 / -1;
  }

  .activity-log {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 0;
    list-style-position: inside;
  }
}

@media (min-width: 1600px) {
  .topbar {
    padding-right: 32px;
    padding-left: 32px;
  }

  .workspace {
    width: min(2180px, calc(100% - 72px));
    padding-top: 28px;
  }

  .hero-strip {
    min-height: 150px;
    padding: 30px 36px;
  }

  .worker-layout .mobile-frame {
    grid-template-columns: minmax(420px, 520px) minmax(0, 1fr);
    gap: 26px;
    padding: 22px;
  }

  .worker-controls,
  .worker-context {
    gap: 12px;
  }

  .worker-context {
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    align-items: stretch;
  }

  .worker-context .job-detail:first-child {
    grid-column: 1 / 2;
    grid-row: 1;
  }

  .worker-context .gps-box {
    grid-column: 2 / 3;
    grid-row: 1;
    grid-template-columns: 1fr;
    align-content: center;
  }

  .worker-context .gps-box .button {
    justify-self: start;
  }

  .worker-context .job-detail:last-child {
    grid-column: 1 / -1;
  }

  .worker-context .detail-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .worker-context .detail-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .activity-log {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 2200px) {
  .workspace {
    width: min(3400px, calc(100% - 96px));
  }

  .worker-layout .mobile-frame {
    grid-template-columns: minmax(460px, 620px) minmax(0, 1fr);
    gap: 32px;
    padding: 26px;
  }

  .big-action {
    min-height: 96px;
  }

  .worker-context {
    grid-template-columns: minmax(0, 1.3fr) minmax(460px, 0.7fr);
  }
}

@media (min-width: 3600px) {
  .workspace {
    width: calc(100% - 128px);
  }

  .worker-layout .mobile-frame {
    grid-template-columns: minmax(520px, 720px) minmax(0, 1fr);
  }

  .worker-context {
    grid-template-columns: minmax(0, 1.4fr) minmax(540px, 0.6fr);
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .role-switcher {
    grid-column: 1 / -1;
    justify-content: start;
  }

  .hero-strip,
  .dashboard-grid,
  .sap-grid {
    grid-template-columns: 1fr;
  }

  .span-two {
    grid-column: auto;
  }

  .board-columns,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-row {
    grid-template-columns: 1fr;
  }

  .table-row.header {
    display: none;
  }

  .office-job-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hero-strip,
  .board-columns,
  .kpi-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 12px 14px;
    gap: 12px;
  }

  .brand img {
    width: 124px;
  }

  .brand span {
    display: none;
  }

  .workspace {
    width: min(100% - 20px, 1220px);
    padding-top: 12px;
  }

  .office-job-card header,
  .office-job-meta,
  .location-card header {
    grid-template-columns: 1fr;
  }

  .hero-strip,
  .surface {
    padding: 18px;
  }

  .mobile-frame {
    padding: 10px;
  }

  .action-grid,
  .job-buttons {
    grid-template-columns: 1fr;
  }

  .emergency-actions {
    grid-template-columns: 1fr;
  }

  .supervisor-emergency-panel,
  .movement-supervisor-panel,
  .emergency-alert-actions,
  .supervisor-emergency-actions {
    grid-template-columns: 1fr;
  }

  .supervisor-emergency-panel,
  .movement-supervisor-panel {
    display: grid;
    grid-template-columns: 1fr;
  }

  .supervisor-emergency-actions,
  .emergency-alert-actions {
    justify-content: stretch;
  }

  .supervisor-emergency-actions .button,
  .emergency-alert-actions .button {
    width: 100%;
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .toast {
    left: 10px;
    right: 10px;
    max-width: none;
  }
}
