/* Repairs page: routing, hand-offs, the technician's day, visits, clocks and scorecards. */

/* ---------- Hero: copy beside the working router ---------- */

.rep-hero .wrap {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
}
.rep-hero h1 {
  max-width: 11ch;
}
.rep-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
@media (max-width: 1080px) {
  .rep-hero .wrap {
    grid-template-columns: 1fr;
  }
}
.router {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--night) 70%, var(--night-2));
}
.router-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 0.6rem;
  align-items: end;
}
.rf {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}
.sel-night {
  min-height: 44px;
  padding: 0.45rem 0.6rem;
  font-size: 0.92rem;
  background: var(--night-2);
  color: var(--on-night);
  border-color: var(--night-line);
}
.sel-night option {
  background: var(--night);
  color: var(--on-night);
}
.rf-go {
  min-height: 44px;
}
@media (max-width: 760px) {
  .router-form {
    grid-template-columns: 1fr 1fr;
  }
  .rf-go {
    grid-column: 1 / -1;
  }
}

.rules {
  list-style: none;
  margin: 0;
  padding: 0;
  border-block-start: 1px solid var(--night-line);
}
.rules li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border-block-end: 1px solid var(--night-line);
  font-size: 0.92rem;
  transition: background-color 0.35s, color 0.35s;
}
.rule-n {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
}
.rule-n .ic {
  width: 0.9rem;
  height: 0.9rem;
}
.rule-to {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}
.rule-to .ic {
  color: var(--gold);
}
.rules li.fallback {
  color: var(--on-night-soft);
  border-block-end-style: dashed;
}
.rules li.tried {
  color: var(--on-night-soft);
  text-decoration: line-through;
  text-decoration-color: color-mix(in oklab, var(--plaster) 50%, transparent);
}
.rules li.hit {
  background: var(--gold);
  color: var(--night);
  text-decoration: none;
}
.rules li.hit .rule-to .ic {
  color: var(--night);
}
@media (max-width: 560px) {
  .rules li {
    grid-template-columns: 2rem 1fr;
  }
  .rule-to {
    grid-column: 2;
  }
}

.route-log {
  display: grid;
  gap: 0.6rem;
}
.route-log-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}
.route-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.route-acts[hidden] {
  display: none;
}
.log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
  min-height: 6.5rem;
  border-inline-start: 1px solid var(--night-line);
  margin-inline-start: 4px;
}
.log li {
  position: relative;
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.5rem;
  padding: 0.3rem 0 0.3rem 1rem;
  font-size: 0.9rem;
  color: var(--on-night-soft);
  animation: log-in 0.45s var(--ease-out);
}
[dir='rtl'] .log li {
  padding: 0.3rem 1rem 0.3rem 0;
}
.log li::before {
  content: '';
  position: absolute;
  inset-inline-start: -5px;
  inset-block-start: 0.72rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--night-3);
}
.log li.hit,
.log li.ok {
  color: var(--on-night);
}
.log li.hit::before {
  background: var(--gold);
}
.log li.ok::before {
  background: var(--gold);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--gold) 30%, transparent);
}
.log li.no::before {
  background: none;
  border: 1.5px solid var(--plaster);
}
.log li.empty {
  grid-template-columns: 1fr;
  font-style: italic;
}
.log li.empty::before {
  display: none;
}
.log time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  direction: ltr;
  text-align: start;
}
@keyframes log-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
}

/* ---------- Hand-off ---------- */

