/* ---------- assignment: offer, accept, decline ---------- */

.assignment-panel p {
  margin: 0 0 10px;
}

.assignment-card {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.assignment-card:first-of-type {
  border-top: 0;
}

.assignment-main b {
  display: block;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.assignment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}

.decline-form {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.decline-form input[type="text"] {
  min-width: 220px;
}

.panel-hint {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 6px 0 12px;
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.plain-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.row-overdue td {
  background: var(--red-bg);
}

.tone-crit {
  color: var(--red);
}

.tone-warn {
  color: var(--amber);
}

@media (max-width: 640px) {
  .assignment-card {
    flex-direction: column;
  }

  .decline-form input[type="text"] {
    min-width: 0;
    width: 100%;
  }
}

/* ---------- repeating rows (sample tables) ---------- */

.repeater-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.repeater-table th,
.repeater-table td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.repeater-table th {
  background: var(--ground);
  font-weight: 600;
  white-space: nowrap;
}

.repeater-table input,
.repeater-table select,
.repeater-table textarea {
  width: 100%;
  min-width: 96px;
  margin: 0;
}

.repeater-index {
  width: 34px;
  text-align: right;
  color: var(--ink-soft);
}

.repeater > .btn {
  margin-top: 10px;
}

.repeater [data-remove-row][disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---------- inline corrective action, the "+" on ENV's paper forms ---------- */

.inline-action {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--amber);
  border-left-width: 3px;
  border-radius: 6px;
  background: var(--amber-bg);
}

.inline-action-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}

.inline-action-fields {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.inline-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.inline-action label {
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .inline-action-row {
    grid-template-columns: 1fr;
  }
}

/* Corrective actions, reworked for Emma's UAT of 4 August 2026. */

/* Item 10: the summary has to read as the thing you click, not the word beside it. */
.create-panel .summary-link {
  color: var(--link, #1f4e79);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.create-panel summary:hover .summary-link {
  text-decoration-thickness: 2px;
}

/* Item 11: an action waiting on HSEQ review reads differently from one still being
   worked on, so the queue can be scanned without opening anything. */
.pill-review {
  background: #fde8c8;
  color: #7a4b00;
}

.action-trail {
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.evidence-list {
  margin-top: 0.6rem;
}

.evidence-upload {
  padding: 0.7rem 0.85rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}

.evidence-upload .field-note {
  margin: 0.1rem 0 0.5rem;
}

/* Two panels stacked inside one column of a .two-col grid. The panel's own bottom
   margin is what separates them, so the last one drops it and the column ends level
   with the panel beside it. */
.col-stack > :last-child {
  margin-bottom: 0;
}

/* Travel calculator map. Fixed height because Leaflet needs a sized container. */
.map-canvas {
  height: 320px;
  border-radius: 8px;
  border: 1px solid var(--border, #d9dfe1);
  background: #eef1f2;
}

/* Sortable column headers and the extra filters on the job register. */
.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover { text-decoration: underline; }
.sort-link.on { font-weight: 700; }
.filters .filter-date { display: inline-flex; align-items: center; gap: 4px; font-size: 0.85rem; }
.head-actions { display: flex; gap: 8px; align-items: center; }

/* Pipeline quick actions: advance a job from the board without opening it. */
.board-card-wrap { display: flex; flex-direction: column; gap: 4px; }
.board-card-action { margin: 0 0 6px; }
.btn-tiny { font-size: 0.74rem; padding: 3px 8px; width: 100%; }
.nav-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px;
  border-radius: 9px; background: #b3261e; color: #fff;
  font-size: 0.7rem; line-height: 18px; text-align: center; font-weight: 700;
}

/* Guide flowchart: scrolls sideways on a phone rather than shrinking to nothing. */
.flowchart { margin: 0; overflow-x: auto; }
.flowchart svg { min-width: 940px; width: 100%; height: auto; display: block; }
.flowchart figcaption { margin-top: 10px; }
.legend-swatch {
  display: inline-block; width: 13px; height: 13px; border-radius: 3px;
  vertical-align: -2px; margin: 0 4px 0 12px;
}
.legend-swatch:first-child { margin-left: 0; }
.legend-here { background: #fff8e8; border: 2px solid #f2a900; }
.legend-out { background: #f3f5f5; border: 1px dashed #b9c2c6; }

/* ---------- Feedback ----------
   The button sits in the top bar on every page. Raising something where it happened
   is the whole point, so it must never be more than one click away. */
.feedback-open {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.28rem 0.85rem;
}
.feedback-open:hover { background: rgba(255, 255, 255, 0.12); }

.feedback-modal { inset: 0; position: fixed; z-index: 1000; }
.feedback-modal[hidden] { display: none; }
.feedback-backdrop { background: rgba(20, 24, 26, 0.55); inset: 0; position: absolute; }
.feedback-open-body { overflow: hidden; }
.feedback-panel {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(16, 20, 22, 0.35);
  left: 50%;
  max-height: 88vh;
  max-width: 560px;
  overflow-y: auto;
  padding: 1.4rem 1.5rem 1.5rem;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 2rem);
}
.feedback-panel-head { align-items: flex-start; display: flex; justify-content: space-between; }
.feedback-panel-head h2 { margin: 0.1rem 0 0.9rem; }
.feedback-dismiss {
  background: none; border: 0; cursor: pointer; font-size: 1.6rem; line-height: 1;
  color: #7a8286; padding: 0 0.2rem;
}
.feedback-kinds { border: 0; display: flex; gap: 1.1rem; margin: 0 0 0.9rem; padding: 0; }
.feedback-kinds legend { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: #657177; }
.feedback-kinds label { align-items: center; display: flex; gap: 0.35rem; }
.feedback-message textarea { width: 100%; }
.feedback-shot { margin: 0.9rem 0; }
.feedback-shot-toggle { align-items: center; display: flex; gap: 0.5rem; margin-bottom: 0.45rem; }
/* The site sizes checkboxes up for gloved hands on a checklist. Here it sat next to
   one line of text and dwarfed it. */
.feedback-shot-toggle input[type="checkbox"] { height: 1.05rem; margin: 0; width: 1.05rem; }
.feedback-kinds input[type="radio"] { height: 1rem; margin: 0; width: 1rem; }
.feedback-shot img {
  border: 1px solid #d9dfe1; border-radius: 8px; display: block;
  max-height: 150px; max-width: 100%; object-fit: contain; object-position: top left;
}
.feedback-files { display: block; margin: 0.6rem 0; }
.feedback-note { margin: 0.8rem 0 1rem; }
.feedback-actions { display: flex; gap: 0.6rem; justify-content: flex-end; }

.feedback-item { border-top: 1px solid #e6eaec; padding: 1rem 0; }
.feedback-item:first-of-type { border-top: 0; }
.feedback-item-head { align-items: flex-start; display: flex; gap: 1rem; justify-content: space-between; }
.feedback-item-head small { display: block; }
.feedback-message-text { margin: 0.5rem 0; white-space: pre-wrap; }
.feedback-thumb { border: 1px solid #d9dfe1; border-radius: 8px; max-height: 180px; max-width: 100%; }
.feedback-response { background: #f3f5f5; border-radius: 8px; margin: 0.6rem 0; padding: 0.6rem 0.8rem; }
/* An answer with more than one paragraph in it, such as the three access levels a
   record can be set to, arrives with real line breaks in the text. Without this they
   collapse into one wall of prose and the list of options stops reading as a list. */
.feedback-response p { margin: 0.25rem 0; white-space: pre-line; }
.feedback-manage { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.6rem; }
.feedback-manage .grow { flex: 1 1 260px; }
.feedback-manage input { width: 100%; }

.flash-ok {
  background: #eaf5ee; border: 1px solid #cfe6d9; border-radius: 8px;
  color: #287a50; margin: 0 0 1rem; padding: 0.7rem 0.9rem;
}

@media (max-width: 640px) {
  .feedback-panel { max-height: 92vh; padding: 1.1rem; }
  .feedback-kinds { flex-wrap: wrap; gap: 0.7rem; }
}
.flash-floating { margin: 1rem auto 0; max-width: 1180px; width: calc(100% - 3rem); }

.feedback-badges { display: flex; gap: 0.4rem; flex-shrink: 0; }
.pill-priority-high { background: #fcecec; color: #a43232; }
.pill-priority-medium { background: #fff5dd; color: #8a6100; }
.pill-priority-low { background: #f3f5f5; color: #657177; }
.feedback-edit { margin-top: 0.7rem; }
.feedback-edit summary { color: #657177; cursor: pointer; font-size: 0.85rem; }
.feedback-edit form { margin-top: 0.6rem; }
.feedback-edit textarea { width: 100%; }
.feedback-edit label { display: block; margin-bottom: 0.5rem; }
.btn-danger { background: #a43232; border-color: #a43232; color: #fff; }
.btn-danger:hover { background: #8c2a2a; }

/* Access controls: the per-user row on /admin/users, and the named-people list on a
   protected safety record. Both are long lists of choices that have to stay scannable. */
.inline-form .inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  white-space: nowrap;
}
.inline-form .inline-check input { width: auto; margin: 0; }
.checkbox-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.4rem 1rem;
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.6rem;
  border: 1px solid var(--line, #d9dee5);
  border-radius: 8px;
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.checkbox-row input { width: auto; margin-top: 0.2rem; }
.checkbox-row small { display: block; color: #6b7280; font-size: 0.75rem; }

/* The tabs on a user's page are links rather than buttons, so they need the
   underline removed and the same hit area the button version already has. */
.tabs a.tab { display: inline-flex; align-items: center; text-decoration: none; }

/* The select column on the user directory. The row is clickable, so the tick needs a
   generous target of its own that does not drag the administrator to another page. */
.cell-tick { width: 2.5rem; text-align: center; }
.cell-tick input { width: 18px; height: 18px; cursor: pointer; }

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

/* ---------------------------------------------------------------- phones
   Measured on production at 390x844 (iPhone 14/15), 25 August 2026, driven
   through a real browser rather than eyeballed in a devtools frame.

   Every page scrolled sideways, and there was one cause, not many. The header
   grid is `minmax(0,1fr) auto` here but was `1fr auto`, and a `1fr` track keeps
   `min-width: auto`, so the brand column refused to shrink below the width of
   its own text. Brand 140px + actions 270px + gap + padding settled the row at
   460px inside a 390px viewport, and the whole document inherited it.

   The wide tables were never the problem: .matrix-scroll and .table-wrap
   already scroll inside themselves. They show up in a naive "wider than the
   viewport" sweep, and are contained. */
@media (max-width: 640px) {
  .app-header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  /* Both header children have to be allowed to shrink, or the track minimum
     simply moves from one to the other. */
  .product-brand,
  .account-actions,
  .workspace-switcher {
    min-width: 0;
  }

  .account-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 0.35rem;
  }

  .workspace-switcher a {
    min-width: 0;
    padding-inline: 0.5rem;
  }

  /* Letting both header children shrink stopped the page scrolling and started
     them overlapping instead: the brand text has nowhere to wrap to, so it ran
     underneath the feedback button. The wordmark is the part that can go. The
     ENV monogram and arrows stay, and the page title says where you are. */
  .product-name {
    display: none;
  }

  .product-brand {
    overflow: hidden;
  }

  /* 44px is Apple's minimum touch target, and these are used in the field with
     gloves on. Measured before: nav links 36px, the brand 20px. */
  .workspace-switcher a,
.context-nav-inner a,
.account-actions > a,
.account-actions > button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* iOS zooms the entire page in when a focused field is under 16px, and does
     not zoom back out. Report forms measured 12.64px and the register filters
     11.2px, so reporting an incident on a phone left the page magnified and the
     rest of the form off screen. */
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

/* The Operations workspace is still being built. The people who can reach it are
   team leaders and admins, and they should know that before they read a gap as a
   defect. Small, quiet, and not a red alert: it is unfinished, not broken. */
.nav-wip {
  margin-left: 0.35rem;
  padding: 0.1rem 0.32rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.7rem; /* 0.6rem was 9.6px, under the 11px floor for text that says something */
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

