/* The 9series design system as the Delivery OS dashboard uses it. Tokens and component rules are copied
   from the system's tokens.css and components.css, so nothing loads from elsewhere. There is one theme:
   the system defines no dark one. dashboard.css loads before this file and holds the page layouts. */

:root {
  color-scheme: light;
  /* Colour: the ten brand colours and nothing else */
  --ns-blue: #045DE8;
  --ns-blue-bright: #297CFF;
  --ns-navy: #001E4D;
  --ns-ice: #F6F9FF;
  --ns-soft: #C6DAFA;
  --ns-text: #333333;
  --ns-body: #444444;
  --ns-muted: #6C6C6C;
  --ns-white: #FFFFFF;
  --ns-line: #E5E7EB;

  /* Gradients */
  --ns-grad-dark: radial-gradient(circle at 4% 12%, #297CFF 0%, #001E4D 100%);
  --ns-grad-blue: linear-gradient(90deg, #045DE8 0%, #297CFF 100%);

  /* Type */
  --ns-font: 'Lexend', Inter, system-ui, sans-serif;
  --ns-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Spacing */
  --ns-space-2: 8px; --ns-space-3: 12px; --ns-space-4: 16px; --ns-space-5: 20px;
  --ns-space-6: 24px; --ns-space-7: 28px; --ns-space-8: 32px; --ns-space-14: 56px; --ns-space-18: 72px;
  --ns-content-max: 1080px;

  /* Radius */
  --ns-radius-sm: 8px; --ns-radius-md: 12px; --ns-radius-lg: 14px; --ns-radius-xl: 16px; --ns-radius-pill: 999px;
  --ns-radius: 14px;

  /* Shadow: the one shadow */
  --ns-shadow-card: 0 4px 16px rgba(4, 93, 232, .06);

  /* Ten work type lines. Colour never works alone: lineWeight and lineDash in transit.js set each line apart. */
  --line-feature: var(--ns-blue);
  --line-bugfix: var(--ns-navy);
  --line-hotfix: var(--ns-blue);
  --line-refactor: var(--ns-navy);
  --line-migration: var(--ns-navy);
  --line-security_fix: var(--ns-navy);
  --line-review: var(--ns-blue-bright);
  --line-docs: var(--ns-blue-bright);
  --line-spike: var(--ns-blue-bright);
  --line-release: var(--ns-blue);
}

/* ---------------------------------------------------------------- base */

.od-theme, .od-theme body { background: var(--ns-white); color: var(--ns-body); }
.od-theme body { margin: 0; font: 400 16px/1.5 var(--ns-font); }
.od-theme button, .od-theme input, .od-theme select, .od-theme textarea { font-family: var(--ns-font); }
.od-theme :focus-visible { outline: 2px solid var(--ns-blue); outline-offset: 2px; }
.od-num, .od-theme td.num, .od-theme .num { font-variant-numeric: tabular-nums; }
.od-theme a { color: var(--ns-blue); }
.od-theme svg text { font-family: var(--ns-font); }

/* ---------------------------------------------------------------- system components */

.ns-row { display: flex; flex-wrap: wrap; gap: var(--ns-space-3); align-items: center; }

/* Button: one solid CTA on a page, ghost for every other action */
.ns-btn, .od-btn, .btn, button.btn {
  display: inline-block; background: transparent; color: var(--ns-blue); padding: 12px 20px;
  border-radius: var(--ns-radius-sm); font: 500 15px/1.2 var(--ns-font); text-decoration: none;
  border: 1px solid var(--ns-blue); cursor: pointer;
}
.ns-btn:hover, .od-btn:hover, .btn:hover { background: var(--ns-ice); border-color: var(--ns-blue); }
.ns-btn:focus-visible, .od-btn:focus-visible, .btn:focus-visible { outline: 2px solid var(--ns-blue); outline-offset: 2px; }
.ns-btn:not(.ns-btn--ghost), .od-btn.primary, .btn.primary { background: var(--ns-blue); color: var(--ns-white); border-color: var(--ns-blue); }
a.ns-btn:not(.ns-btn--ghost), a.od-btn.primary { color: var(--ns-white); }
.ns-btn:not(.ns-btn--ghost):hover, .od-btn.primary:hover, .btn.primary:hover { background: var(--ns-blue-bright); border-color: var(--ns-blue-bright); }
.ns-btn--ghost { background: transparent; color: var(--ns-blue); }
.ns-btn--on-dark { background: var(--ns-white); color: var(--ns-blue); border-color: var(--ns-white); }
.od-btn.danger { color: var(--ns-navy); border: 2px solid var(--ns-navy); font-weight: 600; }
.od-btn[disabled], .btn[disabled], .btn:disabled, .od-btn:disabled,
.od-btn.primary[disabled], .btn.primary:disabled, .od-btn.primary:disabled {
  background: var(--ns-ice); color: var(--ns-muted); border-color: var(--ns-line); cursor: default;
}
a.od-btn { display: inline-block; text-decoration: none; }

/* Headline: Light with exactly one phrase in SemiBold blue */
.ns-headline, .od-h1, .od-h2 {
  font-family: var(--ns-font); font-weight: 300; color: var(--ns-text);
  font-size: clamp(28px, 5vw, 40px); line-height: 1.3; text-wrap: balance;
  margin: 0 0 var(--ns-space-3); overflow-wrap: anywhere;
}
.ns-headline b, .od-h1 b, .od-h2 b { font-weight: 600; color: var(--ns-blue); }
.od-h1:focus { outline: none; }
.od-h1:focus-visible { outline: 2px solid var(--ns-blue); outline-offset: 2px; }

/* H4 and card titles */
.od-h3 { font-size: 18px; line-height: 1.4; font-weight: 500; color: var(--ns-text); margin: 0 0 var(--ns-space-2); }
.od-lede { font-size: 18px; line-height: 1.5; color: var(--ns-body); max-width: 62ch; margin: 0 0 var(--ns-space-6); }
.od-small { font-size: 13px; color: var(--ns-muted); }

/* Stat band */
.ns-stats {
  background: linear-gradient(90deg, #045DE8 0%, #297CFF 100%); border-radius: var(--ns-radius-lg); color: var(--ns-white);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--ns-space-4);
  padding: var(--ns-space-7); text-align: center;
}
.ns-stats strong { display: block; font-size: 32px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ns-stats span { font-size: 14px; }

/* Card */
.ns-card {
  background: var(--ns-white); border: 1px solid var(--ns-line); border-radius: var(--ns-radius-lg);
  padding: var(--ns-space-6); box-shadow: var(--ns-shadow-card);
}
.ns-card--ice { background: var(--ns-ice); }
.ns-card p { font-size: 16px; color: var(--ns-body); }
.ns-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--ns-space-5); }

/* Dark band: at most one, and only on the sign-in page */
.ns-dark { background: radial-gradient(circle at 4% 12%, #297CFF 0%, #001E4D 100%); color: var(--ns-white); }
.ns-dark .ns-headline, .ns-dark .ns-headline b { color: var(--ns-white); }

/* Chip */
.ns-chip {
  display: inline-block; padding: 4px 12px; border: 1px solid var(--ns-soft); background: var(--ns-ice);
  color: var(--ns-navy); border-radius: var(--ns-radius-pill); font-size: 13px; font-weight: 500;
}

/* A thin line icon, drawn by OdosCharts.glyph */
.ns-glyph { flex: none; display: inline-block; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- shell */

.od-main { padding: var(--ns-space-8) var(--ns-space-4) var(--ns-space-14); box-sizing: border-box; min-width: 0; }
.od-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ns-space-4); margin-bottom: var(--ns-space-6); }
.od-head > :first-child { flex: 1 1 320px; min-width: 0; }
.od-section { border-top: 1px solid var(--ns-line); padding-top: var(--ns-space-6); margin-top: var(--ns-space-8); min-width: 0; }

/* a small row of numbers on the older views */
.od-strip { display: flex; flex-wrap: wrap; gap: var(--ns-space-4) var(--ns-space-8); border-top: 1px solid var(--ns-line); border-bottom: 1px solid var(--ns-line); margin: var(--ns-space-6) 0 0; padding: var(--ns-space-3) 0; }
.od-strip dt { font-size: 13px; color: var(--ns-muted); }
.od-strip dd { margin: 0; font-size: 18px; font-weight: 600; color: var(--ns-text); font-variant-numeric: tabular-nums; }

.od-seg { display: inline-flex; border: 1px solid var(--ns-blue); border-radius: var(--ns-radius-sm); overflow: hidden; }
.od-seg button { font: 500 15px/1.2 var(--ns-font); border: 0; background: transparent; color: var(--ns-blue); padding: var(--ns-space-3) var(--ns-space-4); cursor: pointer; }
.od-seg button + button { border-left: 1px solid var(--ns-blue); }
.od-seg [aria-pressed=true] { background: var(--ns-navy); color: var(--ns-white); font-weight: 600; }

.od-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.od-table th { text-align: left; font-weight: 500; color: var(--ns-muted); font-size: 13px; padding: var(--ns-space-2) var(--ns-space-3) var(--ns-space-2) 0; border-bottom: 1px solid var(--ns-soft); }
.od-table td { padding: var(--ns-space-2) var(--ns-space-3) var(--ns-space-2) 0; border-bottom: 1px solid var(--ns-line); vertical-align: top; }

/* status words on the older views: weight and text, never a hue */
.od-ok { color: var(--ns-blue); font-weight: 500; }
.od-warn { color: var(--ns-blue); font-weight: 600; }
.od-bad { color: var(--ns-navy); font-weight: 600; }

/* ---------------------------------------------------------------- transit map */

.tm { position: relative; font-family: var(--ns-font); color: var(--ns-text); }
.tm-scroll { overflow-x: auto; overflow-y: hidden; }
/* a line wider than its frame says so: the scrollbar stays visible where the system would hide it */
.tm-scroll::-webkit-scrollbar { height: 10px; }
.tm-scroll::-webkit-scrollbar-thumb { background: var(--ns-soft); border-radius: 999px; }
.tm-scroll::-webkit-scrollbar-track { background: var(--ns-ice); border-radius: 999px; }
.tm svg { display: block; overflow: visible; }
.tm text { fill: var(--ns-text); font-family: var(--ns-font); }
.tm .t-muted { fill: var(--ns-muted); }
.tm .t-faint { fill: var(--ns-muted); }
.tm .t-label { font-size: 13px; font-weight: 500; }
.tm .t-line { font-size: 14px; font-weight: 500; }
.tm .t-cap { font-size: 13px; }
.tm .t-head { font-size: 13px; font-weight: 500; }
.tm .t-big { font-size: 16px; font-weight: 500; }

.tm-band { fill: var(--ns-ice); stroke: var(--ns-soft); stroke-width: 1; }
.tm-track { fill: none; stroke-linecap: butt; stroke-linejoin: round; }
.tm-casing { fill: none; stroke: var(--ns-white); stroke-linecap: round; }
.tm-station { fill: var(--ns-white); stroke: var(--ns-navy); stroke-width: 2.5; }
.tm-tick { stroke-linecap: butt; }
.tm-link { fill: none; stroke: var(--ns-soft); stroke-width: 1.25; }
.tm-mast { stroke: var(--ns-navy); stroke-width: 1.25; }

/* Signals. Closed: a filled navy marker with a stop glyph. Soft check: a blue ring. Passed: a filled blue check. */
.tm-sig-closed { fill: var(--ns-navy); stroke: var(--ns-navy); stroke-width: 1; }
.tm-sig-ring { fill: var(--ns-white); stroke: var(--ns-blue); stroke-width: 2.5; }
.tm-sig-passed { fill: var(--ns-blue); stroke: var(--ns-blue); stroke-width: 1; }
.tm-sig-mark { fill: none; stroke: var(--ns-white); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.tm-glyph { fill: none; stroke: var(--ns-muted); stroke-width: 1.3; }
.tm-glyph.fill { fill: var(--ns-muted); stroke: none; }

.tm-hit { cursor: pointer; outline: none; }
.tm-hit:focus-visible .tm-focus { stroke: var(--ns-blue); stroke-width: 2; fill: none; }
.tm-focus { fill: none; stroke: none; }
.tm-label-hit { pointer-events: all; }
.tm-stop .tm-focus { pointer-events: all; }
.tm-rule-stop-dot { fill: var(--ns-navy); }
.tm-rule-stop-bar { fill: var(--ns-white); }
/* the map's details: in view at the foot of the window, wherever the map was clicked */
.tm-panel.tm-docked {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(1040px, calc(100vw - 32px)); max-height: 38vh; overflow: auto; box-sizing: border-box;
  margin: 0; padding: var(--ns-space-4); z-index: 20; background: var(--ns-white); border: 1px solid var(--ns-soft); border-radius: var(--ns-radius-lg); box-shadow: var(--ns-shadow-card);
}
.tm-dock-close { float: right; }
.tm.is-focused .tm-row { opacity: .16; }
.tm.is-focused .tm-row.on { opacity: 1; }
.tm.is-focused .tm-col-head { opacity: .35; }
.tm.is-focused .tm-col-head.on { opacity: 1; }
.tm-sel .tm-station { stroke: var(--ns-blue); stroke-width: 3; }

/* details under the map */
.tm-panel { border-top: 1px solid var(--ns-line); margin-top: var(--ns-space-4); padding-top: var(--ns-space-4); font-size: 14px; min-height: 92px; scroll-margin-top: var(--ns-space-4); scroll-margin-bottom: var(--ns-space-4); }
.tm-panel dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--ns-space-8); margin: 0; }
.tm-panel h3 { font-size: 18px; font-weight: 500; color: var(--ns-text); margin: 0 0 var(--ns-space-2); }
.tm-panel .tm-sub { color: var(--ns-muted); font-size: 13px; margin: 0 0 var(--ns-space-4); }
.tm-panel-head { margin-bottom: var(--ns-space-2); }
.tm-panel dt { font-size: 13px; color: var(--ns-muted); margin-top: var(--ns-space-3); }
.tm-panel dd { margin: 2px 0 0; }
.tm-panel code { font-family: var(--ns-mono); font-size: 13px; background: var(--ns-ice); padding: 0 4px; border-radius: var(--ns-radius-sm); }
.tm-panel .tm-close { float: right; }
.tm-empty { color: var(--ns-muted); }

/* replay controls and caption */
.tm-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ns-space-3); margin: 0 0 var(--ns-space-3); }
.tm-caption { min-height: 1.5em; font-size: 16px; color: var(--ns-body); }
.tm-caption .tm-stage { font-weight: 600; color: var(--ns-text); }
.tm-train-body { fill: var(--ns-navy); }
.tm-train-win { fill: var(--ns-white); }

