:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #556159;
  --paper: #f5f2e9;
  --panel: #fffdf8;
  --line: #deddd5;
  --soft-line: #eceae2;
  --green: #245d46;
  --green-bright: #9cc6a5;
  --green-soft: #e6f0e7;
  --amber: #7f4e16;
  --amber-soft: #f6ead7;
  --red: #a54d3c;
  --red-soft: #f6e3df;
  --blue: #456b7f;
  --blue-soft: #e4edf1;
  --shadow: 0 18px 50px rgba(37, 48, 41, 0.09);
  --radius: 18px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(36, 93, 70, 0.24);
  outline-offset: 2px;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--green);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  font-family: var(--serif);
  font-size: 23px;
  font-style: italic;
}

.large-mark {
  width: 54px;
  height: 54px;
  margin-bottom: 40px;
  border-radius: 15px;
  font-size: 31px;
}

.primary-button,
.secondary-button,
.complete-button,
.text-button,
.icon-button {
  border: 0;
  border-radius: 12px;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}

.primary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  color: #fff;
  background: var(--green);
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(36, 93, 70, 0.18);
}

.primary-button:hover {
  background: #184c37;
  transform: translateY(-1px);
}

.primary-button.wide {
  width: 100%;
}

.secondary-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
}

.access-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 0.92fr) minmax(520px, 1.08fr);
  overflow: hidden;
}

.access-card {
  display: flex;
  max-width: 620px;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  padding: 72px clamp(48px, 8vw, 124px);
  background: var(--panel);
}

