/* HudsonValleyLive.tv — Contractor portal (MVP) */
:root {
  --bg-deep: #0a0c10;
  --bg-panel: #12151c;
  --bg-elevated: #1a1e28;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8eaef;
  --text-muted: #8b92a3;
  --accent: #3dd6c3;
  --accent-dim: rgba(61, 214, 195, 0.12);
  --warning: #e8b44c;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --space: 1rem;
  --maxw: 1100px;
  --focus: 0 0 0 2px var(--bg-deep), 0 0 0 4px var(--accent);
  /* Proof.cam brand */
  --proof-blue: #2f80ed;
  --proof-blue-2: #0a84ff;
  --proof-dark: #071a2f;
  --proof-navy: #0b1f33;
  --proof-light: #eaf2ff;
  --proof-border: rgba(47, 128, 237, 0.22);
  --proof-shadow: 0 18px 45px rgba(7, 26, 47, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 600px at 50% -20%, #1a2332 0%, var(--bg-deep) 45%);
  background-attachment: fixed;
  line-height: 1.5;
  font-size: 16px;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #000;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  left: 0.5rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem var(--space);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .site-header__inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
}

.brand {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.brand__accent {
  color: var(--accent);
}

.title-block h1 {
  margin: 0.15rem 0 0;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* Status chips */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  width: max-content;
}
.status-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status-chip--live {
  color: #5eead4;
  background: var(--accent-dim);
  border: 1px solid rgba(61, 214, 195, 0.28);
}
.status-chip--recent {
  color: var(--warning);
  background: rgba(232, 180, 76, 0.12);
  border: 1px solid rgba(232, 180, 76, 0.25);
}
.status-chip--archived {
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

/* Layout */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.25rem var(--space) 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card__header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.card__header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.card__body {
  padding: 1.25rem;
}

/* Video */
.video-wrap {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
  max-height: 70vh;
}
.video-stack {
  position: relative;
  width: 100%;
  height: 100%;
}
.video-stack video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  vertical-align: top;
  background: #0a0a0a;
}
.video-telestration-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.video-label {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 5;
  padding: 0.3rem 0.55rem;
  background: rgba(0, 0, 0, 0.65);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text);
}

.video-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  background: rgba(10, 12, 16, 0.92);
  color: var(--text-muted);
  font-size: 0.9rem;
  z-index: 4;
  border: 0;
  width: 100%;
  font-family: inherit;
  cursor: default;
}
.video-error[hidden] {
  display: none;
}

.player-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover {
  background: var(--bg-elevated);
  border-color: rgba(255, 255, 255, 0.12);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.btn--primary {
  background: var(--accent-dim);
  border-color: rgba(61, 214, 195, 0.35);
  color: #a7f4ea;
}
.btn--primary:hover {
  background: rgba(61, 214, 195, 0.2);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Snapshot grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (min-width: 520px) {
  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat {
  padding: 0.75rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.stat dt {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.stat dd {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-word;
}

/* Replays */
.replay-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 600px) {
  .replay-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.replay-card {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
  text-align: left;
  width: 100%;
  padding: 0.45rem 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.replay-card:hover {
  border-color: rgba(61, 214, 195, 0.3);
  background: rgba(26, 30, 40, 0.9);
}
.replay-card.is-active {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.replay-card:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.replay-card__thumb-wrap {
  flex: 0 0 clamp(5.5rem, 32vw, 7.25rem);
  width: clamp(5.5rem, 32vw, 7.25rem);
  min-width: 5.5rem;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 0;
  border-radius: 6px;
  background: #111;
  overflow: hidden;
  align-self: center;
  position: relative;
}
.replay-card__thumb-wrap .replay-card__thumb,
.replay-card__thumb-wrap .replay-card__thumb--placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  background: #111;
  margin: 0;
}
.replay-card__thumb-wrap .replay-card__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.7rem;
  border: 1px dashed var(--border);
  box-sizing: border-box;
  position: absolute;
  inset: 0;
}
.replay-card__thumb {
  /* legacy: use dimensions from parent .replay-card__thumb-wrap */
  object-fit: cover;
  border-radius: 6px;
  background: #111;
}
.replay-card__thumb-wrap video.replay-card__thumb {
  display: block;
}
.replay-card__body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.35rem;
}
.replay-card__title {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
}
.replay-card__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}
.replay-card__note {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text);
  margin: 0;
  max-height: 4.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  word-break: break-word;
  text-align: left;
}
.replay-card__rating-host {
  margin-top: 0.1rem;
}

.asset-viewer-rating {
  text-align: left;
  width: 100%;
}
.asset-viewer-rating__label {
  margin: 0 0 0.2rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.asset-viewer-rating__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.25rem;
}
.asset-viewer-rating__star {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1;
  opacity: 0.4;
}
.asset-viewer-rating__star.is-on {
  color: var(--warning);
  opacity: 1;
}
.asset-viewer-rating__count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 0.15rem;
}

/* Gallery */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}
@media (min-width: 520px) {
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 900px) {
  .photo-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.photo-tile {
  position: relative;
  border: none;
  padding: 0;
  margin: 0;
  background: #111;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  text-align: left;
  color: var(--text);
  font: inherit;
}
.photo-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Empty state spanning the whole photo grid */
.photo-grid > .photo-tile.photo-tile__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 8rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.5rem;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  grid-column: 1 / -1;
  aspect-ratio: auto;
  cursor: default;
}

