/* Infinet Hub staff screens. Brand colours and fonts match the directors' deck. */
:root {
  --ink: #0f1623;
  --ink-2: #3d4757;
  --muted: #5f6a7a;
  --line: #e3e8ef;
  --bg: #f3f6fa;
  --card: #ffffff;
  --night: #0b0d12;
  --night-2: #151a24;
  --night-ink: #a9b4c2;
  --green: #1fa971;
  --teal: #1e9bb0;
  --blue: #2563eb;
  --blue-soft: #e8efff;
  --green-soft: #e3f6ee;
  --amber: #b7791f;
  --amber-soft: #fdf3e1;
  --red: #c53030;
  --red-soft: #fdecec;
  --grey-soft: #eef1f5;
  --hover: #f7f9fc;
  --subtle: #fbfcfe;
  --line-strong: #c6cfdb;
  --input-line: #ccd5e1;
  --red-line: #f2c4c4;
  --green-ink: #137a50;
  --blue-ink: #1d4fc4;
  --amber-ink: #94600f;
  --ok-ink: #0f5c3c;
  --warn-ink: #8c1d1d;
  --info-ink: #173f9c;
  /* Text on an --ink background (the dark chip, numbered steps). */
  --on-ink: #ffffff;
  /* Keyboard focus ring: dark blue on light pages, light blue on dark ones. */
  --focus: #2563eb;
  /* Solid fills under white text (done buttons, step numbers). */
  --green-solid: #15855a;
  color-scheme: light;
  --brand: linear-gradient(90deg, #22b573, #1e9bb0 50%, #2563eb);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 22, 35, 0.05), 0 4px 16px rgba(15, 22, 35, 0.06);
  --head: "Space Grotesk", "Segoe UI", Arial, sans-serif;
  --body: "DM Sans", "Segoe UI", Arial, sans-serif;
}

/* Dark mode: follows the system setting unless the person picks light or
   dark with the switch in the sidebar (stored per browser as data-theme). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --ink: #e7ecf3;
  --ink-2: #c2cbd8;
  --muted: #8f9bad;
  --line: #262f40;
  --bg: #0d1118;
  --card: #151b26;
  --night: #080a0e;
  --night-2: #151a24;
  --blue: #7aa2ff;
  --blue-soft: #17244a;
  --green-soft: #10302a;
  --amber: #e0a84a;
  --amber-soft: #33280f;
  --red: #f08080;
  --red-soft: #3a1818;
  --grey-soft: #1d2431;
  --hover: #1b2230;
  --subtle: #121823;
  --line-strong: #3a4558;
  --input-line: #334055;
  --red-line: #5c2a2a;
  --green-ink: #6fd8a8;
  --blue-ink: #a3bdff;
  --amber-ink: #ecc078;
  --ok-ink: #95e3c0;
  --warn-ink: #f5aaaa;
  --info-ink: #b2c8ff;
  --on-ink: #0d1118;
  --focus: #93b4ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e7ecf3;
  --ink-2: #c2cbd8;
  --muted: #8f9bad;
  --line: #262f40;
  --bg: #0d1118;
  --card: #151b26;
  --night: #080a0e;
  --night-2: #151a24;
  --blue: #7aa2ff;
  --blue-soft: #17244a;
  --green-soft: #10302a;
  --amber: #e0a84a;
  --amber-soft: #33280f;
  --red: #f08080;
  --red-soft: #3a1818;
  --grey-soft: #1d2431;
  --hover: #1b2230;
  --subtle: #121823;
  --line-strong: #3a4558;
  --input-line: #334055;
  --red-line: #5c2a2a;
  --green-ink: #6fd8a8;
  --blue-ink: #a3bdff;
  --amber-ink: #ecc078;
  --ok-ink: #95e3c0;
  --warn-ink: #f5aaaa;
  --info-ink: #b2c8ff;
  --on-ink: #0d1118;
  --focus: #93b4ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--head); color: var(--ink); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* Shell */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.side {
  background: var(--night);
  color: var(--night-ink);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  z-index: 10;
  top: 0;
  height: 100vh;
}
/* The sidebar and hero banner are dark in both themes. */
.side, .banner.hero { --focus: #93b4ff; }
.side .logo { display: block; padding: 4px 8px 0; }
.side .logo img { width: 100%; max-width: 210px; height: auto; display: block; }
.side .product {
  margin: 10px 8px 0;
  font: 600 12px/1 var(--head);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8592a5;
}
/* Customer finder */
.finder { position: relative; }
.finder > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: #6d7a8c; pointer-events: none; }
.finder input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 0 14px 0 40px;
  border-radius: 11px;
  border: 1px solid #262e3d;
  background: var(--night-2);
  color: #fff;
  font: 15px var(--body);
}
.finder input::placeholder { color: #7d8a9c; }
.finder input[type="text"]:focus { outline: none; border-color: #3b6fe0; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25); }
.finder ul {
  position: absolute;
  z-index: 20;
  left: 0;
  top: calc(100% + 8px);
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 360px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(11, 13, 18, 0.28);
  overscroll-behavior: contain;
}
.finder li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-radius: 8px; color: var(--ink); font-size: 15px; font-weight: 500; cursor: pointer; }
.finder li[aria-selected="true"], .finder li:hover { background: var(--blue-soft); }
.finder li.none { color: var(--muted); cursor: default; background: none; }

.nav { display: flex; flex-direction: column; gap: 4px; }
/* On short screens the menu scrolls, so the last links and Sign out stay
   reachable. The side padding keeps the current page's marker in view. */
@media (min-width: 861px) {
  .side .nav { min-height: 0; overflow-y: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: thin; scrollbar-color: #2b3445 transparent; }
}
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--night-ink);
  font-weight: 500;
  font-size: 15.5px;
  position: relative;
}
.nav a:hover { background: var(--night-2); color: #fff; text-decoration: none; }
.nav a.on { background: var(--night-2); color: #fff; }
.nav a.on::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--brand);
}
.nav svg { width: 20px; height: 20px; flex: none; }
.nav .count {
  margin-left: auto;
  background: #2b3445;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 9px;
}
.nav a.on .count, .nav .count.hot { background: #2563eb; }
.side .me {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--night-2);
  font-size: 14px;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font: 700 14px var(--head);
  flex: none;
}
.me b { color: #fff; display: block; font-weight: 600; }

.main { padding: 34px 40px 60px; min-width: 0; max-width: 1320px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.top .sub { color: var(--muted); margin-top: 6px; font-size: 16px; }
.crumb { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumb a { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: 600 15px var(--body);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; background: var(--hover); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { border: 0; color: #fff; background: var(--brand); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.done { border: 0; color: #fff; background: var(--green-solid); }
.btn.done:hover { background: #116d4a; }
.btn.danger { color: var(--red); border-color: var(--red-line); }
.btn.danger:hover { background: var(--red-soft); }
.btn.big { min-height: 54px; padding: 0 28px; font-size: 16.5px; border-radius: 13px; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }

/* Tick boxes laid out as cards, e.g. a user's groups */
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pick { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.pick input { flex: none; width: 22px; height: 22px; accent-color: var(--blue); }
.pick small { display: block; color: var(--muted); font-size: 13px; }
.pick:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
/* A list in ring order, one per row, with arrows to move people up and down */
.picks.ordered { grid-template-columns: 1fr; counter-reset: ring; }
.pick-row { display: flex; align-items: center; gap: 8px; }
.pick-row .pick { flex: 1; }
.pick-row .pick:has(input:checked) b::before { counter-increment: ring; content: counter(ring) ". "; color: var(--blue); }
.order-btns { display: flex; gap: 4px; }
.order-btns .icon-btn { width: 44px; height: 44px; font-size: 18px; }
.order-btns .icon-btn:hover { color: var(--blue); border-color: var(--blue); background: var(--blue-soft); }
.btn.quiet { border-color: transparent; background: none; color: var(--muted); box-shadow: none; }
.btn.quiet:hover { color: var(--ink); background: var(--hover); }

/* Cards and grid */
.grid { display: grid; gap: 20px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; min-width: 0; }
.card > header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.card > header p { color: var(--muted); font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* Stat tiles */
.tile { position: relative; overflow: hidden; }
.tile .label { color: var(--muted); font-size: 14.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.tile .num { font: 700 40px/1.1 var(--head); margin-top: 10px; letter-spacing: -0.02em; }
.tile .note { color: var(--muted); font-size: 14px; margin-top: 6px; }
.tile .ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
}
.tile .ico svg { width: 18px; height: 18px; }
.tile.green .ico { background: var(--green-soft); color: var(--green); }
.tile.amber .ico { background: var(--amber-soft); color: var(--amber); }
.tile.brand::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--brand); }

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live { background: var(--green-soft); color: var(--green-ink); }
.pill.onboarding { background: var(--blue-soft); color: var(--blue-ink); }
.pill.locked { background: var(--red-soft); color: var(--red); }
.pill.cancelled { background: var(--grey-soft); color: var(--muted); }
.pill.api { background: var(--green-soft); color: var(--green-ink); }
.pill.manual { background: var(--amber-soft); color: var(--amber-ink); }
.pill.plain::before { display: none; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 14px 10px;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.link { cursor: pointer; }
.table tbody tr.link:hover td { background: var(--hover); }
.table .r { text-align: right; }
.table .name { font-weight: 600; color: var(--ink); }
.table .faint { color: var(--muted); font-size: 14px; }
.scroll { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.list > li:first-child { padding-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; }
.list .meta { color: var(--muted); font-size: 14px; }
.dot-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--amber-soft);
  color: var(--amber);
}
.dot-ico svg { width: 20px; height: 20px; }
.dot-ico.blue { background: var(--blue-soft); color: var(--blue); }
.dot-ico.green { background: var(--green-soft); color: var(--green); }
.dot-ico.amber { background: var(--amber-soft); color: var(--amber); }
.more-row { display: flex; justify-content: center; padding: 18px 0 6px; }

/* Progress */
.bar { height: 8px; border-radius: 99px; background: var(--grey-soft); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

/* Banners */
.banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  font-size: 15.5px;
}
.banner svg { width: 26px; height: 26px; flex: none; }
.banner b { font-family: var(--head); font-size: 17px; display: block; }
.banner.ok { background: var(--green-soft); color: var(--ok-ink); }
.banner.warn { background: var(--red-soft); color: var(--warn-ink); }
.banner.info { background: var(--blue-soft); color: var(--info-ink); }
.banner.hero { background: var(--night); color: #dfe7f1; position: relative; overflow: hidden; padding: 26px 28px; }
.banner.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--brand); }
.banner.hero b { color: #fff; font-size: 21px; }
.banner.hero h1 { color: #fff; font-size: 21px; line-height: 1.3; }
.banner .stats { display: flex; gap: 26px; margin-left: auto; flex-wrap: wrap; }
.banner .stats div { text-align: center; }
.banner .stats strong { display: block; font: 700 30px/1 var(--head); color: #fff; }
.banner .stats span { font-size: 13px; color: var(--night-ink); }

/* Build sheets */
.sheet { display: flex; flex-direction: column; gap: 14px; }
.sheet .who { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.sheet h3 { font-size: 18px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-2); }
.steps li::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 5px;
  border: 2px solid var(--line-strong);
}
.sheet footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 6px; }
.age { font-size: 13.5px; color: var(--muted); }
.age.old { color: var(--amber-ink); font-weight: 600; }

/* Engineer jobs: one panel per customer, jobs in plan order */
.job { padding: 0; overflow: hidden; }
.job-head { display: flex; align-items: center; gap: 24px; padding: 22px 24px; margin: 0 !important; border-bottom: 1px solid var(--line); background: var(--subtle); flex-wrap: wrap; }
.job-head h2 a { color: var(--ink); }
.job-head .meta { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.job-progress { width: 260px; display: flex; flex-direction: column; gap: 8px; }
.job-group { padding: 18px 24px 6px; }
.job-group + .job-group { border-top: 1px dashed var(--line); }
.job-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-2); margin-bottom: 4px; }
.jobs { list-style: none; margin: 0; padding: 0; }
.job-row { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.job-group .job-row:last-child { border-bottom: 0; }
.job-row .title { font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.job-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue-ink); font: 700 14px var(--head); flex: none; }
.job-row form { flex: none; }
.flow-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 8px; }
.flow-swap { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); }
.flow-swap.highlight { border-color: var(--amber); background: var(--amber-soft); }
.flow-swap input[hidden] { display: none; }
.job-actions { flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }

/* Call flow */
.flow { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.flow li { padding: 7px 0 7px 14px; border-left: 2px solid var(--line); color: var(--ink-2); }
.flow li.branch { color: var(--muted); font-size: 13.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border-left-color: transparent; padding-top: 12px; }

/* Key facts */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; font-size: 15px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }

/* Search and filters */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search input[type="search"] { padding-left: 42px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.chip:hover { text-decoration: none; border-color: var(--line-strong); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

/* Forms */
label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; color: var(--ink); }
.hint { font-weight: 400; color: var(--muted); font-size: 13.5px; }
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--input-line);
  background: var(--card);
  font: 16px var(--body);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.3); }
.field { min-width: 0; }
.field.wide { grid-column: span 2; }
.fields { display: grid; gap: 16px; }
.fields.f2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields.f3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-ink);
  display: grid;
  place-items: center;
  font: 700 15px var(--head);
  flex: none;
}
.step-head p { color: var(--muted); font-size: 14.5px; }