.handoff {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.ho-lane {
  display: grid;
  gap: 0.6rem;
  padding-block-start: 1rem;
  border-block-start: 2px solid var(--ink);
}
.ho-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
}
.ho-name .ic {
  color: var(--clay);
}
.ho-track {
  position: relative;
  min-height: 11rem;
  border-block-start: 2px dashed var(--ink-line);
  margin-block-start: 1rem;
}
.ho-track::after {
  content: '';
  position: absolute;
  inset-inline-end: -2px;
  inset-block-start: -7px;
  border: 6px solid transparent;
  border-inline-start: 9px solid var(--ink-line);
}
.ho-case {
  position: absolute;
  inset-block-start: 1rem;
  inset-inline-start: 0;
  width: 13rem;
  max-width: 100%;
  display: grid;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  background: var(--night);
  color: var(--on-night);
  border-radius: var(--radius);
  box-shadow: 0 18px 30px -20px rgba(0, 0, 0, 0.90);
  transition: inset-inline-start 1s var(--ease-out);
}
.handoff[data-at='1'] .ho-case {
  inset-inline-start: calc(100% - 13rem);
}
.ho-case b {
  font-family: var(--display);
  font-size: 1.05rem;
}
.ho-case > span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
}
.ho-case .ic {
  color: var(--gold);
  width: 1rem;
  height: 1rem;
}
.ho-ctl {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
.ho-ctl p {
  max-width: 60ch;
}
@media (max-width: 860px) {
  .handoff {
    grid-template-columns: 1fr;
  }
  .ho-track {
    min-height: 0;
    border: 0;
    margin: 0;
  }
  .ho-track::after {
    display: none;
  }
  .ho-case,
  .handoff[data-at='1'] .ho-case {
    position: relative;
    inset: auto;
    width: 100%;
  }
  .handoff[data-at='1'] .ho-track {
    order: 3;
  }
  .handoff[data-at='1'] .ho-ctl {
    order: 4;
  }
}

/* ---------- Dispatcher board and technician ---------- */

.disp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 1000px) {
  .disp {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .board {
    justify-self: stretch;
  }
}
.board {
  display: grid;
  gap: 0;
  overflow-x: auto;
}
.board-row {
  display: grid;
  grid-template-columns: 4.5rem repeat(8, minmax(3.6rem, 1fr));
  align-items: stretch;
  min-height: 4.6rem;
  border-block-end: 1px solid var(--night-line);
  background: repeating-linear-gradient(to right, transparent 0 calc((100% - 4.5rem) / 8 - 1px), var(--night-line) calc((100% - 4.5rem) / 8 - 1px) calc((100% - 4.5rem) / 8)) 4.5rem 0 / calc(100% - 4.5rem) 100% no-repeat;
}
[dir='rtl'] .board-row {
  background-position: calc(100% - 4.5rem) 0;
}
.board-hours {
  min-height: 2rem;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--on-night-soft);
  background: none;
}
.board-hours span {
  padding-inline-start: 0.3rem;
}
.who {
  grid-column: 1;
  align-self: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
}
.job {
  grid-column: calc(var(--s) + 1) / calc(var(--e) + 1);
  grid-row: 1;
  margin: 0.45rem 0.2rem;
  padding: 0.35rem 0.55rem;
  display: grid;
  align-content: center;
  font-size: 0.8rem;
  line-height: 1.25;
  background: var(--night-2);
  border: 1px solid var(--night-line);
  border-radius: 6px;
  min-width: 0;
  overflow: hidden;
}
.job b {
  font-size: 0.86rem;
}
.board-row.me .job {
  background: var(--gold);
  color: var(--night);
  border-color: var(--gold);
}
.job.dashed,
.board-row.me .job.dashed {
  background: transparent;
  color: var(--on-night);
  border: 1.5px dashed var(--gold);
}
.board-note {
  margin-block-start: 0.75rem;
  font-size: 0.9rem;
}
.tech-device {
  --d-w: 320px;
}
.cmp-head {
  display: grid;
  gap: 0.05rem;
  font-size: 0.78rem;
}
.cmp-head b {
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.2;
}
.job-card {
  display: grid;
  gap: 0.25rem;
  font-size: 0.78rem;
  justify-items: start;
}
.job-card.active {
  border-color: var(--gold);
}
.job-card.dashed {
  border-style: dashed;
}
.job-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}
.job-top b {
  font-size: 0.86rem;
}
.job-card .soft-night {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}
.job-card .soft-night .ic {
  width: 13px;
  height: 13px;
}
.job-card .btn {
  margin-block-start: 0.35rem;
  width: 100%;
}
.checks {
  list-style: none;
  padding: 0;
  margin: 0.2rem 0 0;
  display: grid;
  gap: 0.2rem;
}
.checks li {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.checks .ic,
.code-ok .ic {
  width: 14px;
  height: 14px;
  color: var(--gold);
}
.code-ok {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  font-weight: 600;
}
.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-block-start: auto;
}

/* ---------- Visit sheet ---------- */

.outcomes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.outcomes button {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  min-height: 40px;
  padding: 0.4rem 0.85rem;
  color: var(--ink);
  background: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}