/* Broken / missing image inside a tile — fill the square like real photos */
.photo-tile > .photo-tile__empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.35rem 0.45rem;
  box-sizing: border-box;
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--text-muted);
  text-align: center;
  background: var(--bg-elevated);
  border: none;
  border-radius: 0;
}
.photo-tile__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.5rem 0.55rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  font-size: 0.65rem;
  line-height: 1.3;
  pointer-events: none;
}
.tag {
  display: inline-block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a7f4ea;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  margin-top: 0.2rem;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-left: 2px solid rgba(61, 214, 195, 0.35);
  margin-left: 0.35rem;
  padding-left: 0;
}

.timeline-item {
  position: relative;
  padding: 0.2rem 0.5rem 0.7rem 1rem;
  text-align: left;
  width: 100%;
  background: rgba(13, 16, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -0.46rem;
  top: 0.7rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #111622;
  border: 2px solid var(--accent);
}
.timeline-item:hover .timeline-item__title {
  color: #a7f4ea;
}
.timeline-item:hover {
  border-color: rgba(61, 214, 195, 0.35);
  background: rgba(20, 27, 39, 0.72);
}
.timeline-item:focus-visible {
  outline: none;
}
.timeline-item:focus-visible::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: -0.5rem;
  top: 0;
  bottom: 0.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--focus);
  pointer-events: none;
}
.timeline-item--inactive {
  cursor: default;
}
.timeline-item--inactive::before {
  border-color: var(--text-muted);
}
.timeline-item__date {
  font-size: 0.72rem;
  color: #a2b2cf;
  margin: 0 0 0.2rem;
}
.timeline-item__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.15s;
  line-height: 1.35;
}
.timeline-item__type {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9cb6d8;
  margin: 0.3rem 0 0;
}
.timeline-item--type-photo { border-left: 3px solid #5ec8ff; }
.timeline-item--type-replay { border-left: 3px solid #7d98ff; }
.timeline-item--type-note { border-left: 3px solid #d8a6ff; }
.timeline-item--type-milestone { border-left: 3px solid #ffbf5f; }
.timeline-item--type-live_start { border-left: 3px solid #37d98a; }
.timeline-item--type-live_end { border-left: 3px solid #ff6b7f; }
.timeline-item--type-inspection { border-left: 3px solid #86e2d9; }

/* Modal */
.modal[hidden] {
  display: none;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}
.modal__inner {
  position: relative;
  max-width: 900px;
  max-height: 92vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.modal__image-wrap {
  flex: 0 0 auto;
  max-height: min(65vh, 500px);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal__image-wrap img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  display: block;
}
.modal__content {
  padding: 1rem 1.25rem 1.25rem;
  overflow-y: auto;
}
.modal__content p {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
}
.modal__close:focus-visible {
  box-shadow: var(--focus);
}

/* Admin */
.admin-app {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem var(--space) 2.5rem;
}

.admin-banner {
  background: var(--accent-dim);
  border: 1px solid rgba(61, 214, 195, 0.3);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #a7d4cc;
}
.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.admin-summary {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}
.admin-summary h1 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}
.admin-summary__meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.25rem 0;
}
.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}
@media (min-width: 500px) {
  .admin-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.admin-label-compact {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0.4rem 0 0.2rem;
}
.admin-tile {
  text-align: left;
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.admin-tile:hover {
  border-color: rgba(61, 214, 195, 0.3);
  background: var(--bg-panel);
}
.admin-tile__label {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 0.2rem;
}
.admin-tile__desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.admin-sec-title {
  margin: 0.6rem 0 0.4rem;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.admin-sec-title::before { font-size: 1rem; }
.admin-sec-title--video { color: #8fb3ff; }
.admin-sec-title--video::before { content: "🎞️"; }
.admin-sec-title--photo { color: #7ecfd8; }
.admin-sec-title--photo::before { content: "📷"; }
.admin-sec-title--published { color: #ffcd84; }
.admin-sec-title--published::before { content: "✅"; }
.admin-tile--photo { border-left: 3px solid #5ec8ff; }
.admin-tile--video { border-left: 3px solid #7d98ff; }
.admin-tile--timeline { border-left: 3px solid #d8a6ff; }
.admin-tile:focus-visible {
  box-shadow: var(--focus);
  outline: none;
}
.camera-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 0.5rem;
}
.camera-panel video,
.camera-panel canvas {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-sm);
  background: #000;
  display: block;
}
#rec-video {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
#rec-timer {
  font-variant-numeric: tabular-nums;
}
.camera-panel[hidden] {
  display: none;
}
.log-panel {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  font-family: ui-monospace, monospace;
  color: #8fd4c0;
  max-height: 160px;
  overflow-y: auto;
  margin-top: 0.5rem;
}
.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  left: 1rem;
  z-index: 60;
  max-width: 360px;
  margin-left: auto;
  padding: 0.65rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.toast[hidden] {
  display: none;
}

/* Admin — review queue (unpublished) */
.admin-review {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.admin-review h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.admin-review__hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  line-height: 1.45;
}
.admin-review__options {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
}
.admin-review__options input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

/* Admin — client timeline editor */
.admin-timeline-section {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.admin-timeline-section h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.admin-tl-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.admin-tl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.admin-tl-row--photo { border-left: 3px solid #5ec8ff; }
.admin-tl-row--replay { border-left: 3px solid #7d98ff; }
.admin-tl-row--note { border-left: 3px solid #d8a6ff; }
.admin-tl-row--milestone { border-left: 3px solid #ffbf5f; }
.admin-tl-row--live_start { border-left: 3px solid #37d98a; }
.admin-tl-row--live_end { border-left: 3px solid #ff6b7f; }
.admin-tl-row--inspection { border-left: 3px solid #86e2d9; }
.admin-tl-row__line {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.admin-tl-row__date,
.admin-tl-row__type,
.admin-tl-row__src {
  display: inline;
}
.admin-tl-row__title {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
  font-weight: 500;
  word-break: break-word;
}
.admin-tl-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
}
.admin-tl-editor {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  max-width: 32rem;
}
.admin-tl-editor__title {
  font-size: 0.95rem;
  margin: 0 0 0.4rem;
  font-weight: 600;
}
.admin-tl-editor__hint {
  margin: 0 0 0.5rem;
  line-height: 1.4;
}
.admin-tl-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.6rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.admin-tl-field .admin-tile {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
.admin-tl-editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
}

.staging-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.staging-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  align-items: start;
}
@media (max-width: 520px) {
  .staging-card {
    grid-template-columns: 1fr;
  }
}
.staging-card__img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  background: #111;
  display: block;
}
.staging-card__img--missing,
.replay-visual-placeholder {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  box-sizing: border-box;
  border-radius: 6px;
  background: #111;
}
video.staging-card__img {
  object-fit: cover;
}
.staging-card__media {
  min-width: 100px;
  min-height: 100px;
}

/* Admin: video tap target → full-screen lightbox (mobile-friendly) */
.staging-card__media .hvl-replay-tap {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  flex-shrink: 0;
}
.staging-card__media .hvl-replay-tap .staging-card__img,
.staging-card__media .hvl-replay-tap video.staging-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
}
.hvl-replay-tap__play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 3rem;
  height: 3rem;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 0;
  padding: 0;
  cursor: pointer;
  z-index: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.hvl-replay-tap__play::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto 0 0.2rem;
  border-style: solid;
  border-width: 0.5rem 0 0.5rem 0.75rem;
  border-color: transparent transparent transparent #fff;
}
@media (max-width: 520px) {
  .staging-card__media .hvl-replay-tap {
    width: 100%;
    height: auto;
    min-height: 10.5rem;
    max-height: 14rem;
    aspect-ratio: 16 / 9;
  }
}
body.contractor-vlb-open {
  overflow: hidden;
  touch-action: none;
}
.contractor-vlb {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.92);
  box-sizing: border-box;
}
.contractor-vlb__panel {
  position: relative;
  width: 100%;
  max-width: min(100vw, 1200px);
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}
.contractor-vlb__video {
  width: 100%;
  max-height: calc(100dvh - 4.5rem);
  border-radius: 6px;
  background: #000;
}
.contractor-vlb__close {
  align-self: center;
  min-height: 44px;
  min-width: 5.5rem;
  padding: 0.4rem 1.25rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.contractor-tele .contractor-tele__stack {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  background: #000;
  border-radius: 0;
  overflow: hidden;
}
.contractor-tele .contractor-tele__stack video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.contractor-tele .contractor-tele__canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  z-index: 2;
}
.contractor-tele__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 0.55rem max(0.65rem, env(safe-area-inset-right)) calc(0.55rem + env(safe-area-inset-bottom))
    max(0.65rem, env(safe-area-inset-left));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0));
  font-size: 0.85rem;
  color: var(--text-muted);
}
.contractor-tele__tools input[type="color"] {
  width: 2.25rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}
.contractor-tele__tools input[type="range"] {
  width: 6rem;
}
.contractor-vlb.contractor-tele {
  padding: 0;
  background: #000;
}
.contractor-tele .contractor-vlb__panel {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  gap: 0;
}
.contractor-tele .contractor-tele__close {
  margin-left: auto;
}
.contractor-tele .contractor-tele__tools span {
  flex: 1 0 100%;
  max-width: 100%;
  font-size: 0.82rem;
  line-height: 1.25;
}
@media (min-width: 900px) {
  .contractor-tele .contractor-tele__tools {
    padding: 0.65rem 1rem 0.8rem;
  }
}

.staging-card__fields {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.staging-card__fields label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.staging-card__fields textarea {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.45rem 0.5rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical;
}
.staging-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.staging-empty {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  padding: 0.5rem 0;
}

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

/* Hidden input for file upload in admin */
.admin-file {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Contractor setup (super) */
.setup-table-wrap {
  overflow-x: auto;
  margin: 0.5rem 0 0;
  width: 100%;
  max-width: 100%;
}
.setup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 1100px;
}
.setup-table th,
.setup-table td {
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  padding: 0.55rem 0.6rem;
  vertical-align: top;
  text-align: left;
}
.setup-table th {
  background: rgba(0, 0, 0, 0.2);
  font-weight: 600;
  white-space: nowrap;
}
.setup-table input[type="text"],
.setup-table input[type="password"],
.setup-table select {
  width: 100%;
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
  font-size: 0.88rem;
}
.setup-table td:last-child {
  min-width: 9rem;
}
.setup-table td:last-child .btn {
  width: 100%;
  justify-content: center;
  margin: 0 0 0.45rem;
  padding: 0.52rem 0.72rem;
}
.setup-table td:last-child .btn:last-child {
  margin-bottom: 0;
}
.setup-table .setup-btn--save {
  border-color: rgba(61, 214, 195, 0.42);
  background: rgba(61, 214, 195, 0.16);
  color: #b6fbf2;
}
.setup-table .setup-btn--save:hover {
  background: rgba(61, 214, 195, 0.24);
  border-color: rgba(61, 214, 195, 0.6);
}
.setup-table .setup-btn--delete {
  border-color: rgba(255, 107, 107, 0.46);
  background: rgba(255, 107, 107, 0.12);
  color: #ffc5c5;
}
.setup-table .setup-btn--delete:hover {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.62);
}
@media (max-width: 760px) {
  .setup-table {
    font-size: 0.84rem;
  }
  .setup-table th,
  .setup-table td {
    padding: 0.48rem 0.45rem;
  }
  .setup-table td:last-child {
    min-width: 7.3rem;
  }
  .setup-table td:last-child .btn {
    padding: 0.48rem 0.6rem;
    font-size: 0.8rem;
  }
}
.setup-table td code {
  white-space: normal;
  word-break: break-word;
}
#setup-main .admin-panel {
  max-width: min(1360px, calc(100vw - 2rem)) !important;
}
/* Final pass: predictable per-column sizing */
#tbl-projects {
  min-width: 1220px;
}
#tbl-projects th:nth-child(1),
#tbl-projects td:nth-child(1) {
  min-width: 9.2rem;
}
#tbl-projects th:nth-child(2),
#tbl-projects td:nth-child(2) {
  min-width: 12rem;
}
#tbl-projects th:nth-child(3),
#tbl-projects td:nth-child(3) {
  min-width: 11.5rem;
}
#tbl-projects th:nth-child(4),
#tbl-projects td:nth-child(4) {
  min-width: 8rem;
}
#tbl-projects th:nth-child(5),
#tbl-projects td:nth-child(5) {
  min-width: 8.5rem;
}
#tbl-projects th:nth-child(6),
#tbl-projects td:nth-child(6) {
  min-width: 9.5rem;
}
#tbl-projects th:nth-child(7),
#tbl-projects td:nth-child(7) {
  min-width: 9rem;
}
#tbl-contractors {
  min-width: 860px;
}
#tbl-contractors th:nth-child(1),
#tbl-contractors td:nth-child(1) {
  min-width: 10rem;
}
#tbl-contractors th:nth-child(2),
#tbl-contractors td:nth-child(2) {
  min-width: 10rem;
}
#tbl-contractors th:nth-child(3),
#tbl-contractors td:nth-child(3) {
  min-width: 10rem;
}
#tbl-contractors th:nth-child(4),
#tbl-contractors td:nth-child(4) {
  min-width: 9rem;
}
@media (max-width: 980px) {
  #tbl-projects {
    min-width: 1120px;
  }
  #tbl-contractors {
    min-width: 780px;
  }
}
.setup-section {
  margin: 0 auto 1.5rem;
  max-width: 960px;
  padding: 0 1rem;
}
.setup-section h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  font-weight: 650;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.setup-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(100, 180, 255, 0.25);
  font-size: 0.8rem;
  font-weight: 800;
  margin-right: 0.35rem;
  vertical-align: middle;
}

