/*
 * Native Stack chrome on top of vendor/ui tokens and bundle.css.
 */

html, body { min-height: 100%; }
html { background: var(--tracing); }

.ns-shell { min-height: 100vh; }

.turbo-progress-bar { background: var(--clay); height: 2px; }

.ns-shell a:not([class]) { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.ns-shell a.ns-btn, .ns-shell a.ns-tile, .ns-shell a.ns-family-btn { text-decoration: none; }
.ns-shell a.ns-btn-primary { color: var(--on-clay); }
.ns-table .ns-cell-primary a { color: var(--ink); font-weight: 600; text-decoration: none; }
.ns-table .ns-cell-primary a:hover { text-decoration: underline; }

.ns-page {
  width: min(72rem, 100%);
  margin-inline: auto;
  padding: var(--space-8) var(--space-6) var(--space-12);
}
/* Dashboards use the whole window. */
.ns-page-wide { width: 100%; }

.ns-family-home .ns-display {
  font-size: 40px;
  line-height: 40px;
  margin: 0 0 var(--space-2);
}

.ns-family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.ns-sign-in-page {
  min-height: calc(100vh - var(--space-12));
  display: flex;
  align-items: center;
  justify-content: center;
}

.ns-sign-in-card {
  width: 100%;
  max-width: 22rem;
  padding: var(--space-8);
  background: var(--paper);
  border: 1px solid var(--dust);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.ns-sign-in-mark {
  width: 40px;
  height: 40px;
  display: block;
  margin-bottom: var(--space-4);
}

.ns-sign-in-card .ns-display {
  margin: 0 0 var(--space-6);
}

.ns-sign-in-card .ns-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.ns-sign-in-password-row {
  justify-content: space-between;
  align-items: baseline;
}

.ns-sign-in-submit {
  margin-top: var(--space-2);
  width: 100%;
}

.ns-sign-in-alert,
.ns-sign-in-notice {
  margin: 0 0 var(--space-4);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 18px;
}

.ns-sign-in-alert {
  background: var(--clay-tint);
  color: var(--clay-deep);
}

.ns-sign-in-notice {
  background: var(--tracing);
  color: var(--ink-soft);
}

.ns-bar-tools {
  margin-left: auto;
}

.ns-table td.ns-num, .ns-table td .ns-unknown { white-space: nowrap; }

@media (max-width: 720px) {
  .ns-pagehead-actions { margin-left: 0; flex-wrap: wrap; width: 100%; }
  .ns-record-fields, .ns-project-facts .ns-record-fields { grid-template-columns: 1fr 1fr; }
  .ns-record-field:nth-child(2n) { border-right: 0; }
  .ns-bar-tools .ns-actor { gap: 0; padding-right: 0; }
  .ns-bar-actor-email { display: none; }
  .ns-table-phone td[data-label="Project"]::before { display: none; }
  /* Mobile schedule rendering is a later issue (#66 scope: desktop only). */
  .ns-schedule-wrap { display: none; }
}

.ns-jobs-filters {
  margin: var(--space-4) 0 var(--space-4);
  flex-wrap: wrap;
}

.ns-jobs-filters a.ns-filter {
  text-decoration: none;
}

.ns-money-input { position: relative; display: block; }
.ns-money-prefix { position: absolute; left: var(--space-3); top: 0; height: 38px; display: flex; align-items: center; color: var(--ink-mute); pointer-events: none; }
.ns-money-input .ns-input { padding-left: var(--space-6); width: 100%; }
/* Same affordance with the symbol after the number: "55 %". */
.ns-unit-input { position: relative; display: block; }
.ns-unit-suffix { position: absolute; right: var(--space-3); top: 0; height: 38px; display: flex; align-items: center; color: var(--ink-mute); pointer-events: none; }
.ns-unit-input .ns-input { padding-right: var(--space-6); width: 100%; }
.ns-textarea { height: auto; min-height: 84px; resize: vertical; font-family: inherit; line-height: 1.4; padding-top: var(--space-2); }
.ns-record-description { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft); white-space: pre-line; }

.ns-project-form { max-width: 40rem; display: flex; flex-direction: column; gap: var(--space-6); margin-top: var(--space-4); }
.ns-form-section { padding: var(--space-5); border: 1px solid var(--dust); background: var(--paper); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.ns-form-section .ns-title-sm { margin-bottom: var(--space-4); }
.ns-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-5); }
.ns-form-grid .ns-span-2 { grid-column: span 2; }
.ns-form-actions { display: flex; gap: var(--space-3); align-items: center; }
.ns-form-errors { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--clay-tint); color: var(--clay-deep); font-size: 13px; line-height: 18px; }
.ns-form-errors p { margin: 0; }
.ns-input-invalid { border-color: var(--clay-deep); }
.ns-field-error { color: var(--clay-deep); font-size: 13px; line-height: 18px; }
@media (max-width: 720px) {
  .ns-form-grid { grid-template-columns: 1fr; }
  .ns-form-grid .ns-span-2 { grid-column: auto; }
}

.ns-empty {
  padding: var(--space-8) var(--space-6);
  border: 1px dashed var(--dust-deep);
  border-radius: var(--radius-lg);
  text-align: center;
}

.ns-empty .ns-title-sm {
  margin-bottom: var(--space-1);
}

.ns-title-sm {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  line-height: 22px;
  margin: 0 0 var(--space-2);
}

/*
 * Standins for primitives the kit (vendor/ui) doesn't have yet. Tokens only,
 * no invented colour/radius/shadow -- this is composition, not a second
 * design language. Move into vendor/ui and delete from here once it exists
 * there; flagged on the PR, no write/issue access to Native-Stack-LLC/ui to
 * file it directly.
 */
.ns-chrome-float {
  position: fixed;
  top: var(--space-3);
  right: var(--space-4);
  display: flex;
  gap: var(--space-2);
  z-index: var(--z-chrome, 10);
}

.ns-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--dust);
  background: var(--paper);
  box-shadow: var(--shadow-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  padding: 0;
}
.ns-icon-btn:hover { background: var(--tracing); }
.ns-icon-btn .ns-actor-avatar { width: 20px; height: 20px; font-size: 10px; }

.ns-chrome-float .ns-family-menu { top: 44px; right: 0; left: auto; }

/* #131: the bottom-right "ask the agent" button and its panel. Same
   fixed-position, token-only standin as .ns-chrome-float above (not a new
   design language, flagged here for the same reason that comment is). */