.outcomes button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--plaster);
}
.sheet {
  background: var(--plaster);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
  display: grid;
  gap: 1.25rem;
  box-shadow: 0 30px 50px -36px rgba(0, 0, 0, 0.90);
  border-block-start: 6px solid var(--ink);
}
.sheet-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.sheet-grid {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.sheet-grid div {
  padding-block: 0.6rem;
  border-block-start: 1px solid var(--ink-line);
}
.sheet-grid .wide {
  grid-column: 1 / -1;
}
.sheet-grid dd {
  margin: 0.15rem 0 0;
  font-weight: 500;
}
.photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.photos figure {
  margin: 0;
  display: grid;
  gap: 0.35rem;
}
.ph {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--plaster);
}
.ph .ic {
  width: 28px;
  height: 28px;
  opacity: 0.8;
}
.ph-before {
  background: repeating-linear-gradient(135deg, var(--clay) 0 10px, color-mix(in oklab, var(--clay) 80%, var(--ink)) 10px 20px);
}
.ph-after {
  background: var(--pattern-bond), var(--brick);
  color: var(--ink);
}
.chip-hatch {
  background: repeating-linear-gradient(135deg, var(--plaster) 0 5px, color-mix(in oklab, var(--clay) 35%, var(--plaster)) 5px 7px);
  border: 1.5px dashed var(--clay);
  color: var(--ink);
}
.confirm {
  display: grid;
  gap: 0.5rem;
  min-height: 6rem;
}
.otp {
  display: flex;
  gap: 0.4rem;
  direction: ltr;
  justify-content: flex-start;
}
[dir='rtl'] .otp {
  justify-content: flex-end;
}
.otp span {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 3rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
}

/* ---------- SLA clock and quote ---------- */

.sla {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 960px) {
  .sla {
    grid-template-columns: 1fr;
  }
}
.sla-side {
  display: grid;
  gap: 1.25rem;
}
.clock-card {
  background: var(--night);
  color: var(--on-night);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  display: grid;
  gap: 0.6rem;
}
.clock-big {
  font-family: var(--display);
  font-size: 3.2rem;
  line-height: 1;
  font-weight: 700;
  direction: ltr;
  text-align: start;
}
[dir='rtl'] .clock-big {
  text-align: end;
}
.clock-bar {
  height: 10px;
  border-radius: 5px;
  background: var(--night-3);
  overflow: hidden;
}
.clock-bar span {
  display: block;
  height: 100%;
  background: var(--gold);
  transition: inline-size 0.45s linear;
}
.clock-card[data-state='risk'] .clock-bar span {
  background: repeating-linear-gradient(135deg, var(--gold) 0 6px, var(--clay) 6px 12px);
}
.clock-state {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}
.clock-card[data-state='risk'] .clock-state .ic,
.clock-card[data-state='breach'] .clock-state .ic {
  color: var(--gold);
}
.clock-card[data-state='breach'] {
  background: var(--clay);
}
.clock-card[data-state='breach'] .clock-bar {
  background: color-mix(in oklab, var(--clay) 60%, var(--ink));
}
.quote {
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  display: grid;
  gap: 0.6rem;
  justify-items: start;
  min-height: 11.5rem;
  align-content: start;
}
.q-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
}
.q-steps li {
  height: 5px;
  border-radius: 3px;
  background: var(--ink-hair);
}
.q-steps li.on {
  background: var(--ink);
}

/* ---------- Map ---------- */

.rep-map {
  display: grid;
  gap: 1rem;
}
.rep-stage {
  height: clamp(360px, 52vw, 600px);
  border-radius: var(--radius);
  background: radial-gradient(70% 70% at 50% 50%, color-mix(in oklab, var(--night) 75%, var(--clay)), var(--night));
  overflow: hidden;
}
.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  font-size: 0.95rem;
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.sw {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex: none;
}
.sw-open {
  background: var(--gold);
}
.sw-sched {
  background: var(--plaster);
}
.sw-none {
  background: color-mix(in oklab, var(--night) 75%, var(--plaster));
  border: 1px solid var(--night-line);
}

/* ---------- Scorecards ---------- */

.score-wrap {
  overflow-x: auto;
}
.score {
  min-width: 860px;
}
.score tbody th {
  width: auto;
}
.prov-kind {
  display: block;
  font-family: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
}
.cell-bar {
  display: grid;
  gap: 0.3rem;
  max-width: 8rem;
}
.cell-bar .bar {
  height: 6px;
  border-radius: 3px;
  background: var(--ink-hair);
  overflow: hidden;
}
.cell-bar .bar span {
  display: block;
  height: 100%;
  background: var(--ink);
}
.cell-bar .bar span.low {
  background: repeating-linear-gradient(135deg, var(--clay) 0 4px, transparent 4px 7px);
  box-shadow: inset 0 0 0 1px var(--clay);
}
@media (max-width: 720px) {
  .score thead {
    display: table-header-group;
  }
  .score tr {
    display: table-row;
    padding: 0;
  }
  .score th,
  .score td {
    padding: 0.8rem 1rem 0.8rem 0;
    border-block-start: 1px solid var(--ink-line);
  }
}
.coming-row {
  margin-block-start: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: baseline;
  max-width: 70ch;
}

