:root {
  --orange: #ff6c0e;
  --black: #212121;
  --white: #fff;
  --lightest-blue: #c8d8e7;
  --dark-blue: #204774;
  --darkest-blue: #022841;
  --soft-white: #e6e6e6;
  --light-blue: #86baea;

  --vc-orange: var(--orange);
  --vc-orange-hover: #ff8533;
  --vc-orange-glow: rgba(255, 108, 14, 0.35);
  --vc-main: var(--dark-blue);
  --vc-bg-side: var(--darkest-blue);
  --vc-bg-mid: var(--dark-blue);
  --vc-text: var(--white);
  --vc-text-muted: rgba(255, 255, 255, 0.78);
  --vc-heading: var(--orange);
  --vc-emphasis: var(--vc-orange-hover);
  --vc-warn: #ffab70;
  --vc-warn-strong: var(--orange);
  --vc-surface: rgba(2, 40, 65, 0.62);
  --vc-surface-elevated: rgba(32, 71, 116, 0.55);
  --vc-border: rgba(134, 186, 234, 0.22);
  --vc-radius: 12px;
  --vc-font: "Roboto", system-ui, -apple-system, sans-serif;
  --vc-font-heading: "Playfair Display", sans-serif;
}

h1,
h2,
h3,
.page-title,
.card h2,
.file-group h3 {
  font-family: var(--vc-font-heading);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--vc-font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--vc-text);
  background: linear-gradient(
    90deg,
    var(--darkest-blue) 0%,
    #033552 22%,
    var(--dark-blue) 50%,
    #033552 78%,
    var(--darkest-blue) 100%
  );
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 65% 50% at 50% 45%,
    rgba(32, 71, 116, 0.35) 0%,
    transparent 72%
  );
}

#grid-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.5rem;
  background: rgba(2, 40, 65, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--vc-border);
}

.site-header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-link svg,
.logo-link img {
  height: 40px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 0;
}

.site-nav a {
  color: var(--vc-text-muted);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
  color: var(--vc-text);
  background: rgba(134, 186, 234, 0.12);
}

.site-nav a.active {
  color: var(--vc-orange);
  background: rgba(255, 108, 14, 0.14);
}

.site-nav-divider {
  width: 1px;
  height: 1.25rem;
  margin: 0 0.35rem;
  background: var(--vc-border);
  flex-shrink: 0;
}

.site-nav-admin {
  font-size: 0.8125rem;
}

.site-header-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.site-nav-runs {
  color: var(--vc-text-muted);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.site-nav-runs:hover {
  color: var(--vc-text);
  background: rgba(134, 186, 234, 0.12);
}

.site-nav-runs.active {
  color: var(--vc-orange);
  background: rgba(255, 108, 14, 0.14);
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.page-title {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--vc-heading);
}

.page-subtitle {
  margin: 0 0 2rem;
  color: var(--vc-text);
  font-size: 0.95rem;
}

.page-subtitle code {
  color: var(--vc-emphasis);
  background: rgba(255, 108, 14, 0.12);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88em;
}

.card {
  background: var(--vc-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--vc-border);
  border-radius: var(--vc-radius);
  padding: 1.75rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label,
.text-key {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--vc-emphasis);
}

.form-group .hint,
.hint {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--vc-text-muted);
}

.hint-warn,
.text-warn {
  color: var(--vc-warn);
}

.hint-warn strong,
.text-warn strong {
  color: var(--vc-warn-strong);
  font-weight: 600;
}

input[type="url"],
input[type="text"],
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  color: var(--vc-text);
  background: var(--vc-surface-elevated);
  border: 1px solid var(--vc-border);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--vc-orange);
  box-shadow: 0 0 0 3px var(--vc-orange-glow);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  min-height: 48px;
  background: var(--vc-surface-elevated);
  border: 1px solid var(--vc-border);
  border-radius: 8px;
  cursor: text;
}

.tag-input-wrap:focus-within {
  border-color: var(--vc-orange);
  box-shadow: 0 0 0 3px var(--vc-orange-glow);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  background: rgba(255, 108, 14, 0.15);
  border: 1px solid rgba(255, 108, 14, 0.35);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--vc-orange);
}

.tag-chip button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 1rem;
  opacity: 0.7;
}

.tag-chip button:hover {
  opacity: 1;
}

.tag-input-wrap input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  padding: 0.25rem;
  box-shadow: none;
}