.ns-agent-chrome {
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-chrome, 10);
}

.ns-agent-btn { width: 44px; height: 44px; }

.ns-agent-panel {
  position: absolute;
  bottom: 52px;
  right: 0;
  width: min(360px, 92vw);
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--dust);
  background: var(--paper);
  box-shadow: var(--shadow-card);
}

/* The [hidden] attribute above loses to the class rule's display: flex
   without this — the closed panel otherwise still renders (and blocks
   clicks under it) on every suite page. */
.ns-agent-panel[hidden] {
  display: none;
}

.ns-agent-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.ns-agent-panel-messages {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ns-agent-panel textarea { width: 100%; resize: vertical; }
.ns-agent-panel-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.ns-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid var(--dust);
  background: var(--paper);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.ns-chip-btn:hover { background: var(--tracing); }
.ns-chip-btn-empty { border-style: dashed; color: var(--ink-mute); }

.ns-card-centered .ns-record-head { justify-content: center; text-align: center; }
.ns-card-centered .ns-record-field { text-align: center; }
/* Ten facts: five across so they fall in two even rows at desktop widths. */
.ns-project-facts .ns-record-fields { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.ns-disclosure { position: relative; display: inline-block; }
.ns-disclosure > summary { list-style: none; cursor: pointer; }
.ns-disclosure > summary::-webkit-details-marker { display: none; }
.ns-disclosure-panel {
  position: absolute;
  top: 44px;
  left: 0;
  z-index: var(--z-sheet, 20);
  background: var(--paper);
  border: 1px solid var(--dust);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-toast);
  padding: var(--space-3);
  min-width: 220px;
}

/* Inside a card (ns-record clips with overflow: hidden, so a floating
   popover gets cut off) the panel grows the card instead of floating. */
.ns-disclosure-inline .ns-disclosure-panel {
  position: static;
  box-shadow: none;
  margin-top: var(--space-3);
  min-width: 0;
  width: 100%;
}

.ns-projects-index { width: min(40rem, 100%); margin-inline: auto; }
.ns-projects-actions { display: flex; justify-content: center; gap: var(--space-2); margin: var(--space-3) 0 var(--space-8); }
.ns-projects-feed { display: flex; flex-direction: column; gap: var(--space-4); }

/* The schedule chart (#66): a Gantt of the same list as the feed below it.
   No vendor/ui primitive for this (flagged, same as .ns-record-* companions
   above) -- tokens only. Wider than the feed's own column on purpose: the
   chart is the overview, the feed is the detail.

   One scroll box, both axes. Rows are flex lines so the label can be
   position: sticky against the row (a grid cell would clamp it to its own
   area). Day width is a custom property set inline from the view; 16px is
   the floor where a two-digit date still reads, and shows ~2.5 months at
   1440 wide. Height caps at about nine rows so the feed stays near the fold. */
.ns-schedule-wrap { width: min(80rem, 100%); margin: 0 auto var(--space-12); }
.ns-schedule-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin-bottom: var(--space-3); padding-right: 7rem; /* clear the floating app/account buttons */ }
.ns-schedule-title { font-size: 16px; font-weight: 600; margin: 0; color: var(--ink); }

