/* Base page styling (dark grainy background similar to lovable.dev) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  /* Prevent overscroll bounce on mobile to avoid background flickering */
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background-color: #050608;
  color: #f5f5f5;
}

.page-root {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  background-color: #050608;
  /* Prevent overscroll bounce on mobile */
  overscroll-behavior: none;
}

/* === Scraped gradient background structure ===
   Mirrors:
   <div class="absolute inset-0 w-full overflow-hidden">
     <div class="absolute inset-0 mt-0 blur-[10px]" style="opacity:0;transform:translateY(50vh)">
       <div class="absolute left-1/2 aspect-square w-[350%] -translate-x-1/2 overflow-hidden ...">
         style="background-image:url(/img/background/gradient-optimized.webp); ... mask:linear-gradient(...)"
*/

.bg-gradient-root {
  position: absolute;
  inset: 0;
  width: 100%;
  overflow: hidden;
  /* Dark grey base so the gradient always sits on a soft, grainy black */
  background-color: #1a1a1a;
  pointer-events: none;
}

.bg-gradient-wrapper {
  position: absolute;
  inset: 0;
  margin-top: 0;
  filter: blur(10px); /* blur-[10px] */

  /* Initial state from SSR markup on lovable.dev */
  opacity: 0;
  transform: translateY(50vh);

  /* Fade + lift animation on first load */
  animation: lovable-gradient-in 1800ms cubic-bezier(0.22, 0.61, 0.36, 1) 400ms
    forwards;
}

.bg-gradient-image {
  position: absolute;
  left: 50%;
  top: -10vh;

  /* scroll-controlled transform pieces */
  --gradient-offset-x: 0px;
  --gradient-y: 0px;
  --gradient-scale: 1;
  transform: translate3d(
      calc(-50% + var(--gradient-offset-x)),
      var(--gradient-y),
      0
    )
    scale(var(--gradient-scale));
  transition: transform 900ms cubic-bezier(0.22, 0.61, 0.36, 1),
    top 900ms cubic-bezier(0.22, 0.61, 0.36, 1);

  /* slightly smaller than original w-[350%] to reveal more roundness */
  width: 260%;
  padding-bottom: 260%; /* maintain square via padding hack */

  overflow: hidden;

  background-image: url("gradient-optimized.webp");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center top;

  /* Mask from lovable.dev inline style */
  -webkit-mask: linear-gradient(
    to bottom,
    transparent 0%,
    black 5%,
    black 100%
  );
  mask: linear-gradient(to bottom, transparent 0%, black 5%, black 100%);

  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000px;
  perspective: 1000px;
  will-change: transform;
}

@media (max-width: 767px) {
  /* On mobile, keep a shorter, transform-only transition so the return
     from the docked state feels smooth without heavy repaint cost. */
  .bg-gradient-image {
    transition: transform 450ms cubic-bezier(0.22, 0.61, 0.36, 1);
  }
}

/* Grain overlay: taken from view-source lovable.dev (different host path) */
.bg-grain-overlay {
  position: absolute;
  inset: 0;
  background-image: url("https://lovable.dev/_next/static/media/grain.1ccdda41.png");
  background-size: 100px 100px;
  background-repeat: repeat;
  background-position: left top;
  opacity: 1;
  background-blend-mode: overlay;
  mix-blend-mode: overlay;
}