.tag-input-wrap input:focus {
  box-shadow: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, opacity 0.15s, background 0.15s;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--vc-orange), #e55a00);
  color: #fff;
  box-shadow: 0 4px 20px var(--vc-orange-glow);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--vc-orange-hover), var(--vc-orange));
}

.btn-secondary {
  background: rgba(32, 71, 116, 0.6);
  color: var(--vc-text);
  border: 1px solid var(--vc-border);
}

.btn-secondary:hover {
  background: rgba(32, 71, 116, 0.85);
  color: var(--vc-emphasis);
  border-color: rgba(255, 108, 14, 0.35);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.file-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.file-upload-row input[type="file"] {
  flex: 1 1 12rem;
  min-width: 0;
  font-size: 0.9rem;
  color: var(--vc-text-muted);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 0.5rem;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  padding: 0.85rem 1.25rem;
  background: var(--vc-surface-elevated);
  border: 1px solid var(--vc-border);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(2, 40, 65, 0.5);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
  color: var(--vc-text);
}

.toast.error {
  border-color: rgba(255, 108, 14, 0.45);
  color: var(--vc-warn);
  background: rgba(255, 108, 14, 0.12);
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pending {
  background: rgba(32, 71, 116, 0.5);
  color: var(--vc-text-muted);
}

.status-running {
  background: rgba(255, 108, 14, 0.2);
  color: var(--vc-emphasis);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-completed {
  background: rgba(255, 108, 14, 0.15);
  color: var(--vc-heading);
}

.status-failed {
  background: rgba(255, 108, 14, 0.18);
  color: var(--vc-warn-strong);
}

.status-stopped {
  background: rgba(255, 171, 112, 0.2);
  color: var(--vc-warn);
}

.status-awaiting_approval {
  background: rgba(255, 193, 7, 0.18);
  color: #ffc107;
}

.status-unknown {
  background: rgba(32, 71, 116, 0.35);
  color: var(--vc-text-muted);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

@keyframes phase-running-breathe {
  0%,
  100% {
    transform: scale(1.01);
  }
  50% {
    transform: scale(1.03);
  }
}

.phase-comet-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 3;
}

.phase-comet-measure {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}

.runs-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.run-card {
  display: block;
  padding: 1.25rem 1.5rem;
  background: var(--vc-surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--vc-border);
  border-radius: var(--vc-radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.1s;
}

.run-card:hover {
  border-color: rgba(255, 108, 14, 0.4);
  transform: translateY(-1px);
}

.run-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.run-card-url {
  font-size: 0.9rem;
  color: var(--vc-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--vc-text-muted);
}

.run-card-meta span:first-child {
  color: var(--vc-emphasis);
  font-weight: 500;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--vc-text);
}

.empty-state p {
  color: var(--vc-text);
}

.detail-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.detail-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
}

.detail-row dt {
  color: var(--vc-emphasis);
  font-weight: 600;
}

.detail-row dd {
  margin: 0;
  word-break: break-word;
  color: var(--vc-text);
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--vc-heading);
}

.file-group {
  margin-bottom: 1.5rem;
}

.file-group h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--vc-emphasis);
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.product-image-groups {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.product-image-group-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--vc-emphasis);
}

.product-image-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (max-width: 520px) {
  .product-image-rows {
    grid-template-columns: 1fr;
  }
}

.image-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--vc-border);
  border-radius: 8px;
  background: var(--vc-surface);
  min-width: 0;
}

.image-row-preview {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--vc-border);
  background: var(--vc-surface-elevated);
  cursor: pointer;
  padding: 0;
}

.image-row-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.image-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.image-row-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--vc-text);
  cursor: pointer;
  word-break: break-all;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.image-row-name:hover,
.image-row-preview:hover {
  color: var(--vc-orange);
}

.image-row .btn-sm {
  flex-shrink: 0;
  font-size: 0.7rem;
  padding: 0.25rem 0.45rem;
}

.panel-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(2, 40, 65, 0.92);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.panel-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.panel-lightbox img {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--vc-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.panel-lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: var(--vc-text);
  font-size: 0.9rem;
  max-width: 90vw;
  text-align: center;
}

.panel-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--vc-surface-elevated);
  border: 1px solid var(--vc-border);
  color: var(--vc-text);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.25rem 0.65rem;
}

.panel-lightbox-close:hover {
  border-color: var(--vc-orange);
  color: var(--vc-orange);
}

.panel-modal {
  position: fixed;
  inset: 0;
  z-index: 1900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.panel-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.panel-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 40, 65, 0.75);
}