.access-card h1 {
  max-width: 500px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 5vw, 72px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.access-copy {
  max-width: 480px;
  margin: 28px 0 36px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.privacy-note {
  margin: 18px 0 0;
  color: #8a928d;
  font-size: 12px;
  text-align: center;
}

.access-credit {
  margin: 24px 0 0;
  color: #8a928d;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.access-credit strong {
  color: var(--green);
  font-weight: 850;
}

.password-cue {
  max-width: 480px;
  padding: 22px 24px;
  border: 1px solid var(--amber-soft);
  border-radius: var(--radius);
  background: var(--amber-soft);
}

.password-cue > p:not(.eyebrow) {
  margin: 0 0 16px;
  color: #6b5636;
  font-size: 13px;
  line-height: 1.5;
}

.password-cue form {
  display: flex;
  align-items: end;
  gap: 12px;
}

.password-cue label {
  flex: 1;
}

.password-cue input {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.password-cue .primary-button {
  white-space: nowrap;
}

.access-art {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 22%, rgba(176, 210, 186, 0.75), transparent 32%),
    radial-gradient(circle at 75% 70%, rgba(226, 191, 147, 0.6), transparent 30%),
    linear-gradient(140deg, #174332, #2d674c 48%, #658f6d);
}

.access-art::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  content: "";
  mask-image: linear-gradient(to bottom right, black, transparent);
}

.orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.orbit-one {
  top: 8%;
  left: 10%;
  width: 620px;
  height: 620px;
}

.orbit-two {
  right: -180px;
  bottom: -140px;
  width: 620px;
  height: 620px;
}

.mini-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 25px 80px rgba(8, 35, 24, 0.28);
  backdrop-filter: blur(15px);
}

.mini-card strong {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
}

.mini-card > span:last-child,
.card-follow span {
  color: var(--muted);
  font-size: 12px;
}

.mini-label {
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.card-project {
  top: 24%;
  left: 14%;
  width: min(390px, 66%);
  transform: rotate(-2deg);
}

.card-follow {
  top: 51%;
  right: 11%;
  width: min(340px, 58%);
  flex-direction: row;
  align-items: center;
  transform: rotate(2deg);
}

.card-follow div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-follow strong {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 750;
}

.status-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.status-dot.attention {
  background: var(--amber);
  box-shadow: 0 0 0 6px var(--amber-soft);
}

.card-value {
  bottom: 16%;
  left: 19%;
  width: min(290px, 50%);
  transform: rotate(-1deg);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 238px minmax(0, 1fr);
}

/* These two hold only fixed-position overlays (detail panel, entity
   popover). display: contents keeps them out of the grid's own item/track
   accounting entirely, rather than relying on an empty box collapsing to
   zero size within an implicit row. */
#detail-root,
#entity-root {
  display: contents;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 28px 20px 24px;
  border-right: 1px solid var(--line);
  background: #eeece3;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.brand span {
  color: var(--muted);
  font-size: 11px;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 48px;
}

.nav-item {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  color: #5e6862;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.nav-item.active {
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(36, 93, 70, 0.16);
}

.nav-item svg {
  width: 19px;
  height: 19px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 18px 12px 0;
  border-top: 1px solid #d8d6ce;
}

.sidebar-foot p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.demo-pill {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  min-height: 118px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px clamp(28px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 242, 233, 0.88);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(29px, 3vw, 42px);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.example-state {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #d1d3ca;
  border-radius: 50%;
  color: var(--green);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.workspace-content {
  max-width: 1540px;
  margin: 0 auto;
  padding: 34px clamp(28px, 4vw, 58px) 72px;
}

.workspace-footer {
  display: flex;
  max-width: 1540px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 26px clamp(28px, 4vw, 58px) 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.gpc-signature {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gpc-signature > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gpc-signature strong {
  color: var(--ink);
  font-size: 11px;
}

.gpc-signature small {
  color: var(--muted);
  font-size: 9px;
}

.gpc-monogram {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #c9d7ce;
  border-radius: 9px;
  color: var(--green);
  background: var(--green-soft);
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
}

.demo-guide {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.8fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 22px;
  padding: 24px 26px;
}

.demo-guide h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
}

.demo-guide p:not(.eyebrow) {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.demo-question {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border-left: 3px solid var(--green);
  background: #f8f6f0;
}

.demo-question strong {
  color: var(--green);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.demo-question span {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.35;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  position: relative;
  display: flex;
  min-height: 132px;
  flex-direction: column;
  justify-content: center;
  padding: 23px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.78);
}

.metric-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  background: transparent;
  content: "";
}

.metric-card.accent::after {
  background: var(--green);
}

.metric-card.warning::after {
  background: var(--red);
}

.metric-card > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-card strong {
  margin: 9px 0 6px;
  font-family: var(--serif);
  font-size: clamp(27px, 2.5vw, 38px);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.metric-card small {
  color: var(--muted);
  font-size: 11px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 4px 16px rgba(37, 48, 41, 0.03);
}

.project-panel {
  margin-top: 22px;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 26px 18px;
}

.panel-heading h2,
.detail-section-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.panel-heading h2 {
  font-size: 28px;
}

.result-count {
  color: var(--muted);
  font-size: 12px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 170px 180px;
  gap: 10px;
  padding: 0 26px 20px;
}

.search-box {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f9f8f3;
}

.search-box svg {
  width: 18px;
  color: #8a928d;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

.filter-bar select {
  min-height: 44px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #f9f8f3;
  font-size: 12px;
}

.project-table-head,
.project-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) minmax(130px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) 110px 145px 22px;
  column-gap: 16px;
  align-items: center;
}

.project-table-head {
  padding: 11px 26px 10px 38px;
  border-top: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
  color: var(--muted);
  background: #f8f6f0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.project-table-head span:nth-child(5) {
  text-align: right;
}

.project-table-head [data-sort] {
  cursor: pointer;
  user-select: none;
  transition: color 0.12s ease;
}

.project-table-head [data-sort]:hover {
  color: var(--ink);
}

.project-table-head [data-sort]:focus-visible {
  color: var(--ink);
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 3px;
}

.project-row {
  position: relative;
  width: 100%;
  min-height: 76px;
  padding: 12px 26px 12px 38px;
  border: 0;
  border-bottom: 1px solid var(--soft-line);
  background: #fffdf8;
  text-align: left;
}

.project-row:last-child {
  border-bottom: 0;
}

.project-row:hover {
  background: #faf8f1;
}

.health-bar {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 22px;
  width: 4px;
  border-radius: 99px;
  background: #b7c1b9;
}

.health-bar.healthy {
  background: #75a37d;
}

.health-bar.attention {
  background: #d49a49;
}

.health-bar.overdue {
  background: #c45e4c;
}

.health-bar.closed {
  background: #9ca4a0;
}

.project-identity,
.quote-row > div,
.party-list article > div,
.follow-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.project-identity strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-name-link {
  display: block;
  overflow: hidden;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.project-name-link:hover strong {
  text-decoration: underline;
}

.record-open-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.record-open-link:hover {
  text-decoration: underline;
}

.project-identity small,
.party-list span,
.quote-row span,
.follow-copy small {
  color: var(--muted);
  font-size: 11px;
}

.project-stage,
.follow-date {
  color: #52605a;
  font-size: 12px;
}

.follow-up-cell {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.follow-state {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.follow-state.overdue {
  color: var(--red);
}

.follow-state.attention {
  color: var(--amber);
}

.follow-date {
  white-space: nowrap;
}

.follow-date.overdue {
  color: var(--red);
  font-weight: 750;
}

.follow-date.attention {
  color: var(--amber);
  font-weight: 700;
}

.manufacturer-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.manufacturer-stack > span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #496258;
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 700;
}

.party-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.party-stack > span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #2d4a58;
  background: var(--blue-soft);
  font-size: 10px;
  font-weight: 700;
}

.party-stack .entity-link:hover,
.party-stack .entity-link:focus-visible {
  color: #fff;
  text-decoration: none;
  background: var(--blue);
}

.project-value {
  font-family: var(--serif);
  font-size: 15px;
  text-align: right;
  white-space: nowrap;
}

.row-arrow {
  display: flex;
  color: #9ba19d;
}

.row-arrow svg {
  width: 17px;
}

.empty-state {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.section-intro {
  max-width: 640px;
  margin: 0 0 24px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.5;
}

.follow-panel {
  overflow: hidden;
}

.follow-list {
  border-top: 1px solid var(--soft-line);
}

.follow-item {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 21px 26px;
  border-bottom: 1px solid var(--soft-line);
}

.follow-item:last-child {
  border-bottom: 0;
}

.follow-item.is-overdue {
  box-shadow: inset 4px 0 0 var(--red);
}

.date-block {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 8px 5px;
  border-radius: 10px;
  background: #f1efe7;
}

.date-block span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.date-block strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.project-link {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.follow-copy p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.due-label {
  align-self: flex-start;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.complete-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 800;
}

.complete-button svg {
  width: 16px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.review-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.review-top {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.severity {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
}

.severity.high {
  color: var(--red);
  background: var(--red-soft);
}

.severity.medium {
  color: var(--amber);
  background: var(--amber-soft);
}

.severity.low {
  color: var(--blue);
  background: var(--blue-soft);
}

.review-card h2 {
  margin: 28px 0 10px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
}

.review-card p {
  min-height: 56px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.review-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.evidence-panel {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
  align-items: center;
  margin-top: 18px;
  padding: 30px;
  background: var(--green);
  color: #fff;
}

.evidence-panel .eyebrow {
  color: #b9dac2;
}

.evidence-panel h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
}

.evidence-panel > p {
  margin: 0;
  color: #d6e6db;
  font-size: 13px;
  line-height: 1.7;
}

.system-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.boundary-card,
.architecture-card,
.build-story-card,
.reset-card {
  padding: 28px;
}

.boundary-card h2,
.architecture-card h2,
.build-story-card h2,
.reset-card h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

.boundary-card > p:not(.eyebrow),
.reset-card > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 650;
}

.check-list svg {
  width: 17px;
  color: var(--green);
}

.layer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-top: 1px solid var(--soft-line);
}

.layer > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 850;
}

.layer > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.layer strong {
  font-size: 12px;
}

.layer small {
  color: var(--muted);
  font-size: 10px;
}

.build-story-card {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.7fr);
  gap: 42px;
  align-items: center;
}

.build-story-head > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.build-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.build-step {
  display: flex;
  min-height: 142px;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--soft-line);
  border-radius: 14px;
  background: #f8f6f0;
}

.build-step > span {
  color: var(--green);
  font-family: var(--serif);
  font-size: 22px;
}

.build-step > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.build-step strong {
  font-size: 12px;
}

.build-step small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.reset-card {
  grid-column: 1 / -1;
}

.mobile-nav {
  display: none;
}

.detail-scrim {
  position: fixed;
  z-index: 30;
  inset: 0;
  background: rgba(20, 30, 24, 0.34);
  backdrop-filter: blur(2px);
}

.detail-panel {
  position: fixed;
  z-index: 31;
  top: 0;
  right: 0;
  display: flex;
  width: min(620px, 92vw);
  height: 100vh;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -25px 0 70px rgba(20, 30, 24, 0.16);
  animation: slide-in 180ms ease-out;
}

@keyframes slide-in {
  from {
    transform: translateX(28px);
    opacity: 0;
  }
}

.detail-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 30px 24px;
  border-bottom: 1px solid var(--line);
}

.detail-header h2 {
  margin: 14px 0 6px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.detail-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.status-badge {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.status-badge.lost {
  color: #626b66;
  background: #e9e9e5;
}

.status-badge.revised {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-badge.accepted,
.status-badge.won {
  color: var(--green);
  background: var(--green-soft);
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #667069;
  background: #f0eee7;
}

.icon-button:hover {
  color: var(--ink);
  background: #e7e4dc;
}

.icon-button.small {
  width: 32px;
  height: 32px;
}

.icon-button.small svg {
  width: 16px;
}

.detail-scroll {
  overflow-y: auto;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 22px 30px;
  border-bottom: 1px solid var(--line);
  background: #f8f6f0;
}

.detail-summary > div {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 18px;
  border-right: 1px solid var(--line);
}

.detail-summary > div:not(:first-child) {
  padding-left: 18px;
}

.detail-summary > div:last-child {
  border-right: 0;
}

.detail-summary span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.detail-summary strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
}

.detail-section {
  padding: 28px 30px;
  border-bottom: 1px solid var(--line);
}

.detail-section-head {
  margin-bottom: 17px;
}

.detail-section-head h3 {
  font-size: 23px;
}

.quote-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.quote-table-head,
.quote-row {
  display: grid;
  grid-template-columns: 1fr 120px 100px;
  gap: 12px;
  align-items: center;
}

.quote-table-head {
  padding: 10px 15px;
  border-bottom: 1px solid var(--soft-line);
  color: #8a928d;
  background: #f8f6f0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.quote-table-head span:nth-child(2) {
  text-align: right;
}

.quote-row {
  padding: 15px;
  border-bottom: 1px solid var(--soft-line);
}

.quote-row:last-child {
  border-bottom: 0;
}

.quote-row > div:nth-child(2) {
  align-items: flex-end;
}

.quote-row strong {
  font-size: 12px;
}

.quote-list-empty {
  padding: 20px 15px;
  color: var(--muted);
  font-size: 12px;
}

.quote-history-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0 10px;
}

.inactive-quotes-link {
  cursor: pointer;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inactive-quotes-link:hover,
.inactive-quotes-link:focus-visible {
  color: var(--ink);
}

.inactive-quotes-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 3px;
}

.inactive-quote-row {
  display: grid;
  grid-template-columns: 1fr 110px 74px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
}

.inactive-quote-row:not(:last-child) {
  border-bottom: 1px solid var(--soft-line);
}

.inactive-quote-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.inactive-quote-row > div:nth-child(2) {
  align-items: flex-end;
  text-align: right;
}

.inactive-quote-row strong {
  font-size: 12px;
}

.inactive-quote-row span:not(.status-badge) {
  color: var(--muted);
  font-size: 11px;
}

.inactive-quote-row .status-badge {
  justify-self: end;
}

.party-list {
  display: grid;
  gap: 10px;
}

.party-list article {
  display: flex;
  align-items: center;
  gap: 12px;
}

.party-initial {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
  font-family: var(--serif);
  font-size: 16px;
}

.party-list strong {
  font-size: 12px;
}

.entity-link {
  cursor: pointer;
  border-radius: 3px;
}

.entity-link:hover,
.entity-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.entity-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.manufacturer-stack .entity-link:hover,
.manufacturer-stack .entity-link:focus-visible {
  color: #fff;
  text-decoration: none;
  background: var(--green);
}

.entity-popover-scrim {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: rgba(20, 30, 24, 0.34);
  backdrop-filter: blur(2px);
}

.entity-popover {
  position: fixed;
  z-index: 41;
  top: 50%;
  left: 50%;
  display: flex;
  overflow: hidden;
  width: min(420px, 90vw);
  max-height: min(520px, 80vh);
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 30px 70px rgba(20, 30, 24, 0.24);
  transform: translate(-50%, -50%);
  animation: popover-in 160ms ease-out;
}

/* Distinct from .detail-panel's slide-in: that keyframe's `from` transform
   (translateX only) would replace this element's centering transform
   entirely for the animation's duration, making it jump in from a
   top-left-anchored position instead of growing in place. */
@keyframes popover-in {
  from {
    transform: translate(-50%, -50%) translateY(10px);
    opacity: 0;
  }
}

.entity-popover-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.entity-popover-kind {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.entity-popover-head h3 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.entity-popover-count {
  margin: 14px 22px 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.entity-popover-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0 10px 10px;
}

.entity-project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  text-align: left;
}

.entity-project-row:hover {
  background: var(--green-soft);
}

.entity-project-row svg {
  width: 16px;
  color: #9ba19d;
}

.entity-project-row-current {
  cursor: default;
  background: var(--soft-line);
}

/* Both classes together outrank the single-class .entity-project-row:hover
   on real specificity (0,3,0 vs 0,2,0), not source order -- this stays the
   disabled fill no matter where either rule later moves in the file. */
.entity-project-row.entity-project-row-current:hover {
  background: var(--soft-line);
}

.entity-project-here {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.timeline {
  position: relative;
}

.timeline::before {
  position: absolute;
  top: 8px;
  bottom: 10px;
  left: 5px;
  width: 1px;
  background: var(--line);
  content: "";
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 11px 1fr auto;
  gap: 13px;
  padding: 0 0 20px;
}

.timeline-dot {
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 4px;
  border: 3px solid var(--panel);
  border-radius: 50%;
  background: #aab1ac;
  box-shadow: 0 0 0 1px #aab1ac;
}

.timeline-item.open .timeline-dot {
  background: var(--amber);
  box-shadow: 0 0 0 1px var(--amber);
}

.timeline-item > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-item > div > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.timeline-item p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.follow-form-section {
  padding-bottom: 42px;
}

#follow-up-form {
  display: grid;
  gap: 14px;
}

#follow-up-form label {
  display: grid;
  gap: 7px;
}

#follow-up-form label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#follow-up-form input,
#follow-up-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fbfaf6;
}

#follow-up-form textarea {
  resize: vertical;
}

#follow-up-form .primary-button {
  justify-self: start;
}

