:root {
  --avanti-red: #e63a30;
  --ink: #111;
  --bg: #f4f3ef;
  --card-bg: #fff;
  --border: #111;
  --text-2: #555;
  --text-3: #666;
  --text-4: #888;
  --success: #1f7a3d;
  --strip-bg: #efece6;
  --modal-bg: rgba(0, 0, 0, 0.95);
  --modal-bar-bg: rgba(0, 0, 0, 0.5);
  --modal-line: rgba(255, 255, 255, 0.15);
  --vimeo-cyan: #1ab7ea;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  min-height: 100dvh;
}
button { font-family: inherit; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--avanti-red);
  outline-offset: 2px;
}

/* Header (light variant A1) */
.header {
  background: #fff;
  color: var(--ink);
  padding: 52px 16px 16px;
  border-bottom: 1.5px solid var(--ink);
}
.header-top { display: flex; align-items: center; gap: 10px; }
.header-logo { width: 32px; height: 32px; border-radius: 6px; }
.header-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--text-3); text-transform: uppercase;
}
.header-id-row {
  margin-top: 14px; display: flex; align-items: baseline; gap: 10px;
}
.store-badge {
  background: var(--avanti-red); color: #fff;
  padding: 4px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.05em;
}
.store-name {
  margin: 0; font-size: 22px; font-weight: 800;
  line-height: 1.1; color: var(--ink);
}
.store-address {
  font-size: 12px; color: var(--text-3);
  margin: 6px 0 0; line-height: 1.4;
}
.stat-strip {
  display: flex; gap: 0; margin-top: 14px;
  background: var(--strip-bg); border-radius: 8px; padding: 4px;
}
.stat { flex: 1; padding: 6px 8px; text-align: center; }
.stat-value { font-size: 16px; font-weight: 800; color: var(--ink); }
.stat-label {
  font-size: 10px; color: var(--text-4); margin-top: 2px;
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* Section title */
.section { padding: 16px 16px 12px; }
.section-title {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px;
}
.section-title h2 {
  margin: 0; font-size: 16px; font-weight: 800;
  letter-spacing: -0.01em; color: var(--ink);
}
.accent-bar {
  display: inline-block; width: 6px; height: 18px;
  background: var(--avanti-red); border-radius: 1px;
}
.section-count { font-size: 12px; font-weight: 700; color: var(--text-4); }

/* Planogram rows */
.planogram-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.planogram-row-btn {
  all: unset; display: flex; align-items: stretch; gap: 12px;
  background: var(--card-bg); border: 1.5px solid var(--border); border-radius: 10px;
  padding: 10px; width: 100%; box-sizing: border-box; cursor: pointer;
  min-height: 96px;
}
.planogram-thumb {
  width: 76px; height: 76px; background: #000;
  border-radius: 6px; overflow: hidden; position: relative; flex-shrink: 0;
}
.planogram-thumb img {
  position: absolute; width: 220px; height: auto; left: -25px; top: -10px;
}
.planogram-meta {
  flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center;
}
.planogram-name {
  font-size: 14px; font-weight: 800; color: var(--ink); line-height: 1.2;
}
.planogram-fixture { font-size: 11px; color: var(--text-2); margin-top: 3px; }
.planogram-status {
  display: flex; gap: 6px; margin-top: 6px;
  font-size: 10px; font-weight: 700; align-items: center;
}
.planogram-reset-ok { color: var(--success); }
.planogram-swaps { color: var(--text-4); }
.chevron {
  align-self: center; font-size: 18px; color: var(--ink);
  font-weight: 900; padding-right: 4px;
}

/* Badges */
.badge-new {
  position: absolute; top: 0; left: 0;
  background: var(--avanti-red); color: #fff;
  font-size: 9px; font-weight: 800; padding: 2px 4px;
  letter-spacing: 0.05em;
}
.badge-needs-reset {
  background: var(--avanti-red); color: #fff;
  padding: 2px 5px; border-radius: 3px; letter-spacing: 0.04em;
}
.badge-new-video {
  position: absolute; top: 4px; left: 4px; border-radius: 3px;
  padding: 2px 5px;
}

/* Video tabs */
.video-tabs {
  display: flex; gap: 6px; margin-bottom: 12px;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.video-tabs::-webkit-scrollbar { display: none; }
.tab {
  all: unset; cursor: pointer; padding: 8px 14px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 999px;
  min-height: 44px;
}
.tab-active { background: var(--ink); color: #fff; }

/* Video grid */
.video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.video-card {
  all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 6px;
}
.video-thumb {
  width: 100%; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden;
  border: 1.5px solid var(--ink); position: relative;
}
.video-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.video-play {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
}
.video-play::before {
  content: ''; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  position: absolute;
}
.video-play-tri {
  width: 0; height: 0; position: relative; z-index: 1;
  border-left: 11px solid var(--ink);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  margin-left: 3px;
}
.video-duration {
  position: absolute; bottom: 4px; right: 4px;
  background: rgba(0, 0, 0, 0.85); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 5px; border-radius: 3px;
}
.video-title {
  font-size: 12px; font-weight: 700; color: var(--ink); line-height: 1.25;
}

/* Modal base */
.modal {
  position: fixed; inset: 0; background: var(--modal-bg);
  z-index: 100; display: flex; flex-direction: column;
}
.modal-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; color: #fff;
}
.modal-bar-top { border-bottom: 1px solid var(--modal-line); }
.modal-bar-bottom {
  border-top: 1px solid var(--modal-line);
  background: var(--modal-bar-bg); gap: 8px;
}
.modal-title { min-width: 0; flex: 1; }
.modal-title-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.modal-title-sub { font-size: 12px; opacity: 0.7; margin-top: 2px; }
.modal-close {
  background: rgba(255, 255, 255, 0.12); border: none; color: #fff;
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  min-height: 44px;
}

/* Planogram zoom modal */
.planogram-zoom-stage {
  flex: 1; overflow: hidden; position: relative; cursor: grab;
  touch-action: none;
  display: flex; align-items: center; justify-content: center;
}
.planogram-zoom-stage:active { cursor: grabbing; }
.planogram-zoom-image {
  max-width: none; width: 800px; height: auto;
  transform: translate(0, 0) scale(1);
  transform-origin: center center;
  transition: transform 0.15s;
  user-select: none; pointer-events: none;
}
.planogram-zoom-image.dragging { transition: none; }
.zoom-btn {
  background: rgba(255, 255, 255, 0.12); border: none; color: #fff;
  padding: 10px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.zoom-btn-download { background: var(--avanti-red); }
.planogram-zoom-percent {
  flex: 1; text-align: center; color: #fff;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

/* Video modal */
.modal-bar-video { border-bottom: none; }
.video-modal-meta { font-size: 12px; opacity: 0.7; font-weight: 600; }
.video-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: #000; position: relative;
}
.video-stage-inner {
  width: 100%; aspect-ratio: 16 / 9; max-height: 100%; position: relative;
}
.video-iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.video-info {
  padding: 14px 16px 18px; background: #000; color: #fff;
}
.video-info-title { font-size: 15px; font-weight: 800; line-height: 1.2; }
.video-info-desc { font-size: 12px; opacity: 0.75; margin-top: 4px; line-height: 1.4; }

/* Error screen */
.error-screen {
  padding: 80px 24px; text-align: center; min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
}
.error-title { margin: 0; font-size: 18px; font-weight: 800; }
.error-body { margin: 0; color: var(--text-2); font-size: 14px; }
.error-retry {
  margin-top: 12px; background: var(--ink); color: #fff;
  border: none; padding: 12px 24px; border-radius: 8px;
  font-size: 14px; font-weight: 700; cursor: pointer; min-height: 44px;
}