.panel-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  max-height: 85vh;
  overflow: auto;
  margin: 0;
}

.panel-modal-card h2 {
  margin-top: 0;
}

.panel-modal-actions-row {
  margin-bottom: 0.75rem;
}

.assets-zip-product-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  max-height: 40vh;
  overflow-y: auto;
}

.assets-zip-product-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--vc-border);
  border-radius: 8px;
  background: var(--vc-surface);
  cursor: pointer;
}

.assets-zip-product-item input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.assets-zip-product-label {
  font-size: 0.9rem;
  line-height: 1.4;
}

.assets-zip-product-label small {
  display: block;
  color: var(--vc-text-muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.panel-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.error-box {
  padding: 1rem;
  background: rgba(255, 108, 14, 0.12);
  border: 1px solid rgba(255, 108, 14, 0.4);
  border-radius: 8px;
  color: var(--vc-warn);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--vc-border);
  border-top-color: var(--vc-orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.line-count {
  font-size: 0.8rem;
  color: var(--vc-text-muted);
  margin-top: 0.25rem;
}

.main-content strong,
.text-emphasis {
  color: var(--vc-emphasis);
  font-weight: 600;
}

@media (max-width: 768px) {
  .site-header-inner {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .logo-link {
    grid-column: 1;
    grid-row: 1;
  }

  .site-header-end {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .user-menu-name {
    display: none;
  }

  .user-menu-divider {
    display: none;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 0.65rem 1rem;
  }

  .detail-row {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }
}

.section-heading {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--vc-heading);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.phase-stepper {
  list-style: none;
  padding: 0;
  margin: 0;
}

.phase-stepper li {
  position: relative;
  padding: 0.65rem 1rem;
  margin-bottom: 0.35rem;
  border-radius: var(--vc-radius);
  border: 1px solid var(--vc-border);
  background: var(--vc-surface);
}

.phase-stepper li.phase-running,
.blueprint-phase-group.phase-running-comet {
  position: relative;
  z-index: 1;
  transform-origin: center center;
  animation: phase-running-breathe 3.4s cubic-bezier(0.42, 0, 0.58, 1) infinite;
  border: 1px solid rgba(255, 108, 14, 0.28);
  background: var(--vc-surface);
  overflow: visible;
  box-shadow: 0 0 16px rgba(255, 108, 14, 0.07);
}

.phase-stepper li.phase-completed {
  border-color: rgba(255, 108, 14, 0.35);
}

.phase-stepper li.phase-failed,
.phase-stepper li.phase-stopped {
  border-color: var(--vc-warn);
}

.phase-stepper li.phase-awaiting_approval {
  border-color: #ffc107;
  background: rgba(255, 193, 7, 0.08);
}

.phase-stepper li.phase-approved {
  border-color: rgba(255, 108, 14, 0.35);
  background: rgba(255, 108, 14, 0.06);
}

.phase-approval-panel {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border-radius: var(--vc-radius);
  border: 1px solid rgba(255, 193, 7, 0.35);
  background: rgba(255, 193, 7, 0.06);
}

.phase-retry-panel {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border-radius: var(--vc-radius);
  border: 1px solid rgba(220, 53, 69, 0.35);
  background: rgba(220, 53, 69, 0.06);
}

.phase-stepper .phase-retry-btn {
  margin-left: 0.5rem;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  line-height: 1.2;
  vertical-align: middle;
}

.phase-label {
  font-weight: 600;
  color: var(--vc-heading);
  margin-right: 0.35rem;
}

.phase-dl {
  color: var(--vc-emphasis);
  text-decoration: none;
  font-weight: 600;
}

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

.file-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--vc-border);
}

.file-size {
  color: var(--vc-text-muted);
  font-size: 0.85rem;
}

.runs-filters {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

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

.filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--vc-text-muted);
  min-width: 3.5rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--vc-border);
  background: transparent;
  color: var(--vc-text);
  font-size: 0.85rem;
  cursor: pointer;
}

.filter-chip.active {
  border-color: var(--vc-orange);
  background: rgba(255, 108, 14, 0.15);
  color: var(--vc-heading);
}

.type-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.35rem;
}

.type-report {
  background: rgba(134, 186, 234, 0.2);
  color: var(--light-blue);
}

.type-blueprint {
  background: rgba(255, 108, 14, 0.2);
  color: var(--vc-emphasis);
}

.type-images {
  background: rgba(200, 216, 231, 0.25);
  color: var(--lightest-blue);
}

.run-phase {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  color: var(--vc-text-muted);
}