/* Foreground content styling */
.page-content {
  position: relative;
  z-index: 1;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  will-change: transform, opacity;
  opacity: 0;
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.hero h1 {
  font-size: clamp(2.8rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}

.hero p {
  font-size: 1.05rem;
  max-width: 32rem;
  margin: 0;
  color: #ffffff;
}

.accent {
  background: linear-gradient(120deg, #ff7a18, #ffb347);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.copy-section {
  max-width: 48rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 0;
  text-align: left;
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 700ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.copy-section--last {
  padding-bottom: 4rem; /* space between final copy and CTA */
}

.copy-section--visible {
  opacity: 1;
  transform: translateY(0);
}

.cta-row {
  max-width: 48rem;
  margin: 0 auto;
  /* equal-ish breathing room above and below the button */
  padding: 2rem 1.5rem 2rem;
  display: flex;
  justify-content: center;
}

.order-now-btn {
  padding: 0.9rem 2.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: transparent;
  color: #ffffff;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 160ms ease-out, color 160ms ease-out,
    background-color 160ms ease-out, transform 160ms ease-out;
}

.order-now-btn:hover {
  border-color: rgba(255, 255, 255, 0.9);
  background-color: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.order-now-btn:active {
  transform: translateY(0);
  background-color: rgba(255, 255, 255, 0.08);
}

.order-now-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
  text-decoration: none;
}

/* ---- Order page ---- */

.order-body {
  background: #050608;
  color: #f5f5f5;
}

.order-page {
  min-height: 100vh;
  padding: 5rem 1.5rem 4rem;
  position: relative;
  z-index: 1; /* keep order UI above gradient background */
}

.order-hero {
  max-width: 44rem;
  margin: 0 auto 2.5rem;
}

.order-hero h1 {
  font-size: clamp(2rem, 4vw, 2.7rem);
  margin: 0 0 0.75rem;
}

.order-hero p {
  margin: 0;
  color: #dcdcdc;
  line-height: 1.7;
}

.order-banner {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.order-banner--success {
  color: #9ef7c5;
}

.order-banner--error {
  color: #ffb8b8;
}

.order-shell {
  max-width: 52rem;
  margin: 0 auto;
}

.order-card {
  border-radius: 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.04),
      transparent 55%
    ),
    rgba(7, 8, 12, 0.96);
  padding: 1.8rem 1.6rem 2.2rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75);
}

@media (min-width: 768px) {
  .order-card {
    padding: 2.2rem 2.2rem 2.6rem;
  }
}

.order-tabs {
  display: inline-flex;
  gap: 0.75rem;
  padding: 0.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.6rem;
}

.order-tab {
  border-radius: 999px;
  border: none;
  padding: 0.45rem 1.4rem;
  background: transparent;
  color: #f5f5f5;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.7;
}

.order-tab--active {
  background: #ffffff;
  color: #050608;
  opacity: 1;
}

.order-upload {
  border-radius: 1.25rem;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  background: radial-gradient(
      circle at 0% 0%,
      rgba(255, 255, 255, 0.05),
      transparent 55%
    ),
    rgba(7, 8, 12, 0.9);
  padding: 1.8rem 1.4rem 1.5rem;
  margin-bottom: 1.6rem;
}

.order-upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
}

.order-upload-icon {
  font-size: 1.5rem;
  margin-bottom: 0.2rem;
}

.order-upload-title {
  font-weight: 600;
}

.order-upload-sub {
  font-size: 0.85rem;
  color: #d0d0d0;
}

.order-upload-input {
  display: none;
}

.order-upload-preview {
  margin-top: 1.4rem;
  border-radius: 0.9rem;
  background: rgba(5, 6, 8, 0.9);
  padding: 0.75rem;
  min-height: 120px;
  display: none; /* toggled on when a file is present */
  align-items: center;
  justify-content: center;
}

.order-upload-preview img {
  display: block;
  max-width: none; /* sizing controlled via JS for 1:1 feel */
  max-height: none;
}

.order-upload-preview--visible {
  display: flex;
}

.order-upload-preview-fallback {
  font-size: 0.85rem;
  color: #d0d0d0;
  text-align: center;
  word-break: break-all;
}

.order-status {
  margin-top: 0.75rem;
  font-size: 0.82rem;
}

.order-status--success {
  color: #9ef7c5;
}

.order-status--error {
  color: #ffb8b8;
}

.order-upload-meta {
  margin: 0.9rem 0 0;
  font-size: 0.78rem;
  color: #a0a0a0;
  text-align: center;
}

.order-form {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.order-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.4rem;
}

@media (min-width: 640px) {
  .order-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }
}

