:root {
  --bg: #f4f2ee;
  --panel: #fffdf9;
  --ink: #1d2421;
  --muted: #5d6762;
  --line: #e3ded5;
  --soft: #efebe4;
  --accent: #0e6b62;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe9;
  --ok: #1f7a4d;
  --ok-soft: #e1f2e7;
  --warn: #9a5b00;
  --warn-soft: #fbefd9;
  --bad: #b3261e;
  --bad-soft: #fbe4e1;
  --info: #2f5d9a;
  --info-soft: #e4ecf8;
  --r: 12px;
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141816;
    --panel: #1b201e;
    --ink: #e8ece9;
    --muted: #9aa5a0;
    --line: #2b3330;
    --soft: #222826;
    --accent: #4fb3a6;
    --accent-ink: #06211d;
    --accent-soft: #173430;
    --ok: #6fcf97;
    --ok-soft: #173326;
    --warn: #f2b45a;
    --warn-soft: #3a2c12;
    --bad: #ff8a80;
    --bad-soft: #3d1a18;
    --info: #8fb4ec;
    --info-soft: #1a2740;
  }
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--font);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
[hidden] {
  display: none !important;
}
.mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: conic-gradient(from 210deg, var(--accent), #7cc4b9, var(--accent));
  display: inline-block;
  flex: none;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(380px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  display: grid;
  gap: 14px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
input,
select,
textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
}
input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
}
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
button.small {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
}
.err {
  color: var(--bad);
  min-height: 1.2em;
  margin: 0;
}
.fine {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}
nav {
  display: grid;
  gap: 2px;
  flex: 1;
  overflow: auto;
}
nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
}
nav a:hover {
  background: var(--soft);
}
nav a[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
nav a .n {
  font-size: 12px;
  background: var(--bad-soft);
  color: var(--bad);
  border-radius: 999px;
  padding: 0 7px;
}
main {
  padding: 26px 30px 60px;
  max-width: 1280px;
  width: 100%;
}
h1 {
  font-size: 24px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 16px;
  margin: 0 0 10px;
}
.sub {
  color: var(--muted);
  margin: 0 0 20px;
}
.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
}
.kpi .v {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.kpi .l {
  color: var(--muted);
  font-size: 13px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.filters select,
.filters input {
  min-height: 38px;
  padding: 6px 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tr.click {
  cursor: pointer;
}
tr.click:hover td {
  background: var(--soft);
}
.mono {
  font-family: var(--mono);
  font-size: 13px;
}
.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--soft);
  color: var(--muted);
  white-space: nowrap;
}
.pill.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.pill.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.pill.info {
  background: var(--info-soft);
  color: var(--info);
}
.bar {
  height: 10px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.funnel {
  display: grid;
  gap: 8px;
}
.funnel .r {
  display: grid;
  grid-template-columns: 150px 1fr 60px;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 150px 70px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.timeline .t {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 980px) {
  .split {
    grid-template-columns: 1fr;
  }
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    align-content: start;
  }
}
.empty {
  color: var(--muted);
  padding: 18px;
  text-align: center;
}
.note {
  background: var(--info-soft);
  color: var(--info);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
dl.kv {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 6px 12px;
  margin: 0;
  font-size: 14px;
}
dl.kv dt {
  color: var(--muted);
}
dl.kv dd {
  margin: 0;
}
.back {
  background: none;
  color: var(--accent);
  padding: 0;
  min-height: 0;
  font-weight: 600;
  margin-bottom: 10px;
}
.attention {
  list-style: none;
  margin: 0;
  padding: 0;
}
.attention li a {
  display: grid;
  grid-template-columns: 56px 84px 1fr;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px dashed var(--line, #e4e1da);
  color: inherit;
  text-decoration: none;
}
.attention li a:hover {
  background: rgba(0, 0, 0, 0.03);
}
.attention .n {
  font-size: 18px;
  font-weight: 600;
  text-align: right;
}
.kpi .v small {
  font-weight: 400;
  font-size: 13px;
}

/* ---------------- cockpit skin: lanes, colour, phone layout ---------------- */
:root {
  --teal: #14b8a6;
  --cyan: #22b4e6;
  --violet: #8b5cf6;
  --amber: #f0a21a;
  --pink: #e2558f;
  --blue: #4f7cf7;
}
body {
  background:
    radial-gradient(1000px 500px at 10% -10%, color-mix(in srgb, var(--teal) 13%, transparent), transparent 60%),
    radial-gradient(800px 460px at 100% 0%, color-mix(in srgb, var(--violet) 11%, transparent), transparent 62%), var(--bg);
  background-attachment: fixed;
}
.mark {
  background: conic-gradient(from 200deg, var(--teal), var(--cyan), var(--violet), var(--pink), var(--amber), var(--teal));
  box-shadow: 0 0 14px color-mix(in srgb, var(--teal) 60%, transparent);
}
nav {
  gap: 14px;
  align-content: start;
}
nav a {
  min-height: 40px;
}
nav a[aria-current='page'] {
  background: linear-gradient(90deg, color-mix(in srgb, var(--lane) 18%, var(--panel)), transparent);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--lane);
}
.card {
  border: 1px solid transparent;
  border-radius: 16px;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(
        135deg,
        color-mix(in srgb, var(--cyan) 38%, var(--line)),
        var(--line) 40%,
        var(--line) 65%,
        color-mix(in srgb, var(--violet) 34%, var(--line))
      )
      border-box;
  box-shadow: 0 10px 30px -14px color-mix(in srgb, var(--blue) 25%, transparent);
}
.grid > .card.kpi {
  --hue: var(--teal);
  position: relative;
  border: 1px solid color-mix(in srgb, var(--hue) 30%, var(--line));
  background:
    radial-gradient(140px 90px at 100% 0%, color-mix(in srgb, var(--hue) 22%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--hue) 9%, var(--panel)), var(--panel));
}
.grid > .card.kpi::after {
  content: '';
  position: absolute;
  top: 14px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hue);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--hue) 18%, transparent),
    0 0 12px var(--hue);
}
.grid > .card.kpi:nth-child(6n + 2) {
  --hue: var(--amber);
}
.grid > .card.kpi:nth-child(6n + 3) {
  --hue: var(--violet);
}
.grid > .card.kpi:nth-child(6n + 4) {
  --hue: var(--blue);
}
.grid > .card.kpi:nth-child(6n + 5) {
  --hue: var(--pink);
}
.grid > .card.kpi:nth-child(6n + 6) {
  --hue: #6cc04a;
}
button:not(.ghost):not(.back) {
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--blue)));
}
.bar i {
  background: linear-gradient(90deg, var(--teal), var(--cyan), var(--violet));
}
main {
  min-width: 0;
}
.card {
  max-width: 100%;
}
/* tablet and phone: the rail becomes a sticky top bar with a swipeable chip row */
@media (max-width: 980px) {
  nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  nav::-webkit-scrollbar {
    display: none;
  }
  nav a {
    flex: none;
    gap: 6px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 99px;
    border: 1px solid var(--line);
    box-shadow: inset 3px 0 0 var(--lane);
    background: var(--panel);
    white-space: nowrap;
  }
  nav a[aria-current='page'] {
    background: color-mix(in srgb, var(--lane) 16%, var(--panel));
    border-color: var(--lane);
  }
  main {
    padding: 16px 12px 48px;
  }
}
@media (max-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpi .v {
    font-size: 24px;
  }
  .timeline li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .funnel .r {
    grid-template-columns: 110px 1fr 44px;
  }
  dl.kv {
    grid-template-columns: 1fr;
  }
  dl.kv dd {
    margin-bottom: 6px;
  }
  .attention li a {
    grid-template-columns: 44px 72px minmax(0, 1fr);
  }
  table {
    font-size: 13px;
  }
}
/* wide tables scroll inside their card instead of widening the page */
.card {
  overflow-x: auto;
}
.form {
  display: grid;
  gap: 12px;
}
.form h2 {
  margin: 0;
}
.form .fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.form button {
  justify-self: start;
}
label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: end;
  min-height: 44px;
}
label.check input {
  min-height: 0;
  width: 18px;
  height: 18px;
}
.acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.secret {
  margin-bottom: 14px;
  border-color: var(--warn);
  background: var(--warn-soft);
}
.secret-v {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel);
  word-break: break-all;
  user-select: all;
}
.ok-text {
  color: var(--ok);
  font-weight: 600;
}
.golive-head {
  display: flex;
  gap: 18px;
  align-items: center;
}
.golive-head p {
  margin: 4px 0 0;
}
.ring {
  --p: 0;
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--teal) calc(var(--p) * 1%), var(--soft) 0);
}
.ring span {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel);
  font-weight: 700;
}
.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.checklist li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
}
.checklist li p {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}
.checklist .ic {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--soft);
}
.checklist .s-done {
  border-left-color: var(--ok);
}
.checklist .s-done .ic {
  background: var(--ok-soft);
  color: var(--ok);
}
.checklist .s-todo {
  border-left-color: var(--bad);
}
.checklist .s-todo .ic {
  background: var(--bad-soft);
  color: var(--bad);
}
.checklist .s-warn {
  border-left-color: var(--warn);
}
.checklist .s-warn .ic {
  background: var(--warn-soft);
  color: var(--warn);
}
.small-link {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
form.setting {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto 80px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
form.setting textarea {
  font: 13px/1.4 var(--mono);
  min-height: 44px;
}
.qdec {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.qdec input {
  min-height: 34px;
  padding: 6px 10px;
}
td select {
  min-height: 34px;
  padding: 4px 8px;
}
@media (max-width: 640px) {
  form.setting {
    grid-template-columns: 1fr auto;
  }
  form.setting > div {
    grid-column: 1 / -1;
  }
  .checklist li {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .checklist .small-link {
    grid-column: 2;
    justify-self: start;
  }
}
/* with a mouse on a desktop, a compact sidebar fits all six lanes in one screen; touch keeps 40 px targets */
@media (min-width: 981px) and (pointer: fine) {
  nav {
    gap: 6px;
  }
  nav a {
    min-height: 28px;
    padding: 4px 12px;
  }
}
/* phones: each table row becomes a card with labelled lines, so actions stay on screen */
@media (max-width: 640px) {
  .card:has(> table) {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0 !important;
  }
  .card > table,
  .card > table tbody,
  .card > table tr,
  .card > table td {
    display: block;
    width: 100%;
  }
  .card > table thead {
    display: none;
  }
  .card > table tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  .card > table td {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    padding: 5px 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  .card > table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding-top: 2px;
  }
  .card > table td[data-label='']::before {
    content: none;
  }
  .card > table td[data-label=''] {
    grid-template-columns: 1fr;
  }
  .card > table td > .pill {
    justify-self: start;
  }
  .card > table td .cell {
    min-width: 0;
  }
}
label.toggle {
  display: inline-flex;
  margin: -6px 0 12px;
  min-height: 32px;
}

/* ---------- shipments: stage tiles, company cards and the per-device journey ---------- */
.stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}
.stage {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
}
.stage .n {
  font-size: 24px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.stage .l {
  font-size: 13px;
  color: var(--muted);
}
.stage .arrow {
  position: absolute;
  right: 8px;
  top: 10px;
  color: var(--muted);
}
.stage.on,
.card.vendor.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.stage.bad .n {
  color: var(--bad);
}
.card.vendor {
  color: inherit;
  text-decoration: none;
}
.journey {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.journey li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  position: relative;
}
.journey li::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.journey li:first-child::before {
  top: 50%;
}
.journey li:last-child::before {
  bottom: 50%;
}
.journey .dot {
  position: relative;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--panel);
}
.journey .done .dot {
  background: var(--ok);
  border-color: var(--ok);
}
.journey .now .dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.journey .late .dot {
  background: var(--bad);
  border-color: var(--bad);
  box-shadow: 0 0 0 4px var(--bad-soft);
}
.journey .skipped .dot {
  border-style: dashed;
}
.journey .next .lbl,
.journey .skipped .lbl {
  color: var(--muted);
}
.journey .now .lbl,
.journey .late .lbl {
  font-weight: 600;
}
@media (max-width: 640px) {
  .journey li {
    grid-template-columns: 22px 1fr;
  }
  .journey li .fine {
    grid-column: 2;
  }
  .stage .arrow {
    display: none;
  }
}
main a.ref {
  color: var(--accent);
}
@media (max-width: 640px) {
  .stages {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .stage {
    padding: 8px 10px;
  }
  .stage .n {
    font-size: 20px;
  }
  .stage .l {
    font-size: 12px;
  }
  .grid.vendors {
    grid-template-columns: 1fr;
  }
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}
.chip[aria-current='true'] {
  border-color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 16%, var(--panel));
  font-weight: 700;
}

/* ---------- tabs inside one menu entry ---------- */
.tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs a {
  padding: 10px 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a[aria-current='page'] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
a.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
a.button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
button.danger {
  color: var(--bad);
}
.head-row {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- organisations: progress and stepper ---------- */
.progress {
  height: 6px;
  border-radius: 99px;
  background: var(--soft);
  overflow: hidden;
  min-width: 90px;
  margin-bottom: 4px;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.stepper {
  list-style: none;
  display: flex;
  gap: 4px;
  padding: 0;
  margin: 8px 0 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.stepper li {
  flex: 1 0 auto;
}
.stepper a,
.stepper li > span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  background: var(--panel);
}
.stepper .dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--soft);
  color: var(--muted);
}
.stepper .done .dot {
  background: var(--ok-soft);
  color: var(--ok);
}
.stepper .here a {
  border-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}
.stepper .here .dot {
  background: var(--accent);
  color: var(--accent-ink);
}
.step-head h2 {
  margin: 0 0 4px;
}
.step-head {
  margin-bottom: 12px;
}
.step-nav {
  margin-top: 18px;
}
.choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.choice .opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
}
.choice .opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.choice .opt > span {
  display: grid;
  gap: 2px;
}
.choice input {
  min-height: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
label.wide {
  grid-column: 1 / -1;
}

/* ---------- spreadsheet upload ---------- */
.upload {
  display: grid;
  gap: 10px;
}
.upload-bar {
  flex-wrap: wrap;
  gap: 10px;
}
.drop {
  flex: 1;
  min-width: 220px;
  min-height: 64px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
}
.drop.over,
.drop:hover {
  border-color: var(--accent);
  color: var(--ink);
}
.upload .cols {
  margin: 6px 0 0;
  padding-left: 18px;
}
.upload .req {
  color: var(--warn);
  font-size: 12px;
}
.upload-sum {
  flex-wrap: wrap;
  gap: 8px;
}
.preview,
.problems {
  overflow: auto;
  max-height: 340px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.preview table,
.problems table {
  width: 100%;
}
.warn-card {
  border-color: var(--warn);
  background: var(--warn-soft);
}

/* ---------- CRM in a frame ---------- */
.crm-frame {
  width: 100%;
  height: calc(100vh - 150px);
  min-height: 560px;
  border: 0;
  border-radius: var(--r);
  background: var(--panel);
}
@media (max-width: 980px) {
  .crm-frame {
    height: calc(100dvh - 190px);
  }
  .stepper .t {
    display: none;
  }
  .stepper .here .t {
    display: inline;
  }
}

/* device rules: one inline form that wraps on narrow screens */
.rule-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
  margin-top: 12px;
}
.rule-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
  flex: 1 1 150px;
}
.rule-form .err {
  flex-basis: 100%;
  margin: 0;
}

/* ---------- top bar: a few tabs across the top, sub-tabs under them ---------- */
.shell {
  display: block;
}
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top .brand {
  flex: none;
}
.top nav {
  display: flex;
  flex: 1;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.top nav::-webkit-scrollbar {
  display: none;
}
.top nav a {
  flex: none;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}
.top nav a:hover {
  background: var(--soft);
  color: var(--ink);
}
.top nav a[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}
.top #logout {
  flex: none;
}
main {
  margin: 0 auto;
  padding: 18px 28px 60px;
}
.subbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.subbar .tabs {
  margin: 0;
  flex: 1;
  min-width: 0;
}
@media (max-width: 980px) {
  .top {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }
  .top .brand {
    flex: 1;
  }
  .top nav {
    order: 3;
    flex-basis: 100%;
  }
  main {
    padding: 14px 12px 48px;
  }
}

/* ---------- (i): what a screen is and how to use it ---------- */
button.info {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--info) 45%, var(--line));
  background: var(--info-soft) !important;
  color: var(--info);
  font:
    italic 600 13px/1 Georgia,
    'Times New Roman',
    serif;
  vertical-align: middle;
  cursor: pointer;
  flex: none;
}
button.info:hover,
button.info[aria-expanded='true'] {
  background: var(--info) !important;
  color: var(--panel);
}
button.info:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}
.help-pop {
  position: absolute;
  z-index: 50;
  padding: 12px 14px 10px;
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.35);
  font-size: 14px;
  line-height: 1.45;
}
.help-pop p {
  margin: 0 0 8px;
}
.help-pop .help-k {
  margin: 8px 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.help-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.help-close {
  background: transparent !important;
  color: var(--muted);
  border: 0;
  font-size: 20px;
  line-height: 1;
  min-height: 28px;
  padding: 0 4px;
  cursor: pointer;
}

/* ---------- organisation workspace ---------- */
.crumb {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.crumb:hover {
  color: var(--accent);
}
.org-tabs {
  margin-bottom: 16px;
}
.ptitle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 20px;
  margin-bottom: 4px;
}
h2.sec {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 10px;
}
.jbar {
  height: 6px;
  border-radius: 99px;
  background: var(--soft);
  overflow: hidden;
  min-width: 90px;
}
.jbar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--info)));
}
ol.journey {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
ol.journey li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
ol.journey li.done {
  color: var(--ink);
}
ol.journey li.next {
  color: var(--ink);
  font-weight: 600;
}
ol.journey .ic {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 12px;
  flex: none;
}
ol.journey li.done .ic {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--panel);
}
ol.journey li.next .ic {
  border-color: var(--info);
}
ol.steps-done {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 12px;
}
.sd-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 14px;
}
.steps-done .fine {
  margin-top: 4px;
}
details.add-one {
  margin-top: 16px;
}
details.add-one summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
details.add-one .form {
  margin-top: 12px;
}
.ok-msg {
  color: var(--ok);
  margin: 0;
  min-height: 1.2em;
}
ul.plain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
#statusForm,
#orderForm {
  margin-top: 14px;
}
#statusForm h2,
#orderForm h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* the view takes focus on navigation for screen readers; no frame for it */
main:focus {
  outline: none;
}
/* one search box for every list (search.js) */
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 280px;
  max-width: 460px;
}
.search input[type='search'] {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 6px 10px 6px 32px;
  background: var(--panel)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23707780' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E")
    no-repeat 10px center;
}
.search-count {
  white-space: nowrap;
}
@media (max-width: 640px) {
  .search {
    max-width: none;
    flex-basis: 100%;
  }
}