.ns-schedule {
  --label-width: 220px;
  --row-height: 44px;
  --axis-height: 40px;
  --footer-height: 52px;
  position: relative;
  max-height: calc(var(--axis-height) + var(--footer-height) + var(--row-height) * 9);
  overflow: auto;
  border: 1px solid var(--dust);
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  font-variant-numeric: tabular-nums;
}
.ns-schedule-row, .ns-schedule-axis { display: flex; align-items: stretch; width: max-content; min-width: 100%; }
.ns-schedule-row { height: var(--row-height); }
.ns-schedule-axis { height: var(--axis-height); position: sticky; z-index: 3; background: var(--paper); }
.ns-schedule-axis-top { top: 0; border-bottom: 1px solid var(--dust-deep); }
.ns-schedule-axis-bottom { bottom: 0; height: var(--footer-height); border-top: 1px solid var(--dust-deep); }
.ns-schedule-total { display: flex; flex-direction: column; justify-content: center; padding: 0 var(--space-3); gap: 2px; }
.ns-schedule-month span { display: flex; flex-direction: column; gap: 2px; }
.ns-schedule-month-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.ns-schedule-profit { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ns-schedule-loss { color: var(--clay-deep); }

.ns-schedule-label, .ns-schedule-corner {
  position: sticky; left: 0; z-index: 2;
  flex: 0 0 var(--label-width); width: var(--label-width);
  background: var(--paper); border-right: 1px solid var(--dust-deep);
}
.ns-schedule-label { display: flex; align-items: center; padding: 0 var(--space-3); border-bottom: 1px solid var(--dust); min-width: 0; }
.ns-schedule-label .ns-schedule-link { display: flex; flex-direction: column; min-width: 0; width: 100%; text-decoration: none; color: inherit; }
.ns-schedule-label .ns-schedule-link:hover .ns-schedule-name { color: var(--link); }
.ns-schedule-name, .ns-schedule-address { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-schedule-name { font-size: 13px; font-weight: 600; line-height: 18px; color: var(--ink); }
.ns-schedule-address { font-size: 11px; line-height: 14px; color: var(--ink-mute); }

.ns-schedule-track { position: relative; flex: 0 0 var(--track-width); width: var(--track-width); border-bottom: 1px solid var(--dust); }
.ns-schedule-axis .ns-schedule-track { display: flex; border-bottom: 0; }
.ns-schedule-row:last-of-type .ns-schedule-track, .ns-schedule-row:last-of-type .ns-schedule-label { border-bottom: 0; }

.ns-schedule-day { flex: 0 0 var(--day-width); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.ns-schedule-dow { font-size: 9px; line-height: 10px; color: var(--ink-mute); text-transform: uppercase; }
.ns-schedule-date { font-size: 10px; line-height: 12px; font-weight: 600; color: var(--ink-soft); }
.ns-schedule-day.ns-schedule-weekend { background: var(--aggregate-tint); }
.ns-schedule-day.ns-schedule-today { background: var(--clay-tint); }
.ns-schedule-day.ns-schedule-today .ns-schedule-date, .ns-schedule-day.ns-schedule-today .ns-schedule-dow { color: var(--clay-deep); }

.ns-schedule-shade { position: absolute; top: 0; bottom: 0; width: var(--day-width); pointer-events: none; }
.ns-schedule-shade.ns-schedule-weekline { width: 0; border-left: 1px solid var(--dust); }
.ns-schedule-week { flex: 0 0 calc(var(--day-width) * 7); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-left: 1px solid var(--dust); }
.ns-schedule-week:first-child { border-left: 0; }
.ns-schedule-week.ns-schedule-today { background: var(--clay-tint); }
.ns-schedule-week.ns-schedule-today .ns-schedule-date, .ns-schedule-week.ns-schedule-today .ns-schedule-dow { color: var(--clay-deep); }
.ns-schedule-wrap-weeks { width: 100%; margin: 0; }
.ns-schedule-wrap-weeks .ns-schedule { --label-width: 180px; --row-height: 36px; max-height: calc(var(--axis-height) + var(--footer-height) + var(--row-height) * 8); }
.ns-schedule-wrap-weeks .ns-schedule-address { display: none; }
.ns-schedule-wrap-weeks .ns-schedule-bar { height: 14px; }
.ns-schedule-shade.ns-schedule-weekend { background: var(--aggregate-tint); opacity: 0.6; }
.ns-schedule-shade.ns-schedule-today { background: none; border-left: 2px solid var(--clay); width: 0; margin-left: calc(var(--day-width) / 2 - 1px); }

.ns-schedule-bar {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 20px; border-radius: var(--radius-sm); box-sizing: border-box;
  display: block; text-decoration: none;
}
.ns-schedule-bar:hover, .ns-schedule-bar:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* Only prospective work charts here; one solid bar in the suite's colour. */
.ns-schedule-bar { background: var(--sand); }
/* The bidding period on the same row, in the suite's other colour. */
.ns-schedule-bar.ns-schedule-bar-bidding { background: var(--clay); height: 10px; opacity: 0.85; }
.ns-schedule-wrap-weeks .ns-schedule-bar.ns-schedule-bar-bidding { height: 8px; }
.ns-schedule-due { position: absolute; top: 50%; width: 9px; height: 9px; margin-left: calc(var(--day-width) / 2 - 4px); transform: translateY(-50%) rotate(45deg); background: var(--clay-deep); border: 1px solid var(--paper); z-index: 1; pointer-events: none; }
.ns-schedule-legend { display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: 12px; color: var(--ink-soft); }
.ns-schedule-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ns-schedule-key { display: inline-block; width: 14px; height: 8px; border-radius: 2px; background: var(--sand); }
.ns-schedule-key-bidding { background: var(--clay); }
.ns-schedule-key-due { width: 8px; height: 8px; border-radius: 0; transform: rotate(45deg); background: var(--clay-deep); }

.ns-schedule-month { flex: 0 0 auto; display: flex; align-items: center; padding-left: var(--space-2); border-left: 1px solid var(--dust); font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; overflow: clip; }
.ns-schedule-month:first-child { border-left: 0; }
.ns-schedule-month > span { position: sticky; left: calc(var(--label-width) + var(--space-2)); }

/* Quiet scrolling: panels that scroll keep a thin thumb that only shows
   while the pointer is over them, no track, no arrows. Firefox through
   scrollbar-width/color, WebKit through the pseudo-elements. Content still
   scrolls by wheel, trackpad, and touch everywhere. */
.ns-scroll-quiet { scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color 160ms ease; }
.ns-scroll-quiet:hover { scrollbar-color: var(--dust-deep) transparent; }
.ns-scroll-quiet::-webkit-scrollbar { width: 6px; height: 6px; }
.ns-scroll-quiet::-webkit-scrollbar-track { background: transparent; }
.ns-scroll-quiet::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.ns-scroll-quiet:hover::-webkit-scrollbar-thumb { background: var(--dust-deep); }
.ns-scroll-quiet::-webkit-scrollbar-corner { background: transparent; }

/* The Preconstruction home (#75 layout test): board on top, then the
   week-scale schedule two-thirds wide with what needs attention beside it. */
.ns-home { display: flex; flex-direction: column; gap: var(--space-6); }
.ns-home-bar { display: flex; align-items: center; gap: var(--space-3); padding-right: 7rem; /* clear the floating app/account buttons */ }
.ns-home-title { font-size: 22px; margin: 0; }
.ns-home-search { position: relative; flex: 1; display: flex; justify-content: center; }
.ns-home-search .ns-input { width: 20rem; }

/* The search palette (#77). Kit gap: no palette, results-panel, kbd, or <mark>
   primitive in vendor/ui yet; tokens only here. */
.ns-palette { background: var(--paper); border: 1px solid var(--dust); border-radius: var(--radius-lg); box-shadow: var(--shadow-sheet); overflow: hidden; padding: 0; color: var(--ink); }
.ns-palette-centered { width: 640px; max-width: calc(100vw - 32px); margin: 72px auto; }
.ns-palette-centered::backdrop { background: rgba(0, 0, 0, .28); }
.ns-palette-anchored { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: 640px; max-width: calc(100vw - 48px); z-index: var(--z-sheet, 30); }
.ns-palette-box { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--dust); }
.ns-palette-box .ns-input { flex: 1; border: 0; box-shadow: none; height: 32px; font-size: 16px; padding: 0; }
.ns-palette-box .ns-input:focus { outline: none; }
.ns-kbd { font: inherit; font-size: 11px; line-height: 16px; padding: 0 6px; border: 1px solid var(--dust-deep); border-radius: var(--radius-sm); color: var(--ink-mute); background: var(--tracing); white-space: nowrap; cursor: default; }
.ns-palette-chips { display: flex; gap: var(--space-1); padding: var(--space-2) var(--space-4); overflow-x: auto; border-bottom: 1px solid var(--dust); }
.ns-palette-chips .ns-filter { flex: 0 0 auto; text-decoration: none; }
.ns-palette-list { max-height: 60vh; overflow-y: auto; padding: var(--space-1) 0; }
.ns-palette-group { display: flex; align-items: baseline; gap: var(--space-1); padding: var(--space-3) var(--space-4) var(--space-1); }
.ns-palette-group .ns-label { padding: 0; margin: 0; display: inline; }
.ns-hit { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-4); color: inherit; text-decoration: none; }
.ns-hit:hover, .ns-hit[aria-selected="true"] { background: var(--tracing); }
.ns-hit-name { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-hit-why { font-size: 12px; line-height: 16px; color: var(--ink-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-hit mark { background: var(--sand-tint); color: inherit; padding: 0 1px; border-radius: 2px; }
.ns-palette-hint, .ns-palette-absent { padding: var(--space-3) var(--space-4); margin: 0; }
.ns-palette-none { padding: var(--space-4); }
.ns-palette-none-title { font-size: 14px; font-weight: 600; }
.ns-palette-none .ns-small { margin: 4px 0 0; }
.ns-palette-foot { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-4); border-top: 1px solid var(--dust); background: var(--tracing); }

.ns-pipeline { display: flex; align-items: stretch; gap: var(--space-2); }
.ns-pipeline-stage { flex: 1 1 0; display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); background: var(--paper); border: 1px solid var(--dust); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); min-width: 0; }
.ns-pipeline-name { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-pipeline-value { font-size: 22px; line-height: 28px; font-weight: 600; color: var(--ink); }
.ns-pipeline-count { font-size: 12px; color: var(--ink-mute); }
.ns-pipeline-arrow { align-self: center; color: var(--dust-deep); font-size: 18px; }
.ns-pipeline-total { background: var(--sand-tint); border-color: var(--sand); margin-left: var(--space-2); }
.ns-board-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-3); }
.ns-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.ns-board-heading { font-size: 13px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.02em; margin: 0 0 var(--space-2); padding: 0 var(--space-1); }
.ns-board-column { border-radius: var(--radius-lg); transition: background-color 120ms ease; }
.ns-board-column-over { background: var(--sand-tint); box-shadow: inset 0 0 0 2px var(--sand); }
.ns-board-cards { display: flex; flex-direction: column; gap: var(--space-2); min-height: 6rem; max-height: 22rem; overflow-y: auto; padding: 2px; }
.ns-board-card[draggable] { cursor: grab; }
.ns-board-card-dragging { opacity: 0.4; }
.ns-board-card[data-pending] { opacity: 0.7; }
.ns-board-card-error { font-size: 11px; color: var(--clay-deep); }
.ns-board-card { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-3); background: var(--paper); border: 1px solid var(--dust); border-radius: var(--radius-md); box-shadow: var(--shadow-card); text-decoration: none; color: inherit; border-left: 3px solid var(--sand); }
.ns-board-card:hover { border-color: var(--dust-deep); border-left-color: var(--sand-deep); }
.ns-board-card-awarded { border-left-color: var(--clay); }
.ns-board-card-lost { border-left-color: var(--dust-deep); }
.ns-board-card-lost .ns-board-card-name { color: var(--ink-mute); }
.ns-board-tag-awarded { color: var(--clay); }
.ns-map-section .ns-schedule-title { margin-bottom: var(--space-3); }
.ns-map { height: 28rem; border: 1px solid var(--dust); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; background: var(--aggregate-tint); }
.ns-map .leaflet-tooltip { font: inherit; font-size: 12px; }
.ns-board-card-name { font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-board-card-meta { display: flex; justify-content: space-between; gap: var(--space-2); font-size: 11px; color: var(--ink-mute); }
.ns-board-tag { color: var(--clay-deep); }
.ns-board-empty { font-size: 12px; color: var(--ink-mute); margin: var(--space-2) var(--space-1); }

.ns-home-lower { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-5); align-items: start; }
.ns-home-schedule { min-width: 0; }
.ns-attention .ns-schedule-title { margin-bottom: var(--space-3); }
.ns-attention-card { background: var(--paper); border: 1px solid var(--dust); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); max-height: 24rem; overflow-y: auto; }
.ns-attention-list { list-style: none; margin: 0; padding: 0; }
.ns-attention-item { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--dust); border-left: 3px solid transparent; }
.ns-attention-item:last-child { border-bottom: 0; }
.ns-attention-bid_due { border-left-color: var(--clay); }
.ns-attention-no_bids { border-left-color: var(--sand); }
.ns-attention-no_dates { border-left-color: var(--dust-deep); }
.ns-attention-project { font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.ns-attention-project:hover { color: var(--link); }
.ns-attention-text { font-size: 12px; color: var(--ink-soft); }
.ns-attention-clear { padding: var(--space-4); margin: 0; }

@media (max-width: 1100px) {
  .ns-board { grid-auto-columns: 240px; overflow-x: auto; padding-bottom: var(--space-2); }
  .ns-home-lower { grid-template-columns: 1fr; }
  .ns-pipeline { flex-wrap: wrap; }
  .ns-pipeline-stage { flex-basis: calc(50% - var(--space-2)); }
  .ns-pipeline-arrow { display: none; }
  .ns-pipeline-total { margin-left: 0; }
}
@media (max-width: 720px) {
  .ns-home-bar { flex-wrap: wrap; padding-right: 6rem; }
  .ns-pipeline-stage { flex-basis: 100%; }
  .ns-map { height: 18rem; }
  .ns-home-search { flex: 1 1 100%; order: 3; margin-right: -6rem; /* the bar clears the floating buttons; this row sits below them */ }
  .ns-home-search .ns-input { width: 100%; }
  .ns-palette-anchored { left: 0; right: 0; width: auto; max-width: none; transform: none; }
  .ns-palette-centered { width: auto; max-width: none; height: 100%; max-height: 100%; margin: 0; border-radius: 0; }
  .ns-palette-centered[open] { display: flex; flex-direction: column; }
  .ns-palette-centered .ns-palette-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
  .ns-palette-centered .ns-palette-list { max-height: none; flex: 1; }
  .ns-board { grid-auto-columns: 80vw; }
}

.ns-companies-cards, .ns-related-cards {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

/* A tenant's logo (Branding): keep its own proportions. */
.ns-brand-logo { width: auto; max-width: 220px; height: 40px; object-fit: contain; object-position: left center; }
.ns-family-logo { display: block; margin-bottom: var(--space-4); height: 48px; }

/* Project pages in Construction management: the job header, tabs, stat
   cards and titled cards proven in HPB-PM. Tokens only, so a tenant's
   Branding recolors them. Candidates for the UI kit once they settle. */
.ns-job-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); padding-bottom: var(--space-4); }
.ns-job-head-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 6px; }
.ns-job-head-title { margin: 0; font-family: var(--font-display); font-size: 34px; line-height: 1; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink); }
.ns-job-head-sub { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); color: var(--ink-soft); }
.ns-badge { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; background: var(--clay-tint); color: var(--clay); }
.ns-badge-quiet { background: var(--tracing); color: var(--ink-soft); border: 1px solid var(--dust); }