.order-grid--stack {
  grid-template-columns: minmax(0, 1fr);
}

.order-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.order-field-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #a8a8a8;
}

.order-input {
  background: rgba(10, 11, 15, 0.9);
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.6rem 0.75rem;
  color: #f5f5f5;
  font-size: 0.9rem;
  outline: none;
}

.order-input:focus {
  border-color: rgba(255, 255, 255, 0.4);
}

.order-select {
  appearance: none;
  background-image: linear-gradient(
      45deg,
      transparent 50%,
      rgba(245, 245, 245, 0.9) 50%
    ),
    linear-gradient(
      -45deg,
      transparent 50%,
      rgba(245, 245, 245, 0.9) 50%
    );
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
}

.order-textarea {
  resize: vertical;
  min-height: 4.2rem;
}

.order-qty {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  background: rgba(10, 11, 15, 0.9);
}

.order-qty-btn {
  border: none;
  background: transparent;
  color: #f5f5f5;
  width: 2.2rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.order-qty-input {
  border: none;
  background: transparent;
  width: 3.2rem;
  text-align: center;
  color: #f5f5f5;
  font-size: 0.9rem;
}

/* Remove native number spinners so only our +/- controls are visible */
.order-qty-input[type="number"]::-webkit-outer-border-spin-button,
.order-qty-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.order-qty-input[type="number"] {
  -moz-appearance: textfield;
}

.order-price-note {
  font-size: 0.8rem;
  color: #b8b8b8;
}

.order-summary {
  margin-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.9rem;
  font-size: 0.82rem;
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.order-summary-label {
  color: #a0a0a0;
}

.order-summary-value {
  font-weight: 500;
}

.order-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: flex-start;
}

@media (min-width: 640px) {
  .order-actions {
    flex-direction: row;
    align-items: center;
  }
}

.order-primary-btn {
  border-radius: 999px;
  border: none;
  padding: 0.85rem 2.4rem;
  font-size: 0.84rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  background: #ffffff;
  color: #050608;
  cursor: pointer;
}

.order-disclaimer {
  font-size: 0.78rem;
  color: #9a9a9a;
}

/* ---- Operator backend (ops.html / backend.html) ---- */

.ops-subheading {
  font-size: 1.2rem;
  margin: 0 0 1.0rem;
  font-weight: 600;
}

.ops-layout {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .ops-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .ops-detail-column {
    order: 2;
  }
}

.ops-list-column {
  min-width: 0;
}

.ops-order-list {
  margin-top: 0.25rem;
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.4rem 0.35rem 0.4rem 0.35rem;
  max-height: 26rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ops-order-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.8rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.05),
      transparent 60%
    ),
    rgba(7, 8, 12, 0.96);
  cursor: pointer;
  transition: border-color 140ms ease-out, background-color 140ms ease-out,
    transform 140ms ease-out;
}

.ops-order-row:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background-color: rgba(10, 11, 15, 0.97);
  transform: translateY(-1px);
}

.ops-order-row--selected {
  border-color: rgba(255, 255, 255, 0.42);
  background-color: rgba(10, 11, 15, 0.98);
}