/* onboarding stalls */
.nowrap {
  white-space: nowrap;
}
input.days {
  width: 56px;
  padding: 4px 6px;
  min-height: 0;
}

/* ---------------- journey map: swimlanes, steps, rule gateways, end events ---------------- */
.jm-wrap {
  overflow-x: auto;
  padding: 10px;
}
.jm {
  display: block;
  color: var(--muted);
  font-family: var(--font);
}
.jm .h-teal {
  --hue: var(--teal);
}
.jm .h-violet {
  --hue: var(--violet);
}
.jm .h-blue {
  --hue: var(--blue);
}
.jm .h-amber {
  --hue: var(--amber);
}
.jm .h-green {
  --hue: #3fa34d;
}
.jm-lane-bg {
  fill: color-mix(in srgb, var(--hue) 5%, var(--panel));
  stroke: var(--line);
}
.jm-lane-head {
  fill: color-mix(in srgb, var(--hue) 16%, var(--panel));
  stroke: var(--line);
}
.jm-lane-label {
  fill: color-mix(in srgb, var(--hue) 70%, var(--ink));
  font-size: 13px;
  font-weight: 700;
}
.jm-step rect {
  fill: color-mix(in srgb, var(--hue) 12%, var(--panel));
  stroke: var(--hue);
  stroke-width: 1.6;
}
.jm-step:hover rect,
.jm-step:focus rect {
  fill: color-mix(in srgb, var(--hue) 22%, var(--panel));
}
.jm-step-label {
  fill: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
}
.jm-now {
  fill: color-mix(in srgb, var(--hue, var(--ink)) 60%, var(--ink));
  font-size: 17px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.jm-fine {
  fill: var(--muted);
  font-size: 10.5px;
  font-weight: 400;
}
.jm-dated {
  fill: #b45309;
}
.jm-split {
  grid-template-columns: 2fr 3fr;
}
.jm-split .card {
  overflow-x: auto;
}
@media (max-width: 980px) {
  .jm-split {
    grid-template-columns: 1fr;
  }
}
.jm-flow {
  fill: none;
  stroke: color-mix(in srgb, var(--ink) 45%, transparent);
  stroke-width: 1.4;
}
.jm-flow.msg {
  stroke-dasharray: 5 4;
}
.jm-assoc {
  stroke: color-mix(in srgb, var(--violet) 50%, transparent);
  stroke-dasharray: 2 3;
}
.jm-rule path {
  fill: color-mix(in srgb, var(--violet) 14%, var(--panel));
  stroke: var(--violet);
  stroke-width: 1.5;
}
.jm-rule.bad path {
  fill: var(--bad-soft);
  stroke: var(--bad);
}
.jm-rule-code {
  fill: var(--ink);
  font-size: 9.5px;
  font-weight: 700;
}
.jm-start circle {
  fill: var(--ok-soft);
  stroke: var(--ok);
  stroke-width: 1.6;
}
.jm-end circle {
  fill: var(--panel);
  stroke-width: 3.5;
  stroke: var(--muted);
}
.jm-end.ok circle {
  stroke: var(--ok);
}
.jm-end.warn circle {
  stroke: var(--amber);
}
.jm-end.bad circle {
  stroke: var(--bad);
}
.jm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 8px 2px 0;
}
.jm-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.jm-legend .sw {
  display: inline-block;
  width: 18px;
  height: 12px;
  border-radius: 4px;
}
.jm-legend .sw.step {
  background: color-mix(in srgb, var(--teal) 18%, var(--panel));
  border: 1.5px solid var(--teal);
}
.jm-legend .sw.rule {
  width: 11px;
  height: 11px;
  border-radius: 1px;
  transform: rotate(45deg);
  background: color-mix(in srgb, var(--violet) 18%, var(--panel));
  border: 1.5px solid var(--violet);
}
.jm-legend .sw.flow {
  height: 0;
  border-top: 2px solid var(--muted);
  border-radius: 0;
}
.jm-legend .sw.msg {
  height: 0;
  border-top: 2px dashed var(--muted);
  border-radius: 0;
}
.jm-legend .sw.end {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid var(--ok);
}
/* who did it, coloured the same way everywhere: organisation, moBe, the Hub, carriers */
.timeline .src {
  justify-self: start;
  align-self: start;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 650;
  background: var(--soft);
}
.timeline .src-pop,
.timeline .src-upload {
  background: color-mix(in srgb, var(--teal) 16%, var(--panel));
  color: color-mix(in srgb, var(--teal) 70%, var(--ink));
}
.timeline .src-pha {
  background: color-mix(in srgb, var(--blue) 16%, var(--panel));
  color: color-mix(in srgb, var(--blue) 70%, var(--ink));
}
.timeline .src-hub {
  background: color-mix(in srgb, var(--violet) 16%, var(--panel));
  color: color-mix(in srgb, var(--violet) 70%, var(--ink));
}
.timeline .src-carrier,
.timeline .src-vendor {
  background: color-mix(in srgb, var(--amber) 18%, var(--panel));
  color: color-mix(in srgb, var(--amber) 55%, var(--ink));
}
thead th {
  background: color-mix(in srgb, var(--teal) 6%, transparent);
}
.jm {
  width: 100%;
  height: auto;
}
.jm-ends {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.jm-endchip {
  --hue: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--hue) 40%, var(--line));
  background: color-mix(in srgb, var(--hue) 8%, var(--panel));
}
.jm-endchip i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3.5px solid var(--hue);
  flex: none;
}
.jm-endchip div {
  display: grid;
  line-height: 1.2;
}
.jm-endchip.ok {
  --hue: var(--ok);
}
.jm-endchip.warn {
  --hue: var(--amber);
}
.jm-endchip.bad {
  --hue: var(--bad);
}
.timeline.hist li {
  grid-template-columns: 190px 84px 1fr;
}
@media (max-width: 640px) {
  .timeline.hist li {
    grid-template-columns: 1fr;
  }
}