.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.choice { position: relative; display: block; margin: 0; cursor: pointer; font-weight: 400; }
.choice input { position: absolute; opacity: 0; }
.choice .box { display: block; height: 100%; padding: 18px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); transition: border-color 0.15s, box-shadow 0.15s; }
.choice .box:hover { border-color: var(--line-strong); }
.choice input:checked + .box { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }
.choice input:focus-visible + .box { outline: 3px solid var(--focus); }
.choice .box strong { display: block; font: 600 17px var(--head); margin: 10px 0 4px; }
.choice .box span { color: var(--muted); font-size: 14px; display: block; }
.choice .box .glyph { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.choice .box .glyph svg { width: 22px; height: 22px; }

.rows { display: flex; flex-direction: column; gap: 10px; }
.row { display: grid; grid-template-columns: 1.3fr 1.5fr 0.6fr 0.8fr 44px; gap: 10px; align-items: center; }
.row.num { grid-template-columns: 1.3fr 0.9fr 1fr 1fr 44px; }
.row-head { display: grid; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.icon-btn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { color: var(--red); border-color: var(--red-line); background: var(--red-soft); }
.icon-btn svg { width: 18px; height: 18px; }
.add { margin-top: 12px; }
.form-foot { display: flex; justify-content: flex-end; gap: 12px; align-items: center; padding-top: 4px; }
.errors { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.only-port, .only-sole { display: none; }
form[data-template="sole-trader"] .only-sole { display: block; }
form[data-template="sole-trader"] .not-sole { display: none; }

/* Chart */
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 11px var(--body); }
.chart .bar-mark { fill: var(--blue); }
.chart .hit:hover + .bar-mark, .chart .bar-mark:hover { fill: var(--blue-ink); }
.legend-num { font: 700 28px var(--head); }

/* Call quality */
.bands { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.bands li { display: grid; grid-template-columns: 96px 1fr 40px; align-items: center; gap: 14px; }
.bands b { text-align: right; font-family: var(--head); }
.bands .bar { height: 12px; }
.bar > span.tone-live { background: var(--green); }
.bar > span.tone-manual { background: #d69e2e; }
.bar > span.tone-locked { background: var(--red); }
.gos-verdict { display: flex; gap: 14px; padding: 16px 18px; border-radius: 12px; font-size: 15px; }
.gos-verdict svg { width: 24px; height: 24px; flex: none; }
.gos-verdict > div > b:first-child { display: block; font-family: var(--head); font-size: 16.5px; margin-bottom: 2px; }
.gos-verdict.ok { background: var(--green-soft); color: var(--ok-ink); }
.gos-verdict.warn { background: var(--amber-soft); color: var(--amber-ink); }
.chart .bar-lost { fill: var(--red); }
.chart .bar-mark.busy { fill: #1d4fc4; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: var(--blue); }
.sw.lost, .sw.err { background: var(--red); }
.sw.busy { background: #1d4fc4; }
.sw.req { background: var(--blue); }
.sw.prov { background: #8a96a8; }
.sw.ok { background: var(--green); }
.upload .drop { display: flex; align-items: center; gap: 14px; padding: 22px; border: 2px dashed #c6cfdb; border-radius: 14px; cursor: pointer; font-weight: 400; color: var(--ink-2); background: var(--subtle); margin: 0; }
.upload .drop:hover, .upload.over .drop { border-color: var(--blue); background: var(--blue-soft); }
.upload .drop svg { width: 26px; height: 26px; color: var(--blue); flex: none; }
.upload .drop b { display: block; color: var(--ink); font-size: 16px; }

/* Call flow ladder */
.ladder-card { padding: 18px 0; }
.ladder-card .legend { padding: 0 24px; }
.ladder-scroll { overflow-x: auto; padding: 0 12px; }
.ladder { display: block; font-family: var(--body); }
.ladder .lane-head { fill: var(--night); }
.ladder .lane-name { fill: #fff; font: 600 13px var(--head); }
.ladder .lane-addr { fill: #8a96a8; font: 11px ui-monospace, Consolas, monospace; }
.ladder .lifeline { stroke: #c6cfdb; stroke-width: 2; stroke-dasharray: 4 5; }
.ladder .row-hit { fill: transparent; }
.ladder .flow-row:hover .row-hit { fill: var(--hover); }
.ladder .t { fill: var(--muted); font: 11.5px ui-monospace, Consolas, monospace; }
.ladder .msg { font: 600 13px var(--body); fill: var(--ink); }
.ladder .arrow { stroke-width: 2; }
.ladder .req .arrow { stroke: var(--blue); }
.ladder .prov .arrow { stroke: #8a96a8; stroke-dasharray: 5 4; }
.ladder .ok .arrow { stroke: var(--green); }
.ladder .err .arrow { stroke: var(--red); }
.ladder .err .msg { fill: var(--red); }
.ladder .head.req { fill: var(--blue); }
.ladder .head.prov { fill: #8a96a8; }
.ladder .head.ok { fill: var(--green); }
.ladder .head.err { fill: var(--red); }
.messages { display: flex; flex-direction: column; gap: 8px; }
.msg-detail { border: 1px solid var(--line); border-radius: 10px; }
.msg-detail summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; flex-wrap: wrap; }
.msg-detail[open] summary { border-bottom: 1px solid var(--line); }
.msg-detail:target { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }
.msg-detail pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; background: #0f1623; color: #d4dbe4; border-radius: 0 0 10px 10px; white-space: pre; }
.msg-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 12.5px var(--head); color: #fff; background: #2563eb; flex: none; }
.msg-n.prov { background: #667386; }
.msg-n.ok { background: var(--green-solid); }
.msg-n.err { background: #c53030; }

.empty { text-align: center; padding: 34px 10px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--green); margin-bottom: 8px; }
.empty b, .empty h1 { display: block; color: var(--ink); font: 600 18px var(--head); margin-bottom: 4px; }

.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }
.right { margin-left: auto; }
.mt { margin-top: 20px; }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .g-wide { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; min-width: 0; }
  .side > * { min-width: 0; }
  .side .logo img { max-width: 130px; }
  .side .product { display: none; }
  /* Signed-in name and sign out stay reachable on phones, in one slim row. */
  .side .me { margin-top: 0; padding: 6px 10px; width: 100%; }
  .finder { flex: 1; min-width: 180px; }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; max-width: 100%; }
  .theme { width: 100%; }
  .nav a { padding: 9px 12px; white-space: nowrap; }
  .nav a.on::before { display: none; }
  .main { padding: 22px 16px 48px; }
  .g2, .choices, .fields.f2, .fields.f3 { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .job-progress { width: 100%; }
  .job-row { flex-wrap: wrap; }
  .job-row form { margin-left: 46px; }
  .job-actions { margin-left: 46px; flex-direction: row; }
  .job-actions form { margin-left: 0; }
  .row, .row.num { grid-template-columns: 1fr 1fr; }
  .row-head { display: none; }
  h1 { font-size: 25px; }
  .banner { flex-wrap: wrap; }
  .banner .stats { margin-left: 0; }
  /* Thumb-sized sidebar controls on phones. */
  .theme button { min-height: 40px; }
  .signout { min-height: 40px; padding: 6px 12px; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr; }
}

/* Theme switch */
.theme { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--night-2); }
.theme button { flex: 1; border: 0; border-radius: 7px; padding: 6px 0; background: transparent; color: var(--night-ink); font: 600 12px var(--body); cursor: pointer; }
.theme button:hover { color: #fff; }
.theme button[aria-pressed="true"] { background: #2b3445; color: #fff; }

/* Signed-in person and sign out */
.me a { color: inherit; }
.me form { margin-left: auto; }
.signout { border: 0; background: transparent; color: var(--night-ink); font: 600 12px var(--body); cursor: pointer; padding: 6px; border-radius: 6px; }
.signout:hover { color: #fff; background: var(--night-2); }

/* Sign-in and password pages */
body.bare { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 20px; }
.gate-logo { width: 180px; height: auto; align-self: center; }
.gate .card { padding: 28px; }
.gate h1 { font-size: 24px; margin-bottom: 6px; }
.gate .stack { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.gate .links { display: flex; justify-content: space-between; font-size: 14px; }
.qr { background: #fff; border-radius: 12px; padding: 12px; width: 220px; margin: 0 auto; }
.qr svg { display: block; width: 100%; height: auto; }
.secret { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.08em; word-break: break-all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-family: ui-monospace, Consolas, monospace; font-size: 16px; }

/* Access table on the Team and Settings pages */
.access td select { width: auto; min-width: 140px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Billing */
.month-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.month-nav h2 { font-size: 22px; min-width: 170px; text-align: center; }
input.money { width: 110px; text-align: right; min-height: 40px; padding: 6px 10px; }
.invoice { padding: 34px 38px; }
.inv-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 22px; border-bottom: 3px solid transparent; border-image: var(--brand) 1; margin-bottom: 22px; }
.inv-head img { width: 180px; height: auto; border-radius: 10px; }
.inv-head h2 { font-size: 30px; letter-spacing: 0.02em; }
.inv-parties { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; font-size: 15px; line-height: 1.6; margin-bottom: 26px; }
.inv-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.inv-lines tfoot td { border-bottom: 0; padding-top: 8px; padding-bottom: 8px; }
.inv-lines tfoot tr:first-child td { border-top: 1px solid var(--line); padding-top: 16px; }
.inv-lines .inv-total td { font: 700 19px var(--head); border-top: 2px solid var(--ink); }
.inv-group td { font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--subtle); }
@media (max-width: 860px) {
  .invoice { padding: 22px 18px; }
  .invoice .scroll { margin: 0 -18px; padding: 0 18px; }
  .inv-parties { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .inv-lines th, .inv-lines td { padding-left: 8px; padding-right: 8px; }
}
@media print {
  /* Paper is white whatever the screen theme. */
  :root:not(#print) { --bg: #fff; --card: #fff; --ink: #0f1623; --ink-2: #3d4757; --muted: #6b7686; --line: #e3e8ef; --subtle: #fbfcfe; --hover: #f7f9fc; }
  body { background: #fff; }
  .side, .no-print, .finder { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .grid.g-wide { display: block; }
  .card.invoice { box-shadow: none; padding: 0; }
  .inv-head img { filter: none; }
}
.warn-text { color: var(--red); font-weight: 600; }

/* Directors' report */
.section-title { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 26px 0 12px; }
.print-only { display: none; }
.report-head { align-items: center; gap: 24px; margin-bottom: 10px; }
.report-head img { width: 160px; height: auto; border-radius: 8px; }
.chart .axis.value { fill: var(--ink); font-weight: 700; font-size: 12px; }
@media print {
  .print-only { display: flex; }
  .report-charts { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .card { break-inside: avoid; }
  .tile .num { font-size: 30px; }
}

/* Installs diary */
.diary-card { padding: 14px; }
.diary { width: 100%; border-collapse: separate; border-spacing: 6px; min-width: 760px; }
.diary th { font: 600 13px var(--head); color: var(--muted); text-align: left; padding: 4px 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.diary tbody th { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); width: 150px; vertical-align: middle; }
.diary th.today { color: var(--blue); }
.diary td { vertical-align: top; padding: 0; }
.diary td.today { background: var(--blue-soft); border-radius: 12px; padding: 4px; }
.diary tr.me th { color: var(--blue); }
.slot { display: flex; flex-direction: column; gap: 1px; min-height: 64px; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; margin-bottom: 6px; border: 1px solid var(--line); color: var(--ink-2); }
.slot:last-child { margin-bottom: 0; }
.slot:hover { text-decoration: none; }
.slot b { color: var(--ink); font-size: 14px; line-height: 1.25; }
.slot .slot-time { font: 700 11px var(--head); letter-spacing: 0.08em; color: var(--muted); }
.slot.booked { background: var(--card); border-color: var(--blue); box-shadow: inset 4px 0 0 var(--blue); }
.slot.done { background: var(--green-soft); border-color: transparent; box-shadow: inset 4px 0 0 var(--green); }
.slot.free { border-style: dashed; color: var(--muted); }
.slot.free:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.slot.empty { border-color: transparent; background: var(--subtle); color: var(--muted); }

/* Number ports */
.ports .list > li.port { align-items: flex-start; }
.port-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form input[type="date"], .inline-form input[type="text"] { min-height: 36px; padding: 4px 10px; width: auto; font-size: 14px; }
.inline-form input[type="text"] { min-width: min(260px, 100%); }
.inline-reject { display: flex; }
.inline-reject[open] { flex-basis: 100%; flex-direction: column; gap: 8px; }
.inline-reject summary { list-style: none; }
.inline-reject summary::-webkit-details-marker { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Call record sync status */
.sync-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14.5px; color: var(--muted); margin: -6px 0 18px; }
.sync-line svg { width: 18px; height: 18px; flex: none; }
.sync-line.warn { color: var(--amber); }
.sync-line form { margin-left: auto; }
.struck { text-decoration: line-through; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
label.check input { width: 20px; height: 20px; accent-color: var(--red); }

/* Faults */
.due { font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.due.soon { color: var(--amber); }
.due.late { color: var(--red); }
.due.ok { color: var(--green); }
.choices.cats .box { min-height: 92px; }
.choices.cats .box strong { margin-top: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--blue); }
.timeline li.status::before { border-color: var(--green); background: var(--green); }
.timeline li.assign::before, .timeline li.priority::before { border-color: var(--muted); }
.timeline li.status > div:last-child, .timeline li.assign > div:last-child, .timeline li.priority > div:last-child { font-weight: 600; }

/* Portal access card on a customer's page */
.dot-ico.grey { background: var(--grey-soft); color: var(--muted); }
.contacts .list > li.contact { align-items: flex-start; }
.contacts li.off .title, .contacts li.off .meta { color: var(--muted); }
.contacts .pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.contacts .inline-form select { min-height: 36px; padding: 4px 10px; width: auto; font-size: 14px; }
.add-contact { margin-top: 18px; }
.add-contact summary { list-style: none; display: inline-flex; }
.add-contact summary::-webkit-details-marker { display: none; }
.add-contact[open] summary { margin-bottom: 16px; }

/* Month-end checklist */
.month-end { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.me-step { display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-left: 4px solid transparent; }
.me-step h2 { font-size: 17px; margin-bottom: 2px; }
.me-step p { font-size: 14.5px; }
.me-step.next { border-left-color: var(--blue); }
.me-step.attention { border-left-color: var(--amber); }
.me-step.done { opacity: 0.75; }
.me-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 700 15px var(--head); background: var(--blue-soft); color: var(--blue-ink); }
.me-num svg { width: 18px; height: 18px; }
.me-step.done .me-num { background: var(--green-soft); color: var(--green-ink); }
.me-step.attention .me-num { background: var(--amber-soft); color: var(--amber-ink); }
.me-step form, .me-step > a { flex: none; }
@media (max-width: 860px) { .me-step { flex-wrap: wrap; } .me-step form, .me-step > a { margin-left: 52px; } }
.me-step .grow { flex: 1; min-width: 0; }
.edit-contact { margin-top: 10px; }
.edit-contact summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 14px; width: fit-content; }
.edit-contact[open] summary { margin-bottom: 8px; }
.edit-contact .inline-form input[type="email"] { min-height: 36px; padding: 4px 10px; width: auto; min-width: min(260px, 100%); font-size: 14px; }
.edit-contact .hint { display: block; margin-top: 6px; }


/* Customer health */
.health-tile:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--blue); }
.health-tile.risk .ico { background: var(--red-soft); color: var(--red); }
.health-row { display: flex; gap: 22px; align-items: flex-start; border-left: 5px solid var(--green); }
.health-row.look { border-left-color: #d69e2e; }
.health-row.risk { border-left-color: var(--red); }
.health-row h2 { font-size: 18px; margin-bottom: 6px; }
.health-row h2 a { color: var(--ink); }
.health-score { width: 120px; flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.health-score b { font: 700 38px/1 var(--head); }
.reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.reasons li { display: flex; justify-content: space-between; gap: 14px; font-size: 15px; }
.reasons li a { color: var(--ink-2); }
@media (max-width: 860px) {
  .health-row { flex-direction: column; gap: 10px; }
  .health-score { flex-direction: row; align-items: center; width: auto; }
}
.health-row > .grow { flex: 1; min-width: 0; }
.reasons { max-width: 680px; }

/* Go-live */
a.go-live-banner { text-decoration: none; }
a.go-live-banner:hover { filter: brightness(1.03); }
a.go-live-banner .right svg { width: 22px; height: 22px; }
.go-live li form { flex: none; }

/* Sent messages */
.mt-lg { margin-top: 40px; }
.h1-sm { font-size: 24px; }
.nowrap { white-space: nowrap; }
.outbox td { vertical-align: top; }
.outbox .subject { min-width: 240px; }
.outbox .recipient { min-width: 200px; max-width: 260px; overflow-wrap: anywhere; }
.outbox-error { margin-top: 6px; max-width: 360px; color: var(--red); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.preview-subject { margin: 0 0 12px; font-size: 15px; overflow-wrap: anywhere; }
.previews { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.email-frame { display: block; width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 12px; background: #f3f6fa; }
.plain-text { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; }
.plain-text summary { padding: 12px 14px; cursor: pointer; font-weight: 600; }
.plain-text[open] summary { border-bottom: 1px solid var(--line); }
.plain-text pre { margin: 0; padding: 14px 16px; max-height: 320px; overflow: auto; font: 13px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-send { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 16px; }
.preview-send .btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; filter: grayscale(0.6); }

/* Weekly summary preview */
.email-preview iframe { width: 100%; height: 900px; border: 1px solid var(--line); border-radius: 12px; background: #f3f6fa; }

/* Possible toll fraud */
.card.fraud { border: 2px solid var(--red-line); }
.card.fraud h2 { display: flex; align-items: center; gap: 10px; color: var(--red); }
.card.fraud h2 svg { width: 24px; height: 24px; }
.dot-ico.red { background: var(--red-soft); color: var(--red); }
.fraud-alert { align-items: flex-start !important; flex-wrap: wrap; }
.fraud-alert .grow > div + div { margin-top: 4px; }
.fraud-alert .actions { flex-basis: 100%; padding-left: 54px; }
.dialled { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dialled span { background: var(--red-soft); color: var(--warn-ink); border-radius: 8px; padding: 3px 9px; font-size: 14px; }
@media (max-width: 700px) {
  .fraud-alert .actions { padding-left: 0; }
  .fraud-alert .actions form, .fraud-alert .actions .btn { flex: 1; width: 100%; }
}

/* Search */
.big-search { max-width: 720px; }
.big-search input[type="search"] { min-height: 54px; font-size: 17px; padding-left: 46px; }
.finder li.everything { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 12px; color: var(--blue); font-weight: 600; }
.finder li.everything .hint { color: var(--muted); font-weight: 400; font-size: 13px; }
.card h2 > svg { width: 20px; height: 20px; flex: none; color: var(--blue); }

/* Complaints */
.weeks { display: flex; flex-direction: column; gap: 6px; min-width: 120px; }
.weeks .bar { height: 6px; }
.weeks.soon .bar > span { background: var(--amber); }
.weeks.late .bar > span { background: var(--red); }
.list .weeks { margin-top: 8px; max-width: 240px; }
.table th.num, .table td.num { text-align: right; white-space: nowrap; }
.table td.cat { min-width: 200px; }
.table td.cat .bar { margin-top: 8px; max-width: 260px; }
.sub .weeks { flex: 0 0 200px; }
form.split { border-top: 1px solid var(--line); padding-top: 20px; }
.milestones { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.milestones li { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 14px 46px; border-radius: 12px; background: var(--subtle); border: 1px solid var(--line); position: relative; }
.milestones li::before { content: ""; position: absolute; left: 16px; top: 17px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--card); }
.milestones li b { font: 600 13px var(--head); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.milestones li span { font-size: 16.5px; font-weight: 600; color: var(--ink); }
.milestones li.done { background: var(--green-soft); border-color: transparent; }
.milestones li.done::before { background: var(--green); border-color: var(--green); }
.milestones li.next { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.milestones li.next::before { border-color: var(--blue); }
.milestones li.late { background: var(--red-soft); border-color: var(--red-line); }
.milestones li.late::before { background: var(--red); border-color: var(--red); }
.milestones li.late span { color: var(--warn-ink); }
.scheme { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; margin: 16px 0; border-radius: 12px; background: var(--blue-soft); border-left: 4px solid var(--blue); }
.scheme b { font: 600 18px var(--head); color: var(--ink); }
.scheme span { color: var(--info-ink); font-weight: 600; word-break: break-all; }
.letter { max-width: 760px; padding: 44px 52px; font-size: 16.5px; line-height: 1.6; }
.letter p { margin: 0 0 14px; }
.letter h2 { font-size: 22px; margin: 20px 0 14px; }
.letter .facts { margin-bottom: 22px; }
.letter-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 28px; }
.letter-head img { width: 170px; height: auto; border-radius: 8px; }
.oldest { display: flex; align-items: baseline; gap: 10px; }
.oldest .num { font: 700 52px/1 var(--head); color: var(--ink); }
.gate.wide { max-width: 760px; }
.code-page h2 { font-size: 19px; margin: 26px 0 8px; }
.code-page p, .code-page li { font-size: 16.5px; line-height: 1.6; color: var(--ink-2); }
.code-page ul { padding-left: 22px; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 6px; }
.code-page p { margin: 0 0 10px; }
@media (max-width: 860px) {
  .milestones { grid-template-columns: 1fr; }
  .letter { padding: 24px 18px; }
}
@media print {
  .card.letter { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .scheme { background: none; border: 1px solid #c6cfdb; }
}
/* Help pages, staff and portal: numbered steps that are easy to scan */
.help-toc .chip { font-weight: 500; }
.help-section { scroll-margin-top: 20px; }
.help-section > header { align-items: flex-start; }
.help-section h2 { display: flex; align-items: center; gap: 10px; font-size: 21px; }
.help-section > header p { font-size: 15.5px; margin-top: 4px; max-width: 70ch; }
.help-section h3 { margin: 22px 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.help-section > header + h3 { margin-top: 4px; }
.help-steps { list-style: none; margin: 0; padding: 0; counter-reset: help; display: flex; flex-direction: column; gap: 16px; max-width: 78ch; }
.help-steps > li { counter-increment: help; position: relative; padding-left: 44px; font-size: 16px; line-height: 1.55; min-height: 30px; }
.help-steps > li::before { content: counter(help); position: absolute; left: 0; top: -1px; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font: 700 14px var(--head); }
.help-steps a { font-weight: 600; }
.help-prio { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.help-prio > div { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: var(--subtle); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.help-prio .pill { align-self: flex-start; }
.help-prio b { font: 700 20px var(--head); color: var(--ink); }
.help-call { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 1100px) { .help-prio { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .help-toc { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .help-toc .chip { white-space: nowrap; }
  .help-section h2 { font-size: 19px; }
  .help-steps > li { font-size: 15.5px; }
}
@media (max-width: 520px) { .help-prio { grid-template-columns: 1fr; } }

/* In-depth guides: contents, guide pages, glossary, screenshots */
.help-search { max-width: 640px; }
.help-group { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 30px 0 12px; }
.help-cards, .help-starts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.help-card, .help-start { display: flex; align-items: center; gap: 14px; padding: 18px 20px; color: var(--ink); }
.help-card:hover, .help-start:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--blue), var(--shadow); }
.help-card .grow, .help-start .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.help-card b, .help-start b { font: 600 16.5px var(--head); }
.help-card .grow > span, .help-start .grow > span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.help-card > svg, .help-start > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.help-card-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); flex: none; }
.help-card-ico svg { width: 20px; height: 20px; }
.help-start { position: relative; overflow: hidden; }
.help-start::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); }
.help-start .help-card-ico { background: var(--green-soft); color: var(--green); }
.help-doc { max-width: 900px; }
.help-title { display: flex; align-items: center; gap: 12px; }
.help-title svg { width: 30px; height: 30px; color: var(--blue); flex: none; }
.help-glance { border-left: 4px solid transparent; border-image: var(--brand) 1; border-radius: 0 var(--radius) var(--radius) 0; }
.help-glance h2 { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.help-glance ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 16.5px; line-height: 1.5; }
.help-intro { color: var(--ink-2); margin: 0 0 14px; max-width: 75ch; line-height: 1.55; }
.help-detail { color: var(--ink-2); font-size: 15px; margin-top: 6px; line-height: 1.6; }
.help-detail ul { margin: 6px 0 0; padding-left: 18px; }
.help-detail li + li { margin-top: 3px; }
.help-next { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; line-height: 1.55; max-width: 78ch; }
.help-mistakes { display: flex; flex-direction: column; gap: 12px; }
.help-mistake { padding: 14px 16px; border-radius: 12px; background: var(--amber-soft); color: var(--ink); line-height: 1.55; }
.help-mistake > b { display: flex; align-items: flex-start; gap: 8px; color: var(--amber-ink); margin-bottom: 4px; }
.help-mistake > b svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.help-why { margin: 0; }
.help-why dt { font: 600 16.5px var(--head); margin-top: 18px; }
.help-why dt:first-child { margin-top: 0; }
.help-why dd { margin: 6px 0 0; color: var(--ink-2); line-height: 1.6; max-width: 78ch; }
.help-terms { margin: 0; }
.help-letter { font-size: 22px; color: var(--blue); margin: 28px 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); scroll-margin-top: 20px; }
.help-letter:first-child { margin-top: 0; }
.help-terms dt { font: 600 17px var(--head); margin-top: 16px; scroll-margin-top: 20px; }
.help-terms dt:target { color: var(--blue); }
.help-terms dt:target + dd { background: var(--blue-soft); border-radius: 8px; padding: 6px 10px; margin-left: -10px; }
.help-terms dd { margin: 4px 0 0; color: var(--ink-2); line-height: 1.6; max-width: 78ch; }
a.term { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: var(--blue); }
a.term:hover { color: var(--blue); }
.help-results .pill { margin-left: 6px; vertical-align: 2px; }
.help-results .meta { margin-top: 4px; line-height: 1.5; }
.shot { margin: 14px 0 4px; }
.shot-frame { display: block; position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: #fff; }
.shot-frame img { display: block; width: 100%; height: auto; }
.callout { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; background: #e0336e; color: #fff; font: 700 14px/28px var(--head); text-align: center; box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0, 0, 0, 0.35); }
.callout-key { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: key; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; color: var(--ink-2); }
.callout-key li { counter-increment: key; display: flex; gap: 10px; align-items: flex-start; }
.callout-key li::before { content: counter(key); flex: none; width: 22px; height: 22px; border-radius: 50%; background: #e0336e; color: #fff; font: 700 12px/22px var(--head); text-align: center; }
@media (max-width: 860px) {
  .help-cards, .help-starts { grid-template-columns: 1fr; }
  .help-title svg { width: 24px; height: 24px; }
  .help-steps > li .shot { margin-left: -44px; }
  .callout { width: 22px; height: 22px; font-size: 12px; line-height: 22px; box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, 0.35); }
}
.portal a.card.help-card, .portal a.card.help-start { display: flex; }
.portal .help-group { font-size: 13px; }
/* Contract summary (Ofcom GC C1): one sheet of A4 when printed */
.c1 { padding: 32px 36px; max-width: 1040px; }
.c1-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 16px; border-bottom: 3px solid transparent; border-image: var(--brand) 1; margin-bottom: 16px; }
/* The logo's lettering is white, so it sits on the night chip on screen and on paper. */
.c1-head img { width: 168px; height: auto; border-radius: 12px; background: var(--night); padding: 8px 12px; box-sizing: content-box; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.c1-head h2 { font-size: 28px; letter-spacing: 0.01em; }
.c1-meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.c1-draft { color: var(--amber-ink); }
.c1-intro { font-size: 15px; line-height: 1.55; color: var(--ink-2); margin: 0 0 16px; }
.c1-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; font-size: 15px; line-height: 1.55; padding: 14px 16px; border-radius: 12px; background: var(--subtle); border: 1px solid var(--line); margin-bottom: 20px; }
.c1-cols { columns: 2 420px; column-gap: 34px; }
.c1-sec { break-inside: avoid; margin: 0 0 18px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.c1-sec h3 { display: flex; align-items: center; gap: 10px; font: 700 17px var(--head); color: var(--ink); margin: 0 0 8px; }
.c1-n { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-ink); font-size: 13px; }
.c1-sec p { margin: 0 0 8px; }
.c1-sec ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.c1-sec b { color: var(--ink); }
.c1-price { width: 100%; border-collapse: collapse; margin: 0 0 10px; font-size: 14.5px; }
.c1-price td { padding: 6px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.c1-price td.r { text-align: right; white-space: nowrap; padding-left: 12px; }
.c1-price tfoot td { border-bottom: 0; padding: 4px 0; }
.c1-price .c1-total td { font: 700 17px var(--head); color: var(--ink); border-top: 2px solid var(--ink); padding-top: 8px; }
tr.current td { background: var(--blue-soft); }
@media (max-width: 640px) {
  .c1 { padding: 20px 18px; }
  .c1-head { flex-direction: column; align-items: flex-start; }
  .c1-parties { grid-template-columns: 1fr; }
}
@media print {
  @page { size: A4; margin: 10mm 11mm; }
  .card.c1 { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .c1 { font-size: 8.4pt; }
  .c1-head { padding-bottom: 6px; margin-bottom: 7px; }
  .c1-head img { width: 112px; padding: 5px 8px; filter: none; }
  .c1-head h2 { font-size: 17pt; }
  .c1-meta { font-size: 8pt; margin-top: 1px; }
  .c1-intro { font-size: 8.4pt; line-height: 1.35; margin-bottom: 7px; }
  .c1-parties { font-size: 8.4pt; line-height: 1.35; padding: 6px 9px; margin-bottom: 9px; background: #f6f8fb; gap: 10px; }
  .c1-parties .inv-label { font-size: 6.8pt; }
  .c1-cols { columns: 2; column-gap: 7mm; }
  .c1-sec { font-size: 8.2pt; line-height: 1.36; margin-bottom: 7px; }
  .c1-sec h3 { font-size: 10pt; margin-bottom: 3px; gap: 6px; }
  .c1-n, .c1-parties { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .c1-n { width: 16px; height: 16px; font-size: 7.5pt; background: #e8efff; color: #1d4fc4; }
  .c1-sec p { margin-bottom: 3px; }
  .c1-sec ul { gap: 1px; padding-left: 13px; }
  .c1-price { font-size: 8.2pt; margin-bottom: 4px; }
  .c1-price td { padding: 1.5px 0; }
  .c1-price .c1-total td { font-size: 9.5pt; padding-top: 3px; }
  .c1-draft { color: #94600f; }
}

/* Phone app layout: a slim top bar (logo, search, menu), the menu full
   screen when open, and the most-used places in a bar along the bottom. */
.menu-btn, .tabbar { display: none; }
@media (max-width: 860px) {
  .side { position: sticky; top: 0; z-index: 30; flex-wrap: nowrap; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
  .side .logo { padding: 0; flex: none; }
  .side .logo img { max-width: 92px; }
  .finder { min-width: 0; }
  .finder input[type="text"] { min-height: 42px; }
  body:not(.menu-open) .side > :is(.nav, .theme, .me) { display: none; }
  .menu-btn { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--night-2); color: #fff; cursor: pointer; }
  .menu-btn svg { width: 22px; height: 22px; }
  .menu-btn svg + svg, .menu-open .menu-btn svg:first-child { display: none; }
  .menu-open .menu-btn svg + svg { display: block; }

  body.menu-open { overflow: hidden; }
  .menu-open .side { position: fixed; inset: 0; height: 100dvh; flex-wrap: wrap; align-content: flex-start; overflow-y: auto; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .menu-open .side .nav { flex-direction: column; overflow: visible; gap: 2px; }
  .menu-open .side .nav a { padding: 13px 12px; font-size: 16.5px; }
  .menu-open .side .me { margin-top: 4px; }

  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--night); border-top: 1px solid #1f2735;
    padding: 4px 6px env(safe-area-inset-bottom);
  }
  .tabbar a, .tabbar button {
    flex: 1; min-width: 0; min-height: 58px; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    border: 0; background: none; color: #8f9bad; font: 600 11.5px var(--body); cursor: pointer;
  }
  .tabbar a:hover { text-decoration: none; color: #fff; }
  .tabbar svg { width: 23px; height: 23px; }
  .tabbar a.on { color: #fff; }
  .tabbar a.on svg { color: #6ea8ff; }
  .tabbar .badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; padding: 0 5px; border-radius: 999px; background: #2563eb; color: #fff; font: 700 11px/18px var(--body); text-align: center; }
  .menu-open .tabbar { display: none; }
}
@media print { .tabbar, .menu-btn { display: none !important; } }