.ns-tabs { display: flex; gap: var(--space-1); overflow-x: auto; margin: 0 0 var(--space-5); border-bottom: 1px solid var(--dust); }
.ns-tabs .ns-tab { white-space: nowrap; padding: var(--space-2) var(--space-3); border-bottom: 2px solid transparent; font-weight: 600; color: var(--ink-mute); text-decoration: none; }
.ns-tabs .ns-tab:hover { color: var(--ink); }
.ns-tabs .ns-tab[aria-current="page"] { border-bottom-color: var(--clay); color: var(--ink); }

.ns-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--space-3); margin-bottom: var(--space-5); }
.ns-stat { padding: var(--space-3) var(--space-4); background: var(--paper); border: 1px solid var(--dust); border-radius: var(--radius-lg); }
.ns-stat-label { font-size: 11px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-mute); }
.ns-stat-value { margin-top: 4px; font-family: var(--font-display); font-size: 24px; line-height: 28px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ns-stat-value .ns-unknown { font-family: var(--font-sans); font-size: 14px; font-weight: 400; }

.ns-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: var(--space-4); align-items: start; }
.ns-card { background: var(--paper); border: 1px solid var(--dust); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.ns-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--dust); }
.ns-card-title { margin: 0; font-family: var(--font-display); font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink); }
.ns-card-body { padding: var(--space-4); }
.ns-card .ns-table { border: 0; border-radius: 0; box-shadow: none; }