/* legend under the map */
.tm-legend { display: flex; flex-wrap: wrap; gap: var(--ns-space-2) var(--ns-space-6); margin: var(--ns-space-4) 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ns-muted); }
.tm-legend li { display: flex; align-items: center; gap: var(--ns-space-2); }

/* motion: the grow-in for builder changes; nothing moves without a user action */
.tm-grow { transform-box: fill-box; transform-origin: center; }

@media (max-width: 1180px) {
  .tm-panel dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .tm-panel dl { grid-template-columns: minmax(0, 1fr); }
}

/* Work type picker: one button per line, its line as a short sample */
.wtpick { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--ns-space-3); margin: var(--ns-space-2) 0 var(--ns-space-4); }
.wtpick-label { color: var(--ns-muted); font-size: 14px; padding-top: var(--ns-space-2); min-width: 72px; }
.wtpick-group { display: flex; flex-wrap: wrap; gap: var(--ns-space-2); }
.wtpick-btn { display: inline-flex; align-items: center; gap: var(--ns-space-2); padding: 4px 12px; font: 400 14px/1.4 var(--ns-font);
  color: var(--ns-navy); background: var(--ns-ice); border: 1px solid var(--ns-soft); border-radius: 999px; cursor: pointer; }
.wtpick-btn:hover { border-color: var(--ns-blue); }
.wtpick-btn.is-on { border: 2px solid var(--ns-navy); background: var(--ns-white); font-weight: 600; }
.wtpick-btn:focus-visible { outline: 2px solid var(--ns-blue); outline-offset: 2px; }