/* Client project — per-asset engagement + Google CTA */
.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
}
.btn--ghost:hover {
  border-color: rgba(61, 214, 195, 0.35);
  color: var(--text);
}
.btn--small {
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
}

.asset-tile-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.asset-tile-wrap--photo {
  min-width: 0;
}
.photo-asset__info {
  text-align: left;
  width: 100%;
  min-width: 0;
  padding: 0 0.1rem 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.photo-asset__note {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text);
  margin: 0;
  max-height: 3.2em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  word-break: break-word;
}
.asset-tile-wrap--highlight {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.asset-tile-wrap > .asset-engagement {
  border-top: 1px solid var(--border);
  padding: 0.5rem 0.35rem 0.25rem;
  margin: 0;
}
.asset-engagement__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.35rem;
}
.asset-engagement__form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.asset-engagement__input {
  width: 100%;
  resize: vertical;
  min-height: 2.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text);
  font: inherit;
  padding: 0.4rem 0.5rem;
}
.asset-engagement__comments {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 12rem;
  overflow: auto;
}
.asset-engagement__comments-empty,
.asset-engagement__comment {
  font-size: 0.8rem;
  margin: 0 0 0.45rem;
  padding: 0.35rem 0.45rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.asset-engagement__comments-empty {
  color: var(--text-muted);
}
.asset-engagement__comment time {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.asset-engagement__comment-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.card--cta .google-review__hint {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 40rem;
}

/* Public project page when embedded (?embed=1&et=…) */
body.contractor-embed .site-header__inner {
  max-width: 100%;
}
body.contractor-embed .site-header {
  padding-bottom: 0.65rem;
}
body.contractor-embed .title-block h1 {
  font-size: 1.15rem;
}
body.contractor-embed .asset-engagement {
  display: none !important;
}

/* Contractor admin — embed checklist */
.admin-embed-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 14rem;
  overflow: auto;
  padding: 0.35rem 0 0;
}
.admin-embed-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--text-muted);
}
.admin-embed-row .admin-embed-cb {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.admin-tl-row__client-vis {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-right: 0.35rem;
  cursor: pointer;
  user-select: none;
}
.admin-tl-row__client-vis input {
  margin: 0;
  cursor: pointer;
}

.backup-list__ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.backup-list__item {
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.65rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}
.backup-list__head {
  margin-bottom: 0.25rem;
}
.backup-list__meta,
.backup-list__path {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0.15rem 0;
  word-break: break-word;
}
.backup-list__instr {
  margin: 0.4rem 0 0;
  padding: 0.35rem 0.45rem;
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  max-height: 8rem;
  overflow: auto;
  white-space: pre-wrap;
}

/* —— Proof.cam reusable brand —— */
.proof-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}
.proof-brand--header {
  flex: 1;
  min-width: 0;
}
.proof-brand__icon {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
  object-fit: contain;
}
@media (min-width: 600px) {
  .proof-brand__icon {
    width: 2.5rem;
    height: 2.5rem;
  }
}
.proof-brand__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.proof-brand__wordmark {
  font-size: clamp(1.05rem, 3.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}
.proof-brand__wordmark-mark {
  color: var(--proof-blue);
}
.proof-brand__portal {
  font-size: clamp(0.95rem, 2.8vw, 1.05rem);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.proof-brand__tagline {
  margin: 0;
  font-size: clamp(0.8125rem, 2.2vw, 0.9rem);
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 36rem;
}
.proof-brand--compact .proof-brand__tagline {
  display: none;
}
@media (min-width: 480px) {
  .proof-brand--compact .proof-brand__tagline {
    display: block;
  }
}

.proof-card {
  background: var(--bg-elevated);
  border: 1px solid var(--proof-border);
  border-radius: var(--radius);
  box-shadow: var(--proof-shadow);
}

.proof-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--proof-light);
  background: var(--proof-navy);
  border: 1px solid var(--proof-border);
  border-radius: 999px;
}

.proof-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.55rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.proof-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-deep), 0 0 0 4px var(--proof-blue);
}
.proof-button--primary {
  color: #fff;
  background: linear-gradient(180deg, var(--proof-blue-2), var(--proof-blue));
  border-color: rgba(255, 255, 255, 0.12);
}
.proof-button--primary:hover {
  filter: brightness(1.06);
}
.proof-button--secondary {
  color: var(--proof-light);
  background: rgba(234, 242, 255, 0.08);
  border-color: var(--proof-border);
}
.proof-button--secondary:hover {
  background: rgba(234, 242, 255, 0.14);
}

.proof-page-footnote {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.25rem var(--space) 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.proof-page-footnote a {
  color: var(--proof-blue);
  text-decoration: none;
  font-weight: 600;
}
.proof-page-footnote a:hover {
  text-decoration: underline;
}

.admin-backup-name {
  width: 100%;
  max-width: 28rem;
  font-size: 1rem;
  padding: 0.55rem 0.65rem;
  margin: 0 0 0.5rem;
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-deep);
  color: var(--text);
}
