/* Shared components used by imported VietAlpha engineering notes. */

.timeline-table,
.diff-table {
  width: 100%;
  background: var(--manilla);
  border-collapse: collapse;
  margin: 32px 0;
  font-family: var(--serif);
}

.timeline-table thead th,
.diff-table thead th {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--stone);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bone);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.timeline-table tbody td,
.diff-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--bone);
  font-size: 15px;
  color: var(--ink);
  vertical-align: top;
}

.timeline-table tbody tr:last-child td,
.diff-table tbody tr:last-child td {
  border-bottom: 0;
}

.timeline-table td.date-col {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--stone);
  white-space: nowrap;
  width: 160px;
}

.timeline-table td.event-col strong {
  display: block;
  margin-bottom: 3px;
}

.timeline-table td.event-col .sub {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--stone);
}

.diff-table thead th:first-child {
  width: 40%;
}

.diff-table thead th.after-col {
  color: var(--crail);
}

.diff-table .aspect {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.diff-table .before-cell {
  color: var(--stone);
  font-size: 14px;
}

.diff-table .after-cell {
  font-size: 14px;
}

.benchmark-table .label-col {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  width: 38%;
}

.eyebrow-dot {
  margin: 0 8px;
  color: var(--bone);
}

.article-series-nav {
  max-width: 960px;
  margin: 72px auto 0;
  padding: 32px 24px 56px;
  border-top: 1px solid var(--bone);
  font-family: var(--sans);
}

.article-series-nav a {
  text-decoration: none;
}

.article-series-kicker {
  margin: 0 0 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}

.article-series-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.article-nav-card {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--bone);
  background: var(--manilla);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.article-nav-card:hover {
  border-color: var(--crail);
  background: var(--manilla-deep);
}

.article-nav-card[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.article-nav-label {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stone);
}

.article-nav-title {
  display: block;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.28;
  color: var(--ink);
}

.article-series-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--bone);
}

.article-series-link {
  min-height: 92px;
  padding: 14px;
  background: var(--paper-cream);
  color: var(--ink);
}

.article-series-link:hover {
  background: var(--manilla);
}

.article-series-link.is-current {
  background: var(--manilla);
  box-shadow: inset 0 0 0 2px var(--crail);
}

.article-series-step {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--stone);
}

.article-series-title {
  display: block;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.25;
  color: var(--ink);
}

.pipeline {
  background: var(--manilla);
  border: 1px solid var(--bone);
  padding: 28px 24px;
  margin: 32px 0;
  font-family: var(--sans);
}

.pipeline-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.pipeline-row:last-child {
  margin-bottom: 0;
}

.pipe-step {
  flex: 1;
  background: var(--paper-cream);
  border: 1px solid var(--bone);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink);
}

.pipe-step.fast {
  border-left: 3px solid var(--olive);
}

.pipe-step.slow {
  border-left: 3px solid var(--crail);
}

.pipe-step .step-label {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stone);
}

.pipe-arrow {
  font-family: var(--sans);
  font-size: 18px;
  color: var(--stone);
  flex-shrink: 0;
}

.pipe-gate {
  background: var(--paper-cream);
  border: 1px solid var(--crail);
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  color: var(--ink);
  flex-shrink: 0;
  width: 120px;
}

.pipe-legend {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--stone);
}

.pipe-legend span::before {
  display: inline-block;
  width: 12px;
  height: 12px;
  content: "";
  margin-right: 6px;
  vertical-align: -1px;
}

.pipe-legend .fast-key::before {
  background: var(--olive);
}

.pipe-legend .slow-key::before {
  background: var(--crail);
}

.pipeline-diagram {
  background: var(--manilla);
  border: 1px solid var(--bone);
  padding: 40px 32px;
  margin: 40px 0 8px;
  position: relative;
}

.pipeline-diagram-title {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--stone);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 32px;
}

.pipeline-stages {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.pipeline-stages::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: linear-gradient(to bottom, var(--crail), var(--bone));
}