.runs-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.asset-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 960px) {
  .asset-categories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .asset-categories {
    grid-template-columns: 1fr;
  }
}

.asset-upload-section {
  padding-top: 0.25rem;
}

.asset-section-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.asset-section-header .section-heading {
  margin: 0;
}

.asset-section-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--vc-text-muted);
  border: 1px solid var(--vc-border);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.asset-section-hint {
  margin-top: 0;
  margin-bottom: 0.85rem;
}

.asset-category {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
  border: 1px solid var(--vc-border);
  border-radius: var(--vc-radius);
  background: var(--vc-surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.asset-category:hover,
.asset-category:focus-within {
  border-color: rgba(255, 108, 14, 0.45);
  background: var(--vc-surface-elevated);
}

.asset-category label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0;
  color: var(--vc-heading);
}

.asset-formats {
  font-size: 0.72rem;
  color: var(--vc-text-muted);
  letter-spacing: 0.02em;
}

.asset-file-input {
  width: 100%;
  font-size: 0.78rem;
  padding: 0.35rem 0.25rem;
  color: var(--vc-text-muted);
  background: rgba(2, 40, 65, 0.35);
  border: 1px dashed rgba(134, 186, 234, 0.35);
  border-radius: 8px;
  cursor: pointer;
}

.asset-file-input::file-selector-button {
  margin-right: 0.5rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--vc-border);
  border-radius: 6px;
  background: rgba(32, 71, 116, 0.65);
  color: var(--vc-text);
  font-size: 0.72rem;
  cursor: pointer;
}

.asset-file-count {
  min-height: 1rem;
  font-size: 0.72rem;
  color: var(--vc-orange);
  font-weight: 500;
}

.asset-file-count:empty {
  display: none;
}

.blueprint-downloads {
  margin-top: 1.5rem;
}

.blueprint-downloads-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.blueprint-downloads-header .section-heading {
  margin: 0;
}

.blueprint-downloads-subtitle {
  margin: 0.25rem 0 0;
}

.blueprint-file-groups {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.blueprint-phase-group {
  position: relative;
  border: 1px solid var(--vc-border);
  border-radius: var(--vc-radius);
  background: var(--vc-surface);
  padding: 1rem;
}

.blueprint-phase-group-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.blueprint-phase-group-head h3 {
  margin: 0;
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--vc-emphasis);
}

.blueprint-phase-count {
  font-size: 0.75rem;
  color: var(--vc-text-muted);
  border: 1px solid var(--vc-border);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.blueprint-phase-status {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--vc-text-muted);
}

.blueprint-phase-status.status-completed {
  background: var(--vc-orange);
}

.blueprint-phase-status.status-running {
  background: var(--vc-orange);
  box-shadow: 0 0 0 2px rgba(255, 108, 14, 0.35);
  animation: blueprint-running-dot-pulse 1.4s ease-in-out infinite;
}

@keyframes blueprint-running-dot-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 2px rgba(255, 108, 14, 0.35),
      0 0 6px rgba(255, 108, 14, 0.45);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(255, 108, 14, 0.55),
      0 0 10px rgba(255, 108, 14, 0.65);
  }
}

.blueprint-phase-status.status-failed,
.blueprint-phase-status.status-stopped {
  background: var(--vc-warn);
}

.blueprint-file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

@media (max-width: 640px) {
  .blueprint-file-grid {
    grid-template-columns: 1fr;
  }
}

.blueprint-file-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--vc-border);
  border-radius: 8px;
  background: var(--vc-surface-elevated);
  min-width: 0;
}

.blueprint-file-card--deliverable {
  border-left: 3px solid var(--vc-orange);
}

.blueprint-file-badge {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--vc-heading);
  background: rgba(255, 108, 14, 0.15);
  border: 1px solid rgba(255, 108, 14, 0.35);
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
}

.blueprint-file-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.blueprint-file-name {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blueprint-file-size {
  font-size: 0.72rem;
  color: var(--vc-text-muted);
}

.blueprint-file-download {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Auth & user management */
.user-menu {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(32, 71, 116, 0.45);
  border: 1px solid var(--vc-border);
  font-size: 0.8125rem;
}

.user-menu-name {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--vc-text);
  font-weight: 600;
}

.user-menu-divider {
  width: 1px;
  height: 1rem;
  background: var(--vc-border);
  flex-shrink: 0;
}

.user-menu-link {
  color: var(--vc-light-blue);
  text-decoration: none;
  white-space: nowrap;
}

.user-menu-link:hover {
  color: var(--vc-orange);
}

.logout-form {
  margin: 0;
}

.user-menu-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.login-page .login-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem;
}

