/* ============================================================
   Scanner
   ============================================================ */

.scan-stage {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #000;
  aspect-ratio: 4 / 5;
  position: relative;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.scan-stage__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-stage__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--sp-2);
  color: var(--text-3);
  text-align: center;
  padding: var(--sp-5);
  background: radial-gradient(500px 300px at 50% 40%, #1c1c25, #000);
}

.scan-stage__placeholder svg {
  width: 44px;
  height: 44px;
  display: block;
  fill: none;
  stroke: currentColor;
}

.scan-stage__placeholder b {
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: 15px;
}

.scan-stage__placeholder p {
  font-size: 12.5px;
  max-width: 220px;
}

/* Viewfinder corners */
.viewfinder {
  position: absolute;
  inset: 20px;
  pointer-events: none;
  z-index: 5;
}

.viewfinder__corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.85);
}

.viewfinder__corner--tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.viewfinder__corner--tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.viewfinder__corner--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.viewfinder__corner--br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }

/* Scan sweep line */
.sweep {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 20px;
  height: 3px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, transparent, var(--cone), transparent);
  box-shadow: 0 0 16px var(--cone);
  z-index: 5;
  pointer-events: none;
  opacity: 0;
}

.when-live .sweep {
  opacity: 1;
  animation: scan-sweep 2.6s ease-in-out infinite;
}

/* Capture actions */
.capture-actions {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.btn--capture-shot {
  flex: 1.4;
  height: 54px;
  border-radius: var(--r-md);
  background: var(--grad-cone);
  color: var(--cone-ink);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-cone);
}

.btn--capture-shot svg {
  width: 20px;
  height: 20px;
}

.btn--capture-shot:disabled {
  opacity: 0.5;
}

.btn--file {
  flex: 1;
  height: 54px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1.5px dashed var(--line);
  color: var(--text-2);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.btn--file:active {
  transform: scale(0.98);
}

.btn--file:hover {
  border-color: var(--cone);
  color: var(--cone);
}

.btn--file svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.hint {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: var(--sp-3);
}

.hint svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* OCR processing state */
.processing {
  text-align: center;
  padding: var(--sp-7) var(--sp-4);
}

.spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto var(--sp-4);
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--cone);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.processing p {
  font-weight: 700;
  font-size: 15px;
}

.processing small {
  color: var(--text-3);
  font-size: 12.5px;
  display: block;
  margin-top: 4px;
}

.processing ol {
  margin-top: var(--sp-4);
  list-style: none;
  text-align: left;
  max-width: 260px;
  margin-left: auto;
  margin-right: auto;
}

.processing li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 13px;
  color: var(--text-3);
  padding: 4px 0;
}

.processing li.is-done {
  color: var(--road);
}

.processing li.is-done::before {
  content: "\2713";
  font-weight: 800;
}

.processing li:not(.is-done)::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--line);
}

/* Review thumbnail */
.review-thumb {
  width: 100%;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: var(--sp-5);
}

.review-thumb img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

/* ============================================================
   Timeline
   ============================================================ */

.tl {
  position: relative;
  padding-left: 26px;
}

.tl::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
  border-radius: var(--r-pill);
}

.tl-item {
  position: relative;
  padding-bottom: var(--sp-5);
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-item__ring {
  position: absolute;
  left: -24px;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--ring, var(--cone));
}

.tl-item__blob {
  position: absolute;
  left: -21px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ring, var(--cone));
  opacity: 0.4;
}

.tl-item[data-gate="oil"] { --ring: var(--cone); }
.tl-item[data-gate="tyres"] { --ring: var(--road); }
.tl-item[data-gate="breakdown"] { --ring: var(--signal); }
.tl-item[data-gate="itv"] { --ring: var(--amber); }
.tl-item[data-gate="other"] { --ring: var(--text-3); }

.tl-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: 6px;
}

.tl-item__date {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tl-item__price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.tl-item__body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
}

.tl-item__type {
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.tl-item__type .icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--ring, var(--cone));
  flex-shrink: 0;
}

.tl-item__type .icon svg {
  width: 15px;
  height: 15px;
}

.tl-item__shop {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 2px;
}

.tl-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  padding-top: 8px;
  border-top: 1px dashed var(--line-soft);
}

.tl-item__meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tl-item__meta .mono {
  font-size: 12px;
}

/* Year headers */
.tl-year {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-3);
  letter-spacing: 0.08em;
  margin: var(--sp-6) 0 var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.tl-year::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.tl-year .sum {
  font-family: var(--font-mono);
  color: var(--text-2);
  letter-spacing: 0;
  font-size: 13px;
}