.pipeline-stage {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 14px 0;
  position: relative;
}

.stage-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper-cream);
  border: 2px solid var(--crail);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--crail);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.pipeline-stage.terminal .stage-number {
  background: var(--crail);
  color: var(--manilla);
  border-color: var(--crail);
}

.stage-content {
  padding-top: 6px;
}

.stage-name {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.stage-desc {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--stone);
  margin-top: 2px;
  line-height: 1.4;
}

.pipeline-caption {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--stone);
  margin-top: 12px;
  line-height: 1.5;
}

.efficiency-card {
  max-width: 700px;
  width: 100%;
  background: var(--manilla);
  border: 1px solid var(--bone);
  padding: 48px 48px 40px;
  margin: 40px 0;
  font-family: var(--sans);
}

.efficiency-pipe {
  display: flex;
  flex-direction: column;
}

.efficiency-stage,
.eff-conn {
  display: grid;
  grid-template-columns: 120px 1fr 130px;
  align-items: center;
  gap: 20px;
}

.eff-slbl .eff-snum {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 5px;
}

.eff-slbl .eff-sname {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

.eff-track {
  height: 48px;
  background: var(--manilla-deep);
  position: relative;
  overflow: hidden;
}

.eff-fill {
  height: 100%;
  will-change: width;
}

.eff-fill.s1 {
  width: 0;
  border-left: 4px solid var(--stone);
}

.eff-fill.s2 {
  width: 0;
  background: var(--crail);
  opacity: 0.8;
  animation: growFull 1s 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.eff-fill.s3 {
  width: 0;
  background: var(--olive);
  opacity: 0.8;
  animation: growHalf 1s 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes growFull {
  to { width: 100%; }
}

@keyframes growHalf {
  to { width: 50.1%; }
}

.eff-sval {
  text-align: right;
}

.eff-sval .vbig {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.eff-sval .vsub {
  font-size: 11px;
  color: var(--stone);
  line-height: 1.4;
}

.eff-conn {
  padding: 4px 0;
}

.eff-conn-line-col {
  display: flex;
  justify-content: center;
}

.eff-conn-vline {
  width: 1px;
  height: 52px;
  background: var(--bone);
}

.eff-conn-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 0 8px;
  gap: 2px;
}

.eff-conn-step {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eff-conn-rate {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}

.eff-conn-note {
  font-size: 11px;
  line-height: 1.3;
  opacity: 0.8;
}

.eff-crail {
  color: var(--crail);
}

.eff-olive {
  color: var(--olive);
}

.eff-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.eff-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--stone);
}

.eff-legend-swatch {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 2px;
  opacity: 0.8;
}

.eff-legend-tick {
  width: 4px;
  height: 14px;
  background: var(--stone);
  flex-shrink: 0;
  border-radius: 1px;
}

.eff-insight {
  background: var(--manilla-deep);
  border-left: 3px solid var(--crail);
  padding: 24px;
  margin-top: 24px;
}

.eff-insight-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--crail);
  margin-bottom: 8px;
}

.eff-insight-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--graphite);
}

@media (max-width: 720px) {
  .timeline-table,
  .diff-table,
  .benchmark-table {
    display: block;
    overflow-x: auto;
    white-space: normal;
  }

  .pipeline-row {
    flex-direction: column;
    align-items: stretch;
  }

  .pipe-arrow {
    transform: rotate(90deg);
    text-align: center;
  }

  .pipe-gate {
    width: auto;
  }

  .article-series-nav {
    margin-top: 48px;
    padding: 28px 20px 44px;
  }

  .article-series-grid,
  .article-series-list {
    grid-template-columns: 1fr;
  }

  .article-nav-card,
  .article-series-link {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .efficiency-card {
    padding: 32px 24px 28px;
  }

  .efficiency-stage,
  .eff-conn {
    grid-template-columns: 90px 1fr 90px;
    gap: 14px;
  }

  .eff-sval .vbig {
    font-size: 24px;
  }

  .eff-conn-rate {
    font-size: 20px;
  }
}