@media (max-width: 720px) { .ns-job-head-title { font-size: 26px; } }

/* Each app's sidebar (HPB-PM's navigation): the brand and this app's
   pages, in ink. Moving between apps and the account stay in the floating
   buttons top right. Tokens only, so Branding recolors it. Below 900px it
   folds into a top bar with a menu button. */
.ns-shell:has(> .ns-sidebar) { display: grid; grid-template-columns: 15rem minmax(0, 1fr); align-items: start; }
.ns-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: var(--ink); color: var(--on-ink); padding: var(--space-5) var(--space-3); }
.ns-sidebar-top { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2) var(--space-5); }
.ns-sidebar .ns-sidebar-brand { display: flex; align-items: center; gap: var(--space-2); color: var(--on-ink); text-decoration: none; font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.1; }
.ns-sidebar-logo { width: 32px; height: 32px; object-fit: contain; border-radius: var(--radius-sm); flex: none; }
.ns-sidebar-menu-btn { display: none; background: none; border: 1px solid color-mix(in srgb, var(--on-ink) 25%, transparent); border-radius: var(--radius-md); color: var(--on-ink); width: 36px; height: 36px; place-items: center; cursor: pointer; padding: 0; flex: none; }
.ns-sidebar-panel { display: flex; flex-direction: column; gap: var(--space-6); }
.ns-sidebar-section { display: flex; flex-direction: column; gap: 2px; }
.ns-sidebar-eyebrow { padding: 0 var(--space-3) var(--space-1); font-size: 10px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: color-mix(in srgb, var(--on-ink) 50%, transparent); }
.ns-sidebar .ns-side-link { position: relative; display: flex; align-items: center; gap: var(--space-2); padding: 7px var(--space-3); border-radius: var(--radius-md); color: color-mix(in srgb, var(--on-ink) 72%, transparent); text-decoration: none; font-weight: 500; }
.ns-sidebar .ns-side-link:hover { background: color-mix(in srgb, var(--on-ink) 6%, transparent); color: var(--on-ink); }
.ns-sidebar .ns-side-link[aria-current] { background: color-mix(in srgb, var(--on-ink) 11%, transparent); color: var(--on-ink); }
.ns-sidebar .ns-side-link[aria-current]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--sand); }

@media (min-width: 900px) { .ns-sidebar-panel[hidden] { display: flex; } }
@media (max-width: 899px) {
  .ns-shell:has(> .ns-sidebar) { grid-template-columns: minmax(0, 1fr); }
  /* Under the floating buttons, which keep the top right. */
  .ns-sidebar { position: sticky; top: 0; z-index: calc(var(--z-chrome, 10) - 1); height: auto; max-height: 100vh; padding: var(--space-3) 104px var(--space-3) var(--space-4); }
  .ns-sidebar-top { padding: 0; }
  .ns-sidebar-menu-btn { display: grid; }
  .ns-sidebar-panel[hidden] { display: none; }
  .ns-sidebar-panel:not([hidden]) { padding-top: var(--space-4); }
}

/* A row of mutually exclusive choices (the board's sort). */
.ns-segmented { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin-left: auto; }
.ns-segmented .ns-small { margin-right: var(--space-1); }
.ns-shell a.ns-segment { padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid var(--dust); background: var(--paper); color: var(--ink-soft); font-size: 12px; font-weight: 600; text-decoration: none; }
.ns-shell a.ns-segment:hover { color: var(--ink); }
.ns-shell a.ns-segment[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

.ns-file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.ns-file-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.ns-record-fields-stacked { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--space-3); }
.ns-record-fields-stacked .ns-record-field { border: 0; padding: 0; text-align: left; }

/* A filterable checkbox list (inviting bidders). */
.ns-checklist { max-height: 18rem; overflow-y: auto; border: 1px solid var(--dust); border-radius: var(--radius-md); padding: var(--space-2); display: flex; flex-direction: column; }
.ns-checklist-group { margin: var(--space-2) var(--space-2) var(--space-1); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); }
.ns-checklist-group:first-child { margin-top: 0; }
.ns-checklist-item { display: flex; align-items: center; gap: var(--space-2); padding: 6px var(--space-2); border-radius: var(--radius-sm); cursor: pointer; }
.ns-checklist-item:hover { background: var(--tracing); }
.ns-checklist-item[hidden] { display: none; }

/* Won jobs on the timeline: construction in ink, not the pursuit colour. */
.ns-schedule-bar.ns-schedule-bar-won { background: var(--ink-soft); }
.ns-schedule-key-won { background: var(--ink-soft); }

/* Milestone colours, shared by the calendar and Coming up. */
.ns-milestone-bid_due { --milestone: var(--clay); }
.ns-milestone-start, .ns-milestone-end { --milestone: var(--sand); }
.ns-milestone-jobwalk, .ns-milestone-rfi_due, .ns-milestone-rfp_received { --milestone: var(--ink-mute); }
.ns-milestone-contract_signed { --milestone: var(--ink); }
.ns-attention-item[class*="ns-milestone-"] { border-left: 3px solid var(--milestone); padding-left: var(--space-2); }