/* ---------------------------------------------------------------- the portal */

.od-theme .pf-main > .pf-banner { margin: var(--ns-space-4) auto var(--ns-space-6); max-width: var(--ns-content-max); }
.od-theme .pf-repoline { display: inline-flex; flex-wrap: wrap; gap: var(--ns-space-2); align-items: baseline; }
.od-theme .pf-token-out .pf-done { margin-bottom: var(--ns-space-6); }
.od-theme .pf-token-out code { word-break: break-all; }
.od-theme .pf-scope { border: 1px solid var(--ns-line); border-radius: var(--ns-radius-sm); padding: var(--ns-space-3) var(--ns-space-4); margin: 0 0 var(--ns-space-4); }
.od-theme .pf-scope[hidden] { display: none; }
.od-theme .pf-scope .pf-check { display: inline-flex; gap: var(--ns-space-2); margin-right: var(--ns-space-4); }
.od-theme .pf-act .od-btn + .od-btn { margin-left: var(--ns-space-2); }
.od-theme #account .pf-who { display: flex; flex-direction: column; max-width: 260px; line-height: 1.25; }
.od-theme #account .pf-who b { font-weight: 600; }
.od-theme #account .pf-who b, .od-theme #account .pf-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1200px) { .od-theme .pf-top-in, .od-theme .pf-top-end, .od-theme #account { flex-wrap: nowrap; } .od-theme .pf-nav { flex-wrap: nowrap; } .od-theme .pf-top-end .od-btn, .od-theme .pf-nav a { white-space: nowrap; } }
.od-theme .pf-tpl-head { margin-top: var(--ns-space-8); }