/* Adding the Contacts column made the full 7-track desktop grid wider than
   .project-panel's available width (which has overflow: hidden, so the
   overflow clips rather than scrolls) anywhere below roughly 1460px
   (accounting for the vertical scrollbar's ~17px) -- common laptop widths
   (1366, 1440) included. This restores the 6-column layout (Manufacturers
   shown, Contacts hidden) down to the 1300px breakpoint below. */
@media (max-width: 1480px) {
  .project-table-head,
  .project-row {
    grid-template-columns: minmax(220px, 1.7fr) minmax(130px, 1fr) minmax(150px, 1fr) 110px 145px 22px;
    column-gap: 16px;
  }

  .project-table-head span:nth-child(4),
  .party-stack {
    display: none;
  }
}

/* The 6-column layout above (Manufacturers, no Contacts) has its own,
   independent minimum width -- it does not actually fit down to the old
   1120px breakpoint either (verified: needs roughly 1280px). That gap
   pre-dates the Contacts column entirely; it was never exercised before
   because nothing forced this exact viewport range under test. Closing it
   here rather than leaving a still-clipping "fixed" state. */
@media (max-width: 1300px) {
  .project-table-head,
  .project-row {
    grid-template-columns: minmax(210px, 1.5fr) minmax(130px, 1fr) 105px 130px 22px;
    column-gap: 14px;
  }

  .project-table-head span:nth-child(3),
  .project-table-head span:nth-child(4),
  .manufacturer-stack,
  .party-stack {
    display: none;
  }
}