.ns-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--dust); border-radius: var(--radius-lg); overflow: hidden; background: var(--paper); }
.ns-calendar-dow { padding: var(--space-2); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); border-bottom: 1px solid var(--dust); background: var(--tracing); }
.ns-calendar-day { min-height: 7rem; padding: var(--space-2); border-right: 1px solid var(--dust); border-bottom: 1px solid var(--dust); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ns-calendar-day:nth-child(7n) { border-right: 0; }
.ns-calendar-day-out { background: var(--tracing); color: var(--ink-mute); }
.ns-calendar-date { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.ns-calendar-today .ns-calendar-date { color: var(--on-clay); background: var(--clay); border-radius: var(--radius-pill); padding: 0 6px; align-self: flex-start; }
.ns-shell a.ns-calendar-event { display: block; padding: 2px 6px; border-left: 3px solid var(--milestone, var(--ink-mute)); background: var(--tracing); border-radius: var(--radius-sm); font-size: 12px; line-height: 16px; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-calendar-event b { font-weight: 600; }
.ns-calendar-nav { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
@media (max-width: 720px) {
  .ns-calendar { grid-template-columns: minmax(0, 1fr); }
  .ns-calendar-dow, .ns-calendar-day-empty { display: none; }
  .ns-calendar-day { min-height: 0; border-right: 0; }
}

/* A project header without tabs under it carries its own rule. */
.ns-job-head-ruled { border-bottom: 1px solid var(--dust); margin-bottom: var(--space-5); }
.ns-sidebar .ns-side-link.ns-side-back { margin-bottom: var(--space-4); font-size: 13px; }

.ns-milestones { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ns-milestones li { display: flex; justify-content: space-between; gap: var(--space-3); padding: 6px 0 6px var(--space-3); border-left: 3px solid var(--milestone, var(--dust)); }
.ns-milestones li + li { border-top: 1px solid var(--tracing); }
.ns-milestones li.ns-milestone-past { opacity: 0.6; }

.ns-card-note { margin: 0; padding: var(--space-2) var(--space-4); background: var(--sand-tint); border-bottom: 1px solid var(--dust); }
.ns-qa-item { padding-bottom: var(--space-3); border-bottom: 1px solid var(--tracing); display: flex; flex-direction: column; gap: var(--space-2); }
.ns-qa-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ns-qa { margin: 0; }
.ns-qa dt { font-weight: 600; }
.ns-qa dd { margin: 4px 0 var(--space-3); color: var(--ink-soft); }

/* The bid portal: a page for a sub, no app chrome. */
.ns-portal { width: min(60rem, 100%); }
.ns-portal-brand { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.ns-portal-flash { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--clay-tint); margin: 0 0 var(--space-4); }
.ns-portal-flash-alert { background: var(--sand-tint); }

/* Every upload: a drop zone, not a bare file button. */
.ns-filedrop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: var(--space-5) var(--space-4); border: 1.5px dashed var(--dust-deep); border-radius: var(--radius-lg); background: var(--tracing); color: var(--ink-soft); text-align: center; cursor: pointer; transition: border-color 120ms ease, background-color 120ms ease; }
.ns-filedrop:hover, .ns-filedrop:focus-visible, .ns-filedrop-over { border-color: var(--clay); background: var(--clay-tint); color: var(--ink); outline: none; }
.ns-filedrop-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ns-filedrop-icon { color: var(--clay); }
.ns-filedrop-prompt { display: flex; flex-direction: column; gap: 2px; }
.ns-filedrop-prompt strong { color: var(--ink); font-weight: 600; }
.ns-filedrop-list { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--ink); }
.ns-filedrop-list:empty { display: none; }
.ns-filedrop-has-files { border-style: solid; border-color: var(--clay); background: var(--paper); }

.ns-checklist-tall { max-height: 32rem; }
.ns-checklist-group { display: flex; align-items: center; justify-content: space-between; }
.ns-checklist-all { background: none; border: 0; padding: 0; cursor: pointer; text-transform: none; letter-spacing: 0; }
.ns-checklist-item-taken { opacity: 0.55; cursor: default; }
.ns-code-group { border-top: 1px solid var(--dust); }
.ns-code-group > summary { padding: var(--space-3) var(--space-4); cursor: pointer; display: flex; gap: var(--space-3); align-items: baseline; }
.ns-code-group > summary:hover { background: var(--tracing); }

.ns-contacts-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); }
.ns-segmented.ns-segmented-left { margin-left: 0; }
.ns-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--space-3); align-items: end; }

/* Search, always at hand at the top of the sidebar. */
.ns-sidebar-search { position: relative; padding: 0 var(--space-2) var(--space-4); }
.ns-sidebar .ns-sidebar-search-input { width: 100%; background: color-mix(in srgb, var(--on-ink) 8%, transparent); border-color: color-mix(in srgb, var(--on-ink) 18%, transparent); color: var(--on-ink); }
.ns-sidebar .ns-sidebar-search-input::placeholder { color: color-mix(in srgb, var(--on-ink) 55%, transparent); }
.ns-palette.ns-palette-sidebar { left: var(--space-2); right: auto; transform: none; width: min(34rem, calc(100vw - 2rem)); top: calc(100% - var(--space-3)); z-index: var(--z-sheet); color: var(--ink); }
@media (max-width: 899px) { .ns-sidebar-search { padding: var(--space-3) 0 0; } .ns-palette.ns-palette-sidebar { left: 0; width: 100%; } }

/* Rows that open a record are clickable across their whole width. */
.ns-table tbody tr:has(td.ns-cell-primary a[href]) { cursor: pointer; }
.ns-table tbody tr:has(td.ns-cell-primary a[href]):hover { background: var(--tracing); }

/* The map, framed: imagery edge to edge inside a card. */
.ns-map-card { overflow: hidden; }
.ns-map.ns-map-framed { height: min(62vh, 560px); border: 0; border-radius: 0; }
.ns-map-legend { display: flex; gap: var(--space-4); font-size: 12px; color: var(--ink-soft); }
.ns-map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ns-map-key { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--dust-deep); }
.ns-map-key-pursuit { background: #f2b35c; }
.ns-map-key-office { border-radius: 3px; background: var(--ink); }
.ns-map-office span { display: block; width: 18px; height: 18px; border-radius: 4px; background: var(--ink); border: 3px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 0.45); }
.ns-map .leaflet-control-layers { border-radius: var(--radius-md); font-family: var(--font-sans); }