/* ---------------- journey replays ---------------- */
.h-teal {
  --hue: var(--teal);
}
.h-violet {
  --hue: var(--violet);
}
.h-blue {
  --hue: var(--blue);
}
.h-amber {
  --hue: var(--amber);
}
.h-pink {
  --hue: var(--pink);
}
.h-cyan {
  --hue: var(--cyan);
}
.h-green {
  --hue: #3fa34d;
}
.rp-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: color-mix(in srgb, var(--hue) 65%, var(--ink));
  background: color-mix(in srgb, var(--hue) 14%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--hue) 40%, transparent);
  white-space: nowrap;
  margin: 1px 0;
}
.rp-patterns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
button.rp-pattern,
button.rp-pattern:not(.ghost):not(.back) {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--r);
  color: var(--ink);
  background: linear-gradient(160deg, color-mix(in srgb, var(--hue) 14%, var(--panel)), var(--panel) 70%);
  border: 1px solid color-mix(in srgb, var(--hue) 35%, var(--line));
  border-left: 5px solid var(--hue);
  font-weight: 400;
  cursor: pointer;
}
button.rp-pattern.on {
  box-shadow: 0 0 0 2px var(--hue);
}
button.rp-pattern.off {
  opacity: 0.55;
}
.rp-p-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.rp-p-n {
  font-size: 22px;
  font-weight: 800;
  color: color-mix(in srgb, var(--hue) 70%, var(--ink));
}
.rp-p-better {
  font-size: 13px;
}
.rp-thresholds summary {
  cursor: pointer;
}
.rp-player {
  padding: 12px;
}
.rp-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.rp-scrub {
  flex: 1 1 200px;
  accent-color: var(--violet);
}
.rp-track {
  overflow-x: auto;
  border-radius: 10px;
  outline-offset: 2px;
}
.rp-tick line {
  stroke: var(--line);
  stroke-dasharray: 2 3;
}
.rp-tick text {
  fill: var(--muted);
  font-size: 10.5px;
}
.rp-gap {
  fill: #b45309;
  font-weight: 700;
}
.rp-gap-long {
  fill: var(--bad);
  font-weight: 800;
}
.rp-head {
  stroke: var(--violet);
  stroke-width: 2.5;
  transition: all 0.25s ease;
}
.rp-dot {
  cursor: pointer;
  transition: opacity 0.25s ease;
}
.rp-dot circle {
  fill: color-mix(in srgb, var(--accent) 80%, var(--panel));
  stroke: var(--panel);
  stroke-width: 2;
}
.rp-dot.inferred circle {
  fill: color-mix(in srgb, var(--amber) 75%, var(--panel));
}
.rp-dot.live circle {
  fill: var(--blue);
}
.rp-dot.dated circle {
  fill: var(--panel);
  stroke: var(--muted);
  stroke-dasharray: 2 2;
}
.rp-dot.stall circle {
  fill: var(--bad-soft);
  stroke: var(--bad);
}
.rp-dot.lesson path {
  fill: var(--hue);
  stroke: var(--panel);
  stroke-width: 2;
}
.rp-dot text {
  fill: #fff;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}
.rp-dot.stall text {
  fill: var(--bad);
  font-size: 8.5px;
}
.rp-dot text.rp-dot-label {
  fill: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
}
.rp-dot.future {
  opacity: 0.22;
}
.rp-dot.now circle,
.rp-dot.now path {
  stroke: var(--ink);
  stroke-width: 2.5;
}
.rp-dot.now text.rp-dot-label {
  fill: var(--ink);
}
.rp-frame {
  margin-top: 10px;
  min-height: 84px;
}
.rp-now {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r);
  background: color-mix(in srgb, var(--hue, var(--accent)) 10%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--hue, var(--accent)) 35%, var(--line));
  border-left: 5px solid var(--hue, var(--accent));
}
.rp-now.stall {
  --hue: var(--bad);
}
.rp-now p {
  margin: 4px 0 0;
}
.rp-day {
  min-width: 92px;
  font-size: 20px;
  font-weight: 800;
  color: color-mix(in srgb, var(--hue, var(--accent)) 70%, var(--ink));
}
.rp-day span {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}
.rp-better {
  color: var(--ink);
}
.rp-split {
  grid-template-columns: 3fr 2fr;
}
.rp-lessons {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.rp-lessons li {
  padding: 10px 12px;
  border-radius: 10px;
  border-left: 4px solid var(--hue);
  background: color-mix(in srgb, var(--hue) 7%, var(--panel));
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.rp-lessons li.reached {
  opacity: 1;
}
.rp-lessons p {
  margin: 4px 0 0;
}
.rp-l-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
@media (max-width: 980px) {
  .rp-split {
    grid-template-columns: 1fr;
  }
  .rp-day {
    min-width: 70px;
    font-size: 17px;
  }
}
.rp-svg {
  max-width: none;
  width: auto;
  height: auto;
}
.rp-controls label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

/* ---------- journey workflow: one coloured card per question ---------- */
.jm-step.jm-device rect {
  stroke-width: 2.6;
}
.jm-legend .sw.dev {
  background: color-mix(in srgb, var(--amber) 18%, var(--panel));
  border: 2.6px solid var(--amber);
}
.wf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.wf-card {
  border-top: 4px solid var(--hue);
  background: linear-gradient(180deg, color-mix(in srgb, var(--hue) 7%, var(--panel)), var(--panel) 70px);
}
.wf-card h2 {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.wf-card[data-key='exits'],
.wf-card[data-key='steps'],
.wf-actions {
  grid-column: 1 / -1;
}
.wf-choices,
.wf-rules {
  display: grid;
  gap: 8px;
}
.wf-rules {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.wf-choice,
.wf-rule,
.wf-switch {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
}
.wf-choice:has(input:checked),
.wf-rule:has(input:checked),
.wf-switch:has(input:checked) {
  border-color: var(--hue);
  background: color-mix(in srgb, var(--hue) 12%, var(--panel));
}
.wf-rule .mono {
  font-weight: 700;
  color: color-mix(in srgb, var(--hue) 70%, var(--ink));
  min-width: 2.4em;
}
.wf-table {
  overflow-x: auto;
}
.wf-table td,
.wf-table th {
  text-align: center;
}
.wf-table td:first-child,
.wf-table th:first-child {
  text-align: left;
}
.wf-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.wf-step {
  display: flex;
  gap: 8px;
  align-items: center;
}
.wf-step input[name^='label:'] {
  flex: 1;
  min-width: 0;
}
.wf-actions {
  display: flex;
  gap: 10px;
}