.rep-hero .router.night {
  background: var(--night);
  box-shadow: 0 40px 70px -40px rgba(0, 0, 0, 0.90);
}

/* Before and after: drawn as section details, the way a site engineer sketches a fault. */
.ph.ph-drawn {
  background: var(--plaster);
  border: 1px solid var(--ink-line);
  padding: 0.4rem;
}
.ph.ph-drawn svg {
  width: 100%;
  height: 100%;
}

/* ======================================================================
   Second option: dark glass, vivid signals, a case that travels as light.
   ====================================================================== */

.router,
.rep-hero .router.night {
  position: relative;
  background:
    radial-gradient(60% 40% at 100% 0%, rgba(139, 92, 255, 0.18), transparent 70%),
    linear-gradient(160deg, rgba(20, 25, 50, 0.92), rgba(8, 10, 22, 0.94));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 50px 90px -50px rgba(0, 0, 0, 0.95), 0 0 80px -40px rgba(34, 230, 255, 0.55);
}
.sel-night {
  background: rgba(13, 17, 36, 0.9);
  border-radius: 12px;
}

/* Rules: scanned in order; the matched one lights up. */
.rules {
  position: relative;
  border-block-start-color: var(--line);
}
.rules li {
  border-block-end-color: var(--line);
  border-radius: 12px;
  transition: background-color 0.3s, color 0.3s, box-shadow 0.4s;
}
.rule-n {
  border-color: var(--ink-line);
  color: var(--ink-soft);
}
.rule-to .ic {
  color: var(--violet);
}
.rules li.scan {
  background: rgba(139, 92, 255, 0.14);
}
.rules li.tried {
  color: var(--ink-soft);
  text-decoration-color: var(--magenta);
}
.rules li.tried .rule-n {
  border-color: var(--magenta);
  color: var(--magenta);
}
.rules li.hit {
  background: linear-gradient(90deg, rgba(34, 230, 255, 0.16), rgba(34, 230, 255, 0.04));
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(34, 230, 255, 0.55), 0 0 30px -10px rgba(34, 230, 255, 0.8);
}
[dir='rtl'] .rules li.hit {
  background: linear-gradient(-90deg, rgba(34, 230, 255, 0.16), rgba(34, 230, 255, 0.04));
}
.rules li.hit .rule-n {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #04050a;
}
.rules li.hit .rule-to .ic {
  color: var(--cyan);
}
.rules li.hit.landed .rule-to {
  text-shadow: 0 0 18px rgba(34, 230, 255, 0.8);
}
.rules li.fallback.hit {
  background: rgba(139, 92, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(139, 92, 255, 0.6), 0 0 30px -10px rgba(139, 92, 255, 0.8);
}

/* The packet: one case, carried as light. (Canvas-style coordinates, so physical left/top.) */
.packet {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  --pc: var(--cyan);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--pc) 70%, transparent), 0 0 18px 4px var(--pc), 0 0 40px 10px color-mix(in oklab, var(--pc) 50%, transparent);
  transition: box-shadow 0.3s;
}
.packet:not([data-state]) {
  opacity: 0;
}
.packet[data-state='accepted'] {
  --pc: var(--lime);
  animation: packet-ok 1.4s ease-in-out infinite;
}
.packet[data-state='declined'] {
  --pc: var(--magenta);
}
.packet[data-state='office'] {
  --pc: var(--violet);
}
@keyframes packet-ok {
  50% {
    box-shadow: 0 0 0 6px color-mix(in oklab, var(--pc) 40%, transparent), 0 0 26px 8px var(--pc), 0 0 60px 14px color-mix(in oklab, var(--pc) 40%, transparent);
  }
}

