.plugin-timing {
  padding: 28px var(--gutter) clamp(68px, 8vw, 118px);
  background: var(--bg);
}

.timing-shell {
  max-width: 1290px;
  margin-inline: auto;
}

.timing-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 48px;
  margin-bottom: 32px;
}

.timing-eyebrow {
  margin: 0 0 14px;
  color: #83d8fa;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .17em;
}

.timing-intro h2 {
  margin: 0;
  max-width: 21ch;
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.038em;
  text-wrap: balance;
}

.timing-intro-copy {
  max-width: 34ch;
  margin: 0;
  color: #bcc7d3;
  font-size: 16px;
  line-height: 1.6;
}

.timing-panel {
  --timing-columns: minmax(175px, 1fr) minmax(94px, .48fr) minmax(0, 2.65fr) 84px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 0 clamp(20px, 3vw, 42px);
  border: 1px solid #a8d9ff2e;
  border-radius: 24px;
  background:
    linear-gradient(103deg, #10141ef5 18%, #111b2ae8 68%, #102137ce),
    url('assets/revit-tools/05-tools-wave-background-v1.webp') right 59% / cover;
  box-shadow: inset 0 1px 0 #c3e8ff0f, 0 22px 50px -27px #000c;
  transition: border-color .35s, box-shadow .35s;
}

.timing-panel::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: '';
  background: radial-gradient(380px circle at var(--glow-x, 50%) var(--glow-y, 50%), #429cfc43, transparent 80%);
  opacity: var(--glow-strength, 0);
  transition: opacity .22s;
}

.timing-panel.is-near-pointer {
  border-color: #8fd5ff6e;
  box-shadow: inset 0 1px 0 #c3e8ff22, 0 18px 56px -20px #1666ad53;
}

.timing-columns {
  display: grid;
  grid-template-columns: var(--timing-columns);
  column-gap: clamp(13px, 2vw, 26px);
  align-items: center;
}

.timing-legend {
  padding-block: 21px;
  border-bottom: 1px solid #b0d5ff26;
  color: #bac9d8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.timing-legend-after {
  grid-column: span 2;
  color: #a0dfff;
}

.timing-legend-after::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 8px 1px 0;
  border-radius: 50%;
  background: #88e4ff;
  box-shadow: 0 0 12px #55bfffaa;
}

.timing-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timing-row {
  min-height: 82px;
  padding-block: 16px;
  border-bottom: 1px solid #b0d5ff18;
}

.timing-row:nth-child(2) { --bar-delay: 140ms; }
.timing-row:nth-child(3) { --bar-delay: 280ms; }

.timing-plugin {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.timing-plugin img {
  display: block;
  flex: 0 0 28px;
}

.timing-plugin h3 {
  margin: 0 0 5px;
  color: #f2f7fc;
  font-size: 15px;
  line-height: 1.15;
}

.timing-plugin p {
  margin: 0;
  color: #b1bece;
  font-size: 12px;
  line-height: 1.35;
}

.timing-before {
  margin: 0;
  color: #c0cbd9;
  font-size: 14px;
}

.timing-before-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.timing-track {
  height: 29px;
  overflow: hidden;
  border: 1px solid #9bceff2e;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 6 - 1px), #9ac8f629 calc(100% / 6 - 1px) calc(100% / 6)), #0e1623c9;
}

.timing-fill {
  display: block;
  width: calc(var(--seconds) * 100% / 1800);
  min-width: 3px;
  height: 100%;
  border-right: 2px solid #def5ff;
  border-radius: 3px;
  background:
    linear-gradient(90deg, #2b86e6bb, #8ad9ffe8 92%, #d7f3ff),
    url('assets/revit-tools/05-tools-wave-background-v1.webp') center 64% / cover;
  box-shadow: inset 0 1px 0 #d9f3ff60, 0 0 14px #49bbff81;
  clip-path: inset(0);
  transition: clip-path 1.2s cubic-bezier(.22,.75,.23,1) var(--bar-delay, 0ms), filter .28s ease;
}

.timing-panel[data-awaiting] .timing-fill { clip-path: inset(0 100% 0 0); }
.timing-panel.is-near-pointer .timing-fill { filter: brightness(1.15); }

.timing-result {
  margin: 0;
  color: #eef8ff;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
  text-align: right;
  white-space: nowrap;
}

.timing-result [aria-hidden] {
  color: #a7d7f5;
  font-size: 14px;
  font-weight: 500;
}

.timing-scale { padding-top: 13px; }

.timing-ticks {
  grid-column: 3;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) 0;
  color: #a8b9cd;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.timing-ticks span {
  justify-self: start;
  white-space: nowrap;
  transform: translateX(-50%);
}

.timing-ticks span:first-child,
.timing-ticks span:last-child { transform: none; }
.timing-ticks span:last-child { justify-self: end; }

.timing-note {
  margin: 18px 0 21px;
  color: #a8b9cd;
  font-size: 11px;
}

@media (max-width: 720px) {
  .plugin-timing { padding-top: 20px; }
  .timing-intro { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 24px; }
  .timing-intro-copy { font-size: 15px; }
  .timing-panel {
    --timing-columns: minmax(0, 1fr) 70px;
    padding-inline: clamp(14px, 4vw, 24px);
    border-radius: 18px;
  }
  .timing-legend { display: flex; justify-content: space-between; gap: 6px; padding-block: 17px; }
  .timing-legend-before { display: none; }
  .timing-row { gap: 10px 12px; padding-block: 14px; }
  .timing-before { text-align: right; white-space: nowrap; }
  .timing-before-label {
    position: static;
    display: block;
    width: auto;
    height: auto;
    margin-bottom: 3px;
    overflow: visible;
    clip-path: none;
    color: #a8b9cd;
    font-size: 10px;
  }
  .timing-track { height: 19px; }
  .timing-result { font-size: 20px; }
  .timing-ticks { grid-column: 1; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .timing-panel[data-awaiting] .timing-fill { clip-path: inset(0); }
  .timing-panel::before { display: none; }
}