/* Directory (company-wide and per project): group tabs and a plain list. */
.ns-directory-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.ns-directory-title { margin: 0; font-size: 24px; font-weight: 700; color: var(--ink); }
.ns-directory-tabs { margin-bottom: var(--space-4); }
.ns-directory-tabs .ns-count { font-weight: 500; color: var(--ink-mute); font-size: 12px; }
.ns-directory-table td { vertical-align: middle; }
.ns-chevron { width: 1.5rem; text-align: right; color: var(--ink-mute); font-size: 18px; }
.ns-role-badge { display: inline-flex; align-items: center; gap: 4px; margin: 2px 4px 2px 0; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--clay-tint); color: var(--clay-deep); border: 1px solid color-mix(in srgb, var(--clay) 25%, transparent); font-size: 12px; font-weight: 600; }
.ns-inline-form { display: inline; }
.ns-role-remove { border: 0; background: none; padding: 0 0 0 2px; color: inherit; opacity: 0.5; cursor: pointer; font-size: 13px; line-height: 1; }
.ns-role-remove:hover { opacity: 1; }
.ns-popover { position: relative; }
.ns-popover > summary { list-style: none; }
.ns-popover > summary::-webkit-details-marker { display: none; }
.ns-popover-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: var(--z-sheet); width: min(24rem, 90vw); padding: var(--space-4); background: var(--paper); border: 1px solid var(--dust); border-radius: var(--radius-lg); box-shadow: var(--shadow-toast); }

