/* FAIR Rescue: what it adds to ../shared/ui.css (the look shared with the XPCS Beamline Lab). */

.boss.calm {
  border-color: var(--brand);
}
/* The group leader speaks from the bottom left, so that he does not cover the record. */
.boss:not(.boss-inline) {
  top: auto;
  bottom: 1rem;
  left: 1rem;
  right: auto;
}
@media (min-width: 761px) {
  .f-inspect {
    position: sticky;
    top: 4.4rem;
  }
}
.btn small {
  font-weight: 400;
  font-size: 0.8em;
  opacity: 0.85;
  margin-left: 0.35rem;
}
.desk {
  display: grid;
  gap: 0.9rem;
  padding: 0.9rem;
  max-width: 1500px;
  margin: 0 auto;
  grid-template-columns: minmax(270px, 1fr) minmax(300px, 1.15fr) minmax(290px, 1fr);
  align-items: start;
}
#deadline {
  margin-left: 0.3rem;
}

/* Folder */
.path {
  margin: 0 0 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.files {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.file:hover {
  border-color: var(--brand);
}
.file[aria-pressed="true"] {
  border-color: var(--beam);
  box-shadow: inset 0 0 0 1.5px var(--beam);
  background: var(--surface-sunk);
}
.file .ext {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 5px;
  background: var(--surface-sunk);
  border: 1px solid var(--rule);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}
.file .name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
.file .meta {
  display: block;
  font-family: inherit;
  font-size: 0.72rem;
  color: var(--ink-soft);
}
.file.is-out .name,
.file.is-gone .name {
  text-decoration: line-through;
  color: var(--ink-soft);
}
.chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  white-space: nowrap;
}
.chip.in {
  color: var(--ok);
}
.chip.out,
.chip.gone {
  color: var(--ink-soft);
}
.chip.new {
  color: var(--brand);
}

/* Inspector */
.preview {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  background: var(--surface-sunk);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
  margin: 0.5rem 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.preview.paper {
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: 0.95rem;
  transform: rotate(-0.6deg);
  border-style: dashed;
}
.preview.locked {
  color: var(--ink-soft);
  font-family: inherit;
}
.inspect-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 0.8rem;
}
.inspect-head b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}
.actions-col {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.actions-col .btn {
  justify-content: space-between;
  text-align: left;
}
.found {
  margin: 0.5rem 0 0;
  padding: 0.45rem 0.6rem;
  border-left: 4px solid var(--ok);
  background: var(--surface-sunk);
  border-radius: 0 6px 6px 0;
  font-size: 0.9rem;
}

/* Record */
.meters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}
.meter {
  text-align: center;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.meter b {
  display: block;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.5rem;
  color: var(--ink);
  line-height: 1.1;
}
.meter .bar {
  height: 0.45rem;
  border-radius: 3px;
  background: var(--surface-sunk);
  border: 1px solid var(--rule);
  overflow: hidden;
  margin: 0.2rem 0;
}
.meter .bar i {
  display: block;
  height: 100%;
  background: var(--brand);
  transition: width 300ms ease;
}
.meter.full .bar i {
  background: var(--ok);
}
.record {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
}
.record h3 {
  font-family: inherit;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  margin: 0.5rem 0 0.1rem;
}
.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 0.6rem;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
}
.field .k {
  font-weight: 600;
}
.field .v {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.field .v.set {
  color: var(--ok);
  font-weight: 600;
}
.field .v.bad {
  color: var(--bad);
  font-weight: 600;
}
.field .opts {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.field .opts .btn[aria-pressed="true"] {
  background: var(--brand);
  color: var(--brand-ink);
}

/* Handover */
.steps {
  list-style: none;
  margin: 0.8rem 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.step {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  animation: step-in 0.3s ease-out;
}
.step .mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-weight: 800;
  color: var(--brand-ink);
  background: var(--ok);
}
.step.fail {
  border-color: var(--bad);
}
.step.fail .mark {
  background: var(--bad);
}
.step b {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}
.step p {
  margin: 0.1rem 0 0;
}
@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
}
.letters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin: 0.8rem 0;
}
.principles {
  display: grid;
  gap: 0.6rem;
}
.principles div {
  border-left: 4px solid var(--beam);
  background: var(--surface-sunk);
  padding: 0.5rem 0.7rem;
  border-radius: 0 6px 6px 0;
}
.principles p {
  margin: 0.15rem 0;
  font-size: 0.92rem;
}

@media (max-width: 1100px) {
  .desk {
    grid-template-columns: minmax(250px, 1fr) minmax(280px, 1.1fr);
  }
  .f-record {
    grid-column: 1 / -1;
  }
}
@media (max-width: 760px) {
  .desk {
    padding: 0.6rem;
    gap: 0.6rem;
    grid-template-columns: minmax(0, 1fr);
  }
  .boss:not(.boss-inline) {
    top: auto;
    bottom: 0.6rem;
    left: 0.6rem;
    right: 0.6rem;
    max-width: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .step {
    animation: none;
  }
  .meter .bar i {
    transition: none;
  }
}