@media (max-width: 1120px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .review-grid {
    grid-template-columns: 1fr;
  }

  .review-card p {
    min-height: 0;
  }
}

@media (max-width: 860px) {
  .access-shell {
    grid-template-columns: 1fr;
  }

  .access-card {
    max-width: none;
    min-height: 100vh;
    padding: 50px 32px;
  }

  .access-art {
    display: none;
  }

  .password-cue form {
    flex-direction: column;
    align-items: stretch;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    min-height: 100vh;
    padding-bottom: 78px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 25;
    right: 12px;
    bottom: 10px;
    left: 12px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    padding: 6px;
    border: 1px solid rgba(222, 221, 213, 0.9);
    border-radius: 18px;
    background: rgba(255, 253, 248, 0.94);
    box-shadow: 0 18px 45px rgba(27, 42, 33, 0.18);
    backdrop-filter: blur(18px);
  }

  .mobile-nav .nav-item {
    min-height: 52px;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    padding: 2px;
    font-size: 8px;
  }

  .mobile-nav .nav-item.active {
    color: var(--green);
    background: var(--green-soft);
    box-shadow: none;
  }

  .mobile-nav .nav-item svg {
    width: 16px;
    height: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    min-height: 98px;
    padding: 22px 20px;
  }

  .topbar > div:first-child {
    min-width: 0;
  }

  .topbar h1 {
    font-size: 30px;
    overflow-wrap: anywhere;
  }

  .top-actions {
    justify-content: space-between;
    width: 100%;
  }

  .demo-guide {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .build-story-card,
  .build-steps {
    grid-template-columns: 1fr;
  }

  .build-story-card {
    gap: 24px;
  }

  .build-step {
    min-height: 0;
  }

  .workspace-content {
    padding: 22px 16px 100px;
  }

  .workspace-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px 20px 106px;
  }

  .filter-bar {
    grid-template-columns: 1fr 1fr;
    padding: 0 18px 18px;
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .system-grid {
    grid-template-columns: 1fr;
  }

  .reset-card {
    grid-column: auto;
  }
}

/* The project table's own minimum width (the 5-track compact grid, 717px of
   tracks+gaps+row padding) doesn't actually fit once the sidebar is still
   showing (238px) down to about 1039px viewport width -- confirmed by
   adversary review: at 900-1000px the table needs ~717px but only has
   roughly 590-680px available, and .project-panel's overflow:hidden clips
   the rest rather than scrolling. This card layout already exists for the
   truly narrow (<=860px, no-sidebar) case; it just needs to start earlier,
   decoupled from the sidebar/mobile-nav switch above (which stays at 860px
   -- this is a narrower, table-specific breakpoint, not a full mobile
   layout change). */
@media (max-width: 1060px) {
  .project-table-head {
    display: none;
  }

  .project-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
    min-height: 96px;
    padding: 17px 42px 17px 32px;
  }

  .project-stage,
  .manufacturer-stack,
  .party-stack {
    display: none;
  }

  .project-value {
    grid-column: 2;
    grid-row: 1;
  }

  .follow-up-cell {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .row-arrow {
    position: absolute;
    top: 38px;
    right: 18px;
  }

  .health-bar {
    left: 17px;
  }
}

@media (max-width: 560px) {
  .access-card h1 {
    font-size: 48px;
  }

  .large-mark {
    margin-bottom: 50px;
  }

  .top-actions .avatar {
    width: 36px;
    height: 36px;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .metric-card {
    min-height: 118px;
    padding: 16px;
  }

  .metric-card strong {
    font-size: 25px;
  }

  .metric-card small {
    line-height: 1.35;
  }

  .panel-heading {
    padding: 21px 18px 16px;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .search-box {
    grid-column: auto;
  }

  .follow-item {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
  }

  .complete-button {
    grid-column: 2;
    justify-self: start;
  }

  .evidence-panel {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .detail-panel {
    width: 100%;
  }

  .detail-header {
    padding: 22px 20px;
  }

  .detail-header h2 {
    font-size: 29px;
  }

  .detail-summary {
    padding: 18px 20px;
  }

  .detail-summary > div {
    padding-right: 9px;
  }

  .detail-summary > div:not(:first-child) {
    padding-left: 9px;
  }

  .detail-summary strong {
    font-size: 14px;
  }

  .detail-section {
    padding: 24px 20px;
  }

  .quote-row {
    grid-template-columns: 1fr auto;
  }

  .quote-table-head {
    display: none;
  }

  .quote-row > .status-badge {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* Quote Generation (Module 3) and Orders and Acknowledgments (Module 4) */

.quote-builder-panel,
.quotes-history-panel,
.order-resolve-panel,
.orders-history-panel {
  margin-bottom: 22px;
}

.quote-builder-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  padding: 0 26px 18px;
}

.form-hint {
  margin: 0 26px 18px;
  color: var(--muted);
  font-size: 12px;
}

.stack-form label {
  display: grid;
  gap: 7px;
}

.stack-form label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stack-form input,
.stack-form select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fbfaf6;
}

.stack-form .primary-button,
.stack-form .secondary-button {
  align-self: end;
}

.quote-line-table {
  margin: 0 26px 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.quote-line-head,
.quote-line-row {
  display: grid;
  grid-template-columns: 90px 1.4fr 60px 100px 110px 36px;
  gap: 10px;
  align-items: center;
  padding: 11px 15px;
  border-bottom: 1px solid var(--soft-line);
  font-size: 12px;
}

.quote-line-head {
  color: #8a928d;
  background: #f8f6f0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.quote-line-row:last-of-type {
  border-bottom: 0;
}

.quote-line-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  background: var(--green-soft);
  font-family: var(--serif);
  font-size: 16px;
}

.quote-builder-panel form > .primary-button {
  margin: 0 26px 26px;
}

.record-table {
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.record-table-head,
.record-row {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 14px 26px;
  border-bottom: 1px solid var(--soft-line);
}

.record-table-head {
  color: var(--muted);
  background: #f8f6f0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.record-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--soft-line);
  color: inherit;
  background: none;
  font: inherit;
  text-align: left;
}

.record-row[data-project-id] {
  cursor: pointer;
}

.record-row[data-project-id]:hover {
  background: #f8f6f0;
}

.record-row span {
  font-size: 12px;
}

.record-row small {
  color: var(--muted);
  font-size: 10px;
}

.quote-columns {
  grid-template-columns: 1.3fr 1.4fr 1fr 110px 100px;
}

.order-columns {
  grid-template-columns: 1.3fr 1.4fr 1fr 110px 110px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 26px 18px;
}

.compare-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8f6f0;
}

.compare-cell span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.compare-cell strong {
  font-family: var(--serif);
  font-size: 20px;
}

.compare-cell small {
  color: var(--muted);
  font-size: 11px;
}

.match-note {
  margin: 0 26px 18px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.discrepancy-list {
  display: grid;
  gap: 8px;
  margin: 0 26px 18px;
}

.discrepancy-item {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--amber-soft);
  border-radius: 10px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
}

.resolve-order-form {
  padding: 0 26px 26px;
}

@media (max-width: 900px) {
  .quote-builder-row,
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .quote-line-head {
    display: none;
  }

  .quote-line-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "code qty"
      "description description"
      "unit total"
      "remove remove";
  }

  .record-table-head {
    display: none;
  }

  .record-row.quote-columns,
  .record-row.order-columns {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