/* Details: label over value, two columns, like a record sheet. */
.ns-details { margin-bottom: var(--space-6); }
.ns-details-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: var(--space-3); margin-bottom: var(--space-4); border-bottom: 1px solid var(--dust); }
.ns-details-head h2 { margin: 0; font-size: 20px; font-weight: 600; color: var(--ink); }
.ns-details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-8); margin: 0; }
.ns-detail dt { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.ns-detail dd { margin: 0; color: var(--ink-soft); }
.ns-detail-wide { grid-column: 1 / -1; }
.ns-detail-hint { color: var(--ink-mute); cursor: help; font-size: 12px; }
@media (max-width: 640px) { .ns-details-grid { grid-template-columns: minmax(0, 1fr); } }

/* The site map in a project header. */
.ns-job-head-map { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ns-map.ns-map-compact { width: 240px; height: 140px; border-radius: var(--radius-lg); }
.ns-map-missing { width: 240px; height: 140px; display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--space-3); border: 1.5px dashed var(--dust-deep); border-radius: var(--radius-lg); background: var(--tracing); }
@media (max-width: 720px) { .ns-job-head-map { width: 100%; align-items: stretch; } .ns-map.ns-map-compact, .ns-map-missing { width: 100%; } }
.ns-row-current { background: var(--clay-tint); }
.ns-row-warn { background: var(--clay-tint); }
.ns-row-warn .ns-badge { background: var(--clay); color: var(--paper, #fff); }

/* The project dashboard. */
.ns-dashboard-for { margin: calc(-1 * var(--space-3)) 0 var(--space-4); color: var(--ink-mute); }
.ns-dash-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.ns-whos { margin: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.ns-whos dt { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-mute); }
.ns-whos dd { margin: 2px 0 0; }

.ns-home-timeline { margin-bottom: var(--space-6); }
.ns-home-map { margin-top: var(--space-6); }
.ns-home-map .ns-map.ns-map-framed { height: min(50vh, 420px); }

.ns-map-filter { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: var(--space-3) var(--space-4); border: 0; border-bottom: 1px solid var(--dust); }
.ns-map-filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--dust); border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; color: var(--ink-soft); cursor: pointer; background: var(--paper); }
.ns-map-filter-chip:has(input:checked) { border-color: var(--ink-soft); color: var(--ink); }
.ns-map-filter-chip input { margin: 0; }
.ns-map-filter-static { cursor: default; }
.ns-phase-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.ns-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ns-table tr[hidden] { display: none; }

/* Jobwalk: uploads, the captures grid, the viewer. Phone first. */
.ns-filedrop-tall { padding: var(--space-8) var(--space-4); }
.ns-upload-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.ns-upload-list:empty { display: none; }
.ns-upload-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-3); font-size: 13px; }
.ns-upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ns-upload-meta { color: var(--ink-mute); white-space: nowrap; }
.ns-upload-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--tracing); overflow: hidden; }
.ns-upload-bar i { display: block; height: 100%; width: 0; background: var(--clay); transition: width 200ms ease; }
.ns-upload-list li[data-state=done] .ns-upload-bar i { background: #2fbf71; width: 100%; }
.ns-upload-list li[data-state=error] .ns-upload-meta { color: var(--clay-deep); }
.ns-capture-grid { list-style: none; margin: 0; padding: var(--space-3); display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: var(--space-3); }
.ns-shell a.ns-capture-link { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; }
.ns-capture-thumb { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border-radius: var(--radius-md); overflow: hidden; background: var(--tracing); border: 1px solid var(--dust); }
.ns-capture-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ns-capture-icon { font-size: 28px; color: var(--ink-mute); }
.ns-capture-note { padding: var(--space-3); font-size: 12px; line-height: 16px; color: var(--ink-soft); align-self: flex-start; }
.ns-capture-kind { position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; border-radius: var(--radius-pill); background: rgb(0 0 0 / 0.6); color: #fff; font-size: 11px; font-weight: 600; }
.ns-capture-meta { display: flex; flex-direction: column; min-width: 0; }
.ns-capture-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-capture-link:hover .ns-capture-thumb { border-color: var(--clay); }
.ns-viewer-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.ns-viewer { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--space-5); align-items: start; }
.ns-viewer-media { background: #0e1316; border-radius: var(--radius-lg); overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 18rem; }
.ns-viewer-media img, .ns-viewer-media video { display: block; max-width: 100%; max-height: 78vh; }
.ns-viewer-media video { width: 100%; }
.ns-viewer-media iframe { width: 100%; height: 78vh; border: 0; background: #fff; }
.ns-viewer-note { width: 100%; padding: var(--space-6); background: var(--paper); font-size: 16px; line-height: 24px; }
.ns-viewer-audio { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); padding: var(--space-8); color: #fff; }
.ns-viewer-audio audio { width: min(28rem, 90vw); }
.ns-viewer-side { display: flex; flex-direction: column; gap: var(--space-4); }
@media (max-width: 900px) { .ns-viewer { grid-template-columns: minmax(0, 1fr); } .ns-capture-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Address suggestions (Google Places) under a street field. */
.ns-address-field { position: relative; }
.ns-address-suggestions { position: absolute; left: 0; right: 0; top: 100%; z-index: var(--z-sheet); margin: 4px 0 0; padding: 4px; list-style: none; background: var(--paper); border: 1px solid var(--dust); border-radius: var(--radius-md); box-shadow: var(--shadow-toast); }
.ns-address-suggestions li { padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.ns-address-suggestions li[aria-selected=true], .ns-address-suggestions li:hover { background: var(--clay-tint); }
.ns-span-all { grid-column: 1 / -1; }
.ns-map.ns-map-compact.ns-map-link { cursor: pointer; }

/* The bid portal (what a sub sees): the GC's brand, light and plain. */
.ns-portal-body { background: var(--tracing); }
.ns-portal-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-5); background: var(--paper); border-bottom: 1px solid var(--dust); }
.ns-portal-brand { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 700; }
.ns-portal-logo { height: 28px; width: auto; }
.ns-shell a.ns-portal-bar-link { font-size: 13px; font-weight: 600; color: var(--link); text-decoration: none; }
.ns-portal { width: min(76rem, 100%); }
.ns-breadcrumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); font-size: 12px; color: var(--ink-mute); margin-bottom: var(--space-4); }
.ns-shell .ns-breadcrumbs a { color: var(--ink-mute); text-decoration: none; }
.ns-shell .ns-breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }
.ns-portal-title { font-size: 22px; margin: 0 0 var(--space-4); }
.ns-portal-card { background: var(--paper); border: 1px solid var(--dust); border-radius: var(--radius-lg); margin-bottom: var(--space-4); overflow: hidden; }
.ns-portal-card-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-3); margin: 0; padding: var(--space-3) var(--space-4); font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--dust); }
.ns-portal-card-body { padding: var(--space-4); margin: 0; }
.ns-portal-details { display: flex; gap: var(--space-5); padding: var(--space-4); align-items: flex-start; }
.ns-portal-facts { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-6); margin: 0; max-width: 48rem; }
.ns-portal-facts dt { font-size: 12px; color: var(--ink-mute); margin-bottom: 2px; }
.ns-portal-facts dd { margin: 0; font-size: 13px; }
.ns-portal-facts dd p { margin: 0 0 4px; }
.ns-portal-fact-wide { grid-column: 1 / -1; }
.ns-portal-map.ns-map { width: 220px; height: 140px; flex: none; }
.ns-portal-table th { font-size: 12px; }
.ns-portal-download { width: 2rem; text-align: right; }
.ns-shell .ns-portal-download a { text-decoration: none; font-size: 16px; color: var(--ink-soft); }
.ns-portal-submit { display: flex; justify-content: flex-end; }
.ns-btn.ns-btn-yes { background: #1f8a5b; border-color: #1f8a5b; color: #fff; }
.ns-btn.ns-btn-no { background: var(--ink-soft); border-color: var(--ink-soft); color: #fff; }
@media (max-width: 720px) { .ns-portal-details { flex-direction: column; } .ns-portal-facts { grid-template-columns: minmax(0, 1fr); } .ns-portal-map.ns-map { width: 100%; } }

/* Bidding RFI thread, the printable report, compact capture grid. */
.ns-thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.ns-thread li { padding: var(--space-3); border-radius: var(--radius-md); background: var(--tracing); border-left: 3px solid var(--dust-deep); }
.ns-thread li.ns-thread-sent { border-left-color: var(--clay); }
.ns-thread li.ns-thread-received { border-left-color: #2fbf71; background: var(--paper); border: 1px solid var(--dust); border-left-width: 3px; }
.ns-thread li p { margin: 6px 0 0; }
.ns-capture-grid.ns-capture-grid-compact { grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); }
.ns-print { background: #fff; color: #111; max-width: 50rem; margin: 0 auto; padding: 2rem; font-family: var(--font-sans); }
.ns-print-hint { text-align: right; }
.ns-report-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #111; padding-bottom: 0.75rem; margin-bottom: 1.25rem; }
.ns-report-head h1 { margin: 0.25rem 0; font-size: 1.6rem; }
.ns-report-item { break-inside: avoid; border-bottom: 1px solid #ccc; padding: 0.75rem 0; }
.ns-report-item h2 { font-size: 1.05rem; margin: 0 0 0.25rem; }
.ns-report-item h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: #555; margin: 0.6rem 0 0.2rem; }
.ns-report-status { font-size: 0.75rem; font-weight: 600; border: 1px solid #999; border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
@media print { .ns-print-hint { display: none; } .ns-print { padding: 0; } }

/* Jobwalk processing status and review */
.ns-capture-status { position: absolute; right: 6px; top: 6px; padding: 1px 6px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; background: var(--tracing); color: var(--ink-soft); border: 1px solid var(--dust); }
.ns-status-needs_review { background: var(--sand-tint); color: var(--ink); border-color: var(--dust); }
.ns-status-failed { background: var(--clay); color: #fff; border-color: var(--clay); }
.ns-status-processing, .ns-status-uploaded { background: var(--tracing); color: var(--ink-soft); }
.ns-review-jump { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-2); margin-bottom: var(--space-4); position: sticky; top: 0; background: var(--paper); z-index: 2; }
.ns-review-jump .ns-chip-btn { white-space: nowrap; }
.ns-review-group { margin-bottom: var(--space-6); }
.ns-review-heading { font-size: 16px; margin: 0 0 var(--space-3); }
.ns-review-trade-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.ns-review-item { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: var(--space-4); padding: var(--space-3); border: 1px solid var(--dust); border-radius: var(--radius-md); margin-bottom: var(--space-3); background: var(--paper); }
.ns-review-media img, .ns-review-media video { width: 100%; border-radius: var(--radius-sm); display: block; }
.ns-review-media audio { width: 100%; }
.ns-review-reason { margin: 0; color: var(--ink-soft); }
.ns-review-text p { white-space: pre-wrap; font-size: 13px; margin: var(--space-2) 0 0; }
.ns-review-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ns-tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); border: 1px solid var(--dust); font-size: 12px; min-height: 32px; }
.ns-tag-ai { border-style: dashed; }
.ns-review-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.ns-review-notes summary { cursor: pointer; }
.ns-review-note-form { margin: var(--space-2) 0; }
.ns-review-actions form { display: inline; }
@media (max-width: 700px) { .ns-review-item { grid-template-columns: minmax(0, 1fr); } }