.ops-order-thumb {
  width: 52px;
  height: 52px;
  border-radius: 0.75rem;
  background: radial-gradient(
      circle at 0% 0%,
      rgba(255, 255, 255, 0.06),
      transparent 55%
    ),
    rgba(5, 6, 8, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.ops-order-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ops-order-thumb-empty {
  font-size: 0.68rem;
  color: #a8a8b4;
  text-align: center;
  padding: 0 0.2rem;
}

.ops-order-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.ops-order-top-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.ops-order-job {
  font-size: 0.94rem;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ops-order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.ops-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.08rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #c2c2d4;
  background: rgba(10, 11, 16, 0.96);
}

.ops-pill--muted {
  border-color: rgba(255, 255, 255, 0.08);
  color: #9d9db0;
}

.ops-pill--soft {
  background: rgba(255, 255, 255, 0.04);
}

.ops-pill--due {
  border-color: rgba(255, 211, 130, 0.6);
  background: rgba(53, 42, 14, 0.9);
  color: #ffd382;
}

.ops-order-quickline {
  font-size: 0.8rem;
  color: #c3c3cf;
}

.ops-order-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  margin-left: 0.5rem;
}

@media (max-width: 640px) {
  .ops-order-actions {
    align-items: flex-start;
  }
}

.ops-status-pill {
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.ops-status-pill--pending {
  background: rgba(36, 36, 62, 0.9);
  color: #d1d5ff;
  border-color: rgba(141, 151, 255, 0.7);
}

.ops-status-pill--completed {
  background: rgba(22, 49, 36, 0.95);
  color: #9ef7c5;
  border-color: rgba(158, 247, 197, 0.9);
}

.ops-status-pill--canceled,
.ops-status-pill--cancelled {
  background: rgba(61, 26, 29, 0.95);
  color: #ffb8b8;
  border-color: rgba(255, 184, 184, 0.9);
}

.ops-mark-complete {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 0.25rem 0.8rem;
  background: transparent;
  color: #f5f5f5;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.ops-mark-complete:disabled {
  opacity: 0.4;
  cursor: default;
}

.ops-mark-complete:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.06);
}

.ops-mark-complete:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.ops-detail-column {
  min-width: 0;
}

.ops-detail-placeholder {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #a8a8b4;
}

.ops-detail-card {
  margin-top: 0.25rem;
  border-radius: 1rem;
  background: radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.05),
      transparent 55%
    ),
    rgba(7, 8, 12, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1rem 1.2rem;
  font-size: 0.86rem;
}

.ops-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.7rem;
}

.ops-detail-title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.ops-detail-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #b4b4c4;
}

.ops-detail-badges {
  display: flex;
  gap: 0.35rem;
}

.ops-detail-art-section {
  margin-bottom: 0.9rem;
}

.ops-detail-art {
  border-radius: 0.9rem;
  background: rgba(5, 6, 9, 0.95);
  padding: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
}

.ops-detail-art img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  display: block;
}

.ops-detail-dates {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem;
}

@media (min-width: 520px) {
  .ops-detail-dates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ops-detail-date-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.ops-detail-label {
  font-size: 0.78rem;
  color: #9ea0b4;
}

.ops-detail-value {
  font-size: 0.8rem;
  color: #e3e3ee;
  text-align: right;
}

.ops-detail-overdue {
  color: #ffb8b8;
}

.ops-detail-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
}