/* What happened: a short event feed, not a timeline rail. */
.log {
  border-inline-start: 0;
  margin-inline-start: 0;
  gap: 0.35rem;
}
.log li,
[dir='rtl'] .log li {
  padding: 0.45rem 0.7rem;
  border-radius: 12px;
  background: rgba(13, 17, 36, 0.7);
  border: 1px solid var(--line);
}
.log li::before {
  position: static;
  display: none;
}
.log li.hit {
  border-color: rgba(34, 230, 255, 0.45);
}
.log li.hit time {
  color: var(--cyan);
}
.log li.ok {
  border-color: rgba(182, 255, 59, 0.5);
  box-shadow: 0 0 22px -10px var(--lime);
}
.log li.ok time {
  color: var(--lime);
}
.log li.no {
  border-color: rgba(255, 61, 154, 0.45);
}
.log li.no time {
  color: var(--magenta);
}
.log li.empty {
  background: none;
  border-style: dashed;
}

/* Hand-off: lanes on glowing rails, the case card gliding between them. */
.ho-lane {
  border-block-start: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--cyan), transparent) 1;
}
.ho-track + .ho-lane {
  border-image: linear-gradient(90deg, var(--violet), transparent) 1;
}
.ho-lane:first-child .ho-name .ic {
  color: var(--cyan);
}
.ho-track + .ho-lane .ho-name .ic {
  color: var(--violet);
}
.ho-name {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
:lang(ar) .ho-name {
  font-family: 'Readex Pro', sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}
.ho-track {
  border-block-start: 2px dashed rgba(139, 92, 255, 0.55);
}
.ho-track::after {
  border-inline-start-color: var(--violet);
}
.ho-case {
  background: linear-gradient(160deg, rgba(22, 27, 54, 0.95), rgba(10, 12, 24, 0.95));
  border: 1px solid rgba(34, 230, 255, 0.5);
  border-radius: 18px;
  box-shadow: 0 0 34px -12px rgba(34, 230, 255, 0.8), 0 24px 40px -24px rgba(0, 0, 0, 0.9);
  transition: inset-inline-start 1.1s var(--ease-out), border-color 0.6s, box-shadow 0.6s;
}
.handoff[data-at='1'] .ho-case {
  border-color: rgba(139, 92, 255, 0.7);
  box-shadow: 0 0 34px -12px rgba(139, 92, 255, 0.9), 0 24px 40px -24px rgba(0, 0, 0, 0.9);
}
.ho-case b {
  font-weight: 600;
}
.ho-case .ic {
  color: var(--lime);
}

/* Dispatcher board. */
.board-row {
  border-block-end-color: var(--line);
}
.job {
  background: rgba(20, 25, 50, 0.9);
  border-color: var(--line);
  border-radius: 10px;
}
.board-row.me .job {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #04050a;
  box-shadow: 0 0 22px -8px var(--cyan);
}
.job.dashed,
.board-row.me .job.dashed {
  background: rgba(255, 162, 31, 0.08);
  color: var(--ink);
  border: 1.5px dashed var(--amber);
  box-shadow: none;
}
.who {
  font-weight: 600;
  font-size: 1rem;
}
:lang(ar) .who {
  font-family: 'Readex Pro', sans-serif;
  font-weight: 700;
}
.cmp-head b {
  font-family: 'Readex Pro', sans-serif;
  font-weight: 700;
}
.job-card.active {
  border-color: var(--cyan);
  box-shadow: 0 0 22px -10px var(--cyan);
}
.job-card.dashed {
  border-color: var(--amber);
}
.checks .ic,
.code-ok .ic {
  color: var(--lime);
}

/* Visit outcomes, each in the colour of what it means. */
.outcomes button {
  color: var(--ink-soft);
  border-color: var(--ink-line);
  background: rgba(13, 16, 32, 0.6);
  --oc: var(--cyan);
}
.outcomes [data-out='fixed'] {
  --oc: var(--lime);
}
.outcomes [data-out='partial'],
.outcomes [data-out='parts'] {
  --oc: var(--amber);
}
.outcomes [data-out='specialist'] {
  --oc: var(--violet);
}
.outcomes [data-out='access'] {
  --oc: var(--magenta);
}
.outcomes button:hover {
  color: var(--ink);
  border-color: var(--oc);
}
.outcomes button[aria-pressed='true'] {
  background: var(--oc);
  border-color: var(--oc);
  color: #04050a;
  box-shadow: 0 0 22px -6px var(--oc);
}
.sheet {
  background: linear-gradient(160deg, rgba(22, 27, 54, 0.92), rgba(10, 12, 24, 0.92));
  border: 1px solid var(--line);
  border-block-start: 0;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.95);
}
.sheet::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  inset-block-start: 0;
  height: 3px;
  background: var(--grad);
}
.sheet-grid div {
  border-block-start-color: var(--line);
}
.ph.ph-drawn {
  background: #0d1124;
  border-color: var(--line);
  border-radius: 14px;
}
.chip-ink {
  background: var(--lime);
  border-color: var(--lime);
  color: #04050a;
}
.chip-hatch {
  background: repeating-linear-gradient(135deg, rgba(255, 162, 31, 0.14) 0 5px, transparent 5px 9px);
  border: 1.5px dashed var(--amber);
  color: #ffc46b;
}
.otp span {
  border: 1px solid rgba(34, 230, 255, 0.55);
  border-radius: 12px;
  background: rgba(34, 230, 255, 0.08);
  box-shadow: 0 0 16px -6px var(--cyan);
  font-weight: 600;
}