/* Icons and groups of rules, skills, commands and agents: icons.js */
.pf-ico { color: var(--ns-blue); vertical-align: -4px; }
.pf-igroup { border: 1px solid var(--ns-line); border-radius: var(--ns-radius-sm); background: var(--ns-white); margin: 0 0 var(--ns-space-3); }
.pf-igroup-head { display: flex; align-items: center; gap: var(--ns-space-3); padding: 12px var(--ns-space-4); cursor: pointer; font-weight: 500; color: var(--ns-navy); }
.pf-igroup[open] > .pf-igroup-head { border-bottom: 1px solid var(--ns-line); }
.pf-igroup-title { font-size: 16px; }
.pf-igroup-counts { margin-left: auto; display: inline-flex; gap: var(--ns-space-3); align-items: center; font-size: 13px; }
.pf-igroup-count { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--ns-muted); }
.pf-igroup-counts .pf-igroup-count { margin-left: 0; }
.pf-icount.hard { color: var(--ns-navy); font-weight: 600; }
.pf-icount.soft { color: var(--ns-blue); font-weight: 500; }
.pf-igroup > .pf-rules, .pf-igroup > .pf-irows, .pf-igroup > .pf-items { padding: 0 var(--ns-space-4); max-width: none; margin: 0; border-top: 0; }
.pf-igroup > .pf-rules > li:last-child, .pf-igroup > .pf-items > .pf-item:last-child { border-bottom: 0; }
.pf-igroup .pf-rule-top { display: flex; align-items: center; gap: var(--ns-space-3); flex-wrap: wrap; }
.pf-igroup .pf-rules .pf-why { margin-left: calc(18px + var(--ns-space-3)); }
.pf-igroup-bar { display: flex; justify-content: flex-end; padding: var(--ns-space-2) var(--ns-space-4) 0; }
.pf-selectall { font-size: 13px; }
.pf-selectall:disabled { color: var(--ns-muted); cursor: default; }
.pf-igroup > .pf-optional { padding: 0 var(--ns-space-4) var(--ns-space-2); }
.pf-irows { list-style: none; }
.pf-irow { display: grid; grid-template-columns: 18px minmax(10rem, 15rem) minmax(0, 1fr) auto; gap: var(--ns-space-3); align-items: center; padding: 8px 0; border-bottom: 1px solid var(--ns-line); font-size: 14px; }
.pf-irow:last-child { border-bottom: 0; }
.pf-irow-name { font-weight: 500; color: var(--ns-text); overflow-wrap: anywhere; }
.pf-irow-helps { color: var(--ns-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pf-irow-kind { color: var(--ns-muted); font-size: 13px; white-space: nowrap; }
@media (max-width: 720px) {
  .pf-irow { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .pf-irow-helps { grid-column: 2 / -1; grid-row: 2; white-space: normal; }
}
.pf-item-label { align-items: center; }
.pf-block-1 { display: flex; gap: var(--ns-space-2); align-items: flex-start; }
.pf-block-1 .pf-ico { margin-top: 2px; }
.pf-blocks .pf-block-2, .pf-blocks .pf-sub { margin-left: calc(18px + var(--ns-space-2)); }
.pf-dash-barname { display: flex; gap: var(--ns-space-2); align-items: center; min-width: 0; }
.pf-isummary { list-style: none; margin: var(--ns-space-3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--ns-space-2) var(--ns-space-4); font-size: 13px; color: var(--ns-body); }
.pf-isummary li { display: inline-flex; align-items: center; gap: 6px; }
.pf-isummary-n { font-weight: 600; color: var(--ns-navy); }
.pf-tpl-detail { margin-top: var(--ns-space-3); }
.pf-tpl-detail-in { padding-top: var(--ns-space-2); }
.pf-tpl-detail-in .pf-label { margin: var(--ns-space-4) 0 var(--ns-space-2); }
.pf-demo-note { margin-top: var(--ns-space-4); }
.shead .pf-ico { margin-right: 6px; }
.pf-igroup .pf-rule-top .pf-kind { margin-left: auto; }
.pf-igroup .pf-rule-top .pf-src { flex: none; }
.pf-selectall:disabled { background: none; border: 0; }
.pf-dash-lists { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
@media (max-width: 900px) { .pf-dash-lists { grid-template-columns: minmax(0, 1fr); } }
.pf-projects td.pf-nowrap { white-space: normal; min-width: 8rem; }
.pf-igroup .pf-rule-top .pf-src { min-width: 7.6rem; text-align: center; justify-content: center; }