@media (max-width: 520px) {
  .ops-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ops-detail-grid-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ops-detail-notes {
  margin-top: 1rem;
}

.ops-detail-section-heading {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #8c8ead;
}

.ops-detail-notes-body {
  margin: 0;
  font-size: 0.8rem;
  color: #d2d2df;
}

.ops-detail-files {
  margin-top: 1rem;
}

.ops-detail-files-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.ops-detail-files-count {
  font-size: 0.78rem;
  color: #a8a8b8;
}

.ops-detail-files-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ops-file-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.ops-file-main {
  min-width: 0;
}

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

.ops-file-meta {
  font-size: 0.76rem;
  color: #aeb0c0;
}

.ops-file-actions {
  flex-shrink: 0;
}

.ops-view-file {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 0.2rem 0.7rem;
  background: transparent;
  color: #f5f5f5;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
}

.ops-view-file:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ops-view-file:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.copy-section h2 {
  margin: 0 0 1rem;
  font-size: 1.6rem;
}

.copy-section p {
  margin: 0 0 0.75rem;
  line-height: 1.7;
  color: #c0c0c0;
}

.page-footer {
  position: relative;
  z-index: 1;
  /* Reduce footer height so space below the CTA is closer to space above */
  min-height: 18vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 1.5rem 32px; /* increase space below logo */
}

.footer-logo {
  max-width: 154px; /* ~70% of previous 220px */
  width: 22vw; /* ~70% of previous 32vw */
  height: auto;
}

@keyframes lovable-gradient-in {
  0% {
    opacity: 0;
    transform: translateY(50vh);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Gang Builder ---- */

.gang-builder-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.gang-builder-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.gang-builder-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1600px;
  max-height: 90vh;
  background: radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.04),
      transparent 55%
    ),
    rgba(7, 8, 12, 0.98);
  border-radius: 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gang-builder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gang-builder-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.gang-builder-close {
  background: transparent;
  border: none;
  color: #f5f5f5;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  opacity: 0.7;
  transition: opacity 140ms ease-out;
}

.gang-builder-close:hover {
  opacity: 1;
}

.gang-builder-layout {
  display: grid;
  grid-template-columns: 320px 1fr 280px;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

@media (max-width: 1200px) {
  .gang-builder-layout {
    grid-template-columns: 280px 1fr 240px;
  }
}

@media (max-width: 900px) {
  .gang-builder-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  
  .gang-builder-left-panel {
    order: 1;
    max-height: 300px;
    overflow-y: auto;
  }
  
  .gang-builder-center {
    order: 2;
  }
  
  .gang-builder-right-panel {
    order: 3;
    max-height: 200px;
    overflow-y: auto;
  }
}

.gang-builder-left-panel,
.gang-builder-right-panel {
  background: rgba(5, 6, 8, 0.6);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
}

.gang-builder-right-panel {
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.gang-builder-center {
  background: rgba(10, 11, 15, 0.4);
  overflow: visible; /* Allow scrolling in child wrapper */
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 500px;
}

/* Controls Panel */

.gang-controls-panel {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.gang-controls-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gang-controls-heading {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #a8a8a8;
  font-weight: 600;
}

.gang-sheet-size-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gang-sheet-size-btn {
  padding: 0.6rem 1rem;
  background: rgba(10, 11, 15, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.7rem;
  color: #f5f5f5;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 140ms ease-out;
  text-align: left;
}

.gang-sheet-size-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(10, 11, 15, 0.95);
}

.gang-sheet-size-btn-active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.gang-upload-area {
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 0.9rem;
  background: rgba(7, 8, 12, 0.5);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 140ms ease-out;
}

.gang-upload-area:hover,
.gang-upload-area-dragover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(7, 8, 12, 0.7);
}

.gang-upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.gang-upload-icon {
  font-size: 1.5rem;
}

.gang-upload-text {
  font-size: 0.85rem;
  color: #d0d0d0;
}

.gang-designs-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}

.gang-empty-state {
  font-size: 0.8rem;
  color: #a0a0a0;
  text-align: center;
  padding: 1rem;
}

.gang-design-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(10, 11, 15, 0.6);
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.gang-design-item .gang-design-info {
  flex: 1;
  min-width: 120px;
}

.gang-design-thumb {
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  overflow: hidden;
  background: rgba(5, 6, 8, 0.9);
  flex-shrink: 0;
}

.gang-design-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gang-design-info {
  flex: 1;
  min-width: 0;
}

.gang-design-name {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gang-design-size {
  font-size: 0.7rem;
  color: #a0a0a0;
}

.gang-design-use-btn {
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  color: #f5f5f5;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms ease-out;
}

.gang-design-use-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.gang-design-remove-btn {
  background: transparent;
  border: none;
  color: #a0a0a0;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.6;
  transition: opacity 140ms ease-out;
}

.gang-design-remove-btn:hover {
  opacity: 1;
  color: #ffb8b8;
}

.gang-design-edit-btn {
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  color: #f5f5f5;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms ease-out;
  margin-right: 0.5rem;
}

.gang-design-edit-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.gang-size-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gang-size-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gang-size-inputs .gang-input {
  width: 100%;
}

.gang-dpi-display {
  padding: 0.75rem;
  background: rgba(10, 11, 15, 0.6);
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gang-dpi-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.gang-dpi-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f5f5f5;
}

.gang-dpi-details {
  font-size: 0.75rem;
  color: #a0a0a0;
}

.gang-layout-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.gang-label {
  font-size: 0.8rem;
  color: #a8a8a8;
}

.gang-auto-pack-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.gang-auto-pack-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gang-auto-pack-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(10, 11, 15, 0.6);
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gang-auto-pack-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #f5f5f5;
  margin-bottom: 0.25rem;
}

.gang-auto-pack-item .gang-auto-pack-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.gang-auto-pack-item .gang-input {
  width: 80px;
}

.gang-auto-pack-max {
  font-size: 0.7rem;
  color: #a0a0a0;
  margin-top: 0.25rem;
}

.gang-select,
.gang-input {
  background: rgba(10, 11, 15, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: #f5f5f5;
  font-size: 0.85rem;
  outline: none;
}

.gang-select:focus,
.gang-input:focus {
  border-color: rgba(255, 255, 255, 0.4);
}

.gang-select {
  flex: 1;
  min-width: 0;
}

.gang-input {
  width: 60px;
}

.gang-snap-buttons {
  display: flex;
  gap: 0.5rem;
}

.gang-snap-btn {
  flex: 1;
  padding: 0.5rem;
  background: rgba(10, 11, 15, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.5rem;
  color: #f5f5f5;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 140ms ease-out;
}

.gang-snap-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.gang-snap-btn-active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.gang-order-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gang-qty-controls {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  background: rgba(10, 11, 15, 0.9);
}

.gang-qty-btn {
  border: none;
  background: transparent;
  color: #f5f5f5;
  width: 2.2rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gang-qty-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.gang-price-preview {
  padding: 0.75rem;
  background: rgba(10, 11, 15, 0.6);
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gang-price-band {
  font-size: 0.75rem;
  color: #a8a8a8;
  margin-bottom: 0.5rem;
}

.gang-price-total {
  font-size: 0.9rem;
  font-weight: 500;
  color: #f5f5f5;
}

.gang-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: none;
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms ease-out;
}

.gang-btn-primary {
  background: #ffffff;
  color: #050608;
}

.gang-btn-primary:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
}

.gang-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gang-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Canvas */

.gang-canvas-wrapper {
  width: 100%;
  height: 100%;
  display: block;
  padding: 2rem;
  min-height: 400px;
  overflow: auto !important; /* Force scrolling if sheet is larger than viewport */
  position: relative;
}

.gang-canvas-container {
  position: relative;
  background: rgba(5, 6, 8, 0.3);
  overflow: visible; /* Allow canvas to overflow if needed */
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto; /* Center the container */
  /* Width and height set dynamically by JS */
}

.gang-zoom-controls {
  position: fixed;
  top: auto;
  right: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.5rem;
  border-radius: 0.5rem;
  z-index: 1001;
  pointer-events: auto;
  /* Position will be set by JavaScript relative to center panel */
}

.gang-zoom-btn {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.25rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.gang-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.gang-zoom-btn:active {
  background: rgba(255, 255, 255, 0.15);
}

.gang-zoom-level {
  min-width: 3.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  font-weight: 500;
}

#gang-canvas {
  display: block;
  /* Width/height set dynamically by JS to fit content */
  min-width: 100%;
  min-height: 100%;
}

/* Stats Panel */

.gang-stats-panel {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.gang-stats-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gang-stats-heading {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #a8a8a8;
  font-weight: 600;
}

.gang-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.gang-stat-label {
  font-size: 0.8rem;
  color: #a0a0a0;
}

.gang-stat-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: #f5f5f5;
}

.gang-usage-display {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gang-usage-percent {
  font-size: 2rem;
  font-weight: 600;
  color: #f5f5f5;
}

.gang-usage-details {
  font-size: 0.8rem;
  color: #a0a0a0;
}

.gang-quality-status {
  padding: 0.75rem;
  background: rgba(10, 11, 15, 0.6);
  border-radius: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gang-quality-text {
  margin: 0;
  font-size: 0.8rem;
  color: #d0d0d0;
}

.gang-quality-warning {
  color: #ffd382;
}