/* Clock: drifts from cyan to amber to magenta before it breaches. */
.clock-card {
  background: linear-gradient(160deg, rgba(22, 27, 54, 0.92), rgba(10, 12, 24, 0.92));
  border: 1px solid var(--line);
  border-radius: 22px;
  transition: border-color 0.4s, box-shadow 0.4s;
}
.clock-big {
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--cyan);
  text-shadow: 0 0 24px rgba(34, 230, 255, 0.5);
}
.clock-bar {
  background: rgba(255, 255, 255, 0.08);
}
.clock-bar span {
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  box-shadow: 0 0 12px rgba(34, 230, 255, 0.6);
}
.clock-card[data-state='risk'] {
  border-color: rgba(255, 162, 31, 0.55);
  box-shadow: 0 0 40px -16px var(--amber);
}
.clock-card[data-state='risk'] .clock-big {
  color: var(--amber);
  text-shadow: 0 0 24px rgba(255, 162, 31, 0.5);
}
.clock-card[data-state='risk'] .clock-bar span {
  background: repeating-linear-gradient(135deg, var(--amber) 0 6px, rgba(255, 162, 31, 0.5) 6px 12px);
}
.clock-card[data-state='risk'] .clock-state .ic {
  color: var(--amber);
}
.clock-card[data-state='breach'] {
  background: linear-gradient(160deg, rgba(60, 8, 34, 0.95), rgba(20, 4, 13, 0.95));
  border-color: rgba(255, 61, 154, 0.7);
  box-shadow: 0 0 50px -12px var(--magenta);
  animation: breach 1.2s ease-in-out infinite;
}
.clock-card[data-state='breach'] .clock-big,
.clock-card[data-state='breach'] .clock-state .ic {
  color: #ff8fc4;
  text-shadow: 0 0 24px rgba(255, 61, 154, 0.7);
}
.clock-card[data-state='breach'] .clock-bar {
  background: rgba(255, 61, 154, 0.25);
}
@keyframes breach {
  50% {
    box-shadow: 0 0 70px -6px var(--magenta);
  }
}
.quote {
  background: linear-gradient(160deg, rgba(22, 27, 54, 0.8), rgba(10, 12, 24, 0.8));
  border: 1px solid var(--line);
  border-radius: 22px;
}
.q-steps li {
  background: rgba(255, 255, 255, 0.1);
}
.q-steps li.on {
  background: var(--violet);
  box-shadow: 0 0 10px var(--violet);
}

/* Map. */
.rep-stage {
  border-radius: 24px;
  background: radial-gradient(70% 70% at 50% 50%, rgba(139, 92, 255, 0.16), rgba(6, 7, 13, 0.9));
  border: 1px solid var(--line);
}
.sw {
  border-radius: 4px;
}
.sw-open {
  background: var(--magenta);
  box-shadow: 0 0 12px var(--magenta);
}
.sw-sched {
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
}
.sw-none {
  background: #1c2348;
  border-color: var(--line);
}

/* Scorecards. */
.cell-bar .bar {
  background: rgba(255, 255, 255, 0.08);
}
.cell-bar .bar span {
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  box-shadow: 0 0 10px rgba(34, 230, 255, 0.5);
}
.cell-bar .bar span.low {
  background: repeating-linear-gradient(135deg, var(--magenta) 0 4px, transparent 4px 7px);
  box-shadow: inset 0 0 0 1px var(--magenta);
}
.prov-kind {
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .packet[data-state='accepted'],
  .clock-card[data-state='breach'] {
    animation: none;
  }
}