.login-logo {
  display: block;
  margin: 0 auto 1.5rem;
}

.login-title {
  margin: 0 0 0.35rem;
  text-align: center;
}

.login-subtitle {
  margin: 0 0 1.5rem;
  text-align: center;
  color: var(--vc-text-muted);
}

.login-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.login-form input,
.auth-form input,
.auth-form select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--vc-border);
  border-radius: 8px;
  background: rgba(2, 40, 65, 0.5);
  color: var(--vc-text);
  font: inherit;
}

.btn-block {
  width: 100%;
}

.auth-form-card h2 {
  margin-top: 0;
}

.auth-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.filter-select {
  min-width: 180px;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--vc-border);
  border-radius: 8px;
  background: var(--vc-surface-elevated);
  color: var(--vc-text);
  font: inherit;
}

.run-creator {
  color: var(--vc-text-muted);
  font-size: 0.85rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--vc-border);
  text-align: left;
}

.admin-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--vc-text-muted);
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.users-list-empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--vc-text-muted);
  border: 1px dashed var(--vc-border);
  border-radius: var(--vc-radius);
}

.user-card {
  padding: 1rem 1.25rem;
  background: var(--vc-surface);
  border: 1px solid var(--vc-border);
  border-radius: var(--vc-radius);
}

.user-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.user-card-identity {
  min-width: 0;
  flex: 1;
}

.user-card-name {
  margin: 0 0 0.15rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--vc-heading);
  word-break: break-word;
}

.user-card-email {
  margin: 0;
  font-size: 0.9rem;
  color: var(--vc-text-muted);
  word-break: break-all;
}

.user-card-details {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 1rem;
}

.user-detail-row {
  display: grid;
  grid-template-columns: minmax(5rem, 7rem) minmax(0, 1fr);
  gap: 0.5rem 1rem;
  align-items: center;
  font-size: 0.9rem;
}

.user-detail-row dt {
  margin: 0;
  color: var(--vc-emphasis);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.user-detail-row dd {
  margin: 0;
  min-width: 0;
  color: var(--vc-text);
}

.user-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--vc-border);
}

.status-active {
  background: rgba(255, 108, 14, 0.15);
  color: var(--vc-heading);
  flex-shrink: 0;
}

.status-inactive {
  background: rgba(32, 71, 116, 0.5);
  color: var(--vc-text-muted);
  flex-shrink: 0;
}

.admin-actions {
  white-space: nowrap;
}

.slack-id-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
}

.slack-id-input {
  flex: 1 1 6rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--vc-border);
  border-radius: 6px;
  background: var(--vc-surface);
  color: var(--vc-text);
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.btn-danger {
  background: rgba(255, 80, 60, 0.2);
  border: 1px solid rgba(255, 120, 90, 0.55);
  color: #ffb4a0;
}

.btn-danger:hover {
  background: rgba(255, 80, 60, 0.35);
  color: #fff;
}

.role-select {
  width: 100%;
  max-width: 10rem;
  padding: 0.25rem 0.4rem;
  font-size: 0.85rem;
}

.admin-super-toggle {
  margin: 0;
  font-size: 0.85rem;
}

.admin-super-toggle input {
  margin-right: 0.35rem;
}

.admin-banner {
  margin-bottom: 1.5rem;
}

.admin-banner-success {
  border-left: 3px solid var(--vc-orange);
}

.admin-banner-error {
  border-left: 3px solid var(--vc-warn);
}

.credential-code {
  font-size: 1.05rem;
  padding: 0.15rem 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

.credentials-modal-card {
  max-width: 32rem;
}

.credentials-modal-lead {
  margin-bottom: 1.25rem;
}

.credentials-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.credential-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.credential-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--vc-text-muted);
}

.credential-value-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.credentials-warn {
  margin: 0 0 1.25rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--vc-radius);
  border: 1px solid rgba(255, 171, 112, 0.35);
  background: rgba(255, 171, 112, 0.08);
  color: var(--vc-warn-strong);
  font-size: 0.9rem;
}

.credential-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
  max-width: 100%;
}

.credential-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--vc-border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--vc-text);
  flex: 1;
  min-width: 0;
}

.credential-input-password {
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.credential-copy-btn {
  flex-shrink: 0;
}

.hint-success {
  color: var(--vc-light-blue);
}

.table-wrap {
  overflow-x: auto;
}
