/* =========================
   STOCK GUARD COLOUR THEME
   ========================= */

.stock-page {
  --stock-dark: #170804;
  --stock-red: #ee431d;
  --stock-coral: #fc9985;
  --stock-peach: #ffb9aa;
  --stock-cream: #fff0e5;

  --stock-surface: #ffffff;
  --stock-text: #24110d;
  --stock-muted: #7d625c;
  --stock-line: #f0d5ce;
  --stock-soft-bg: #fff8f5;
  --stock-shadow: 0 18px 45px rgba(72, 25, 15, 0.12);

  background:
    radial-gradient(circle at 0 0, rgba(255, 185, 170, 0.35), transparent 28rem),
    #fff8f5;
}


.stock-page .stock-hero {
  padding: 72px 0 110px;
  color: white;
  background:
    radial-gradient(circle at 88% 10%, rgba(255, 185, 170, 0.55), transparent 24rem),
    linear-gradient(
      135deg,
      #170804 0%,
      #7b1e10 42%,
      #ee431d 72%,
      #fc9985 100%
    );
  position: relative;
  z-index: 0;
}


.stock-page .stock-page-shell {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
}


.stock-page .stock-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: center;
  gap: 60px;
  position: relative;
  z-index: 1;
}

.stock-page .stock-hero-brand-row {
  display: block;
  width: 100%;
}

.stock-page .stock-eyebrow {
  display: inline-block;
  color: var(--stock-peach);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.stock-page .stock-hero h1 {
  max-width: 760px;
  margin: 14px 0 16px;
  font-size: clamp(40px, 5.5vw, 68px);
  line-height: 1.03;
  letter-spacing: -2.4px;
}

.stock-page .stock-hero-copy > p {
  max-width: 690px;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 17px;
  line-height: 1.65;
}

.stock-page .stock-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.stock-page .primary-action-btn,
.stock-page .secondary-action-btn,
.stock-page .outline-action-btn,
.stock-page .run-stock-btn {
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.stock-page .primary-action-btn {
  border: 0;
  color: white;
  background: var(--stock-red);
  box-shadow: 0 12px 26px rgba(238, 67, 29, 0.28);
}

.stock-page .primary-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(238, 67, 29, 0.35);
}

.stock-page .secondary-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.stock-page .stock-workspace .secondary-action-btn {
  border-color: var(--stock-line);
  color: var(--stock-dark);
  background: var(--stock-cream);
}

.stock-page .stock-health-card {
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 20px 45px rgba(23, 8, 4, 0.28);
  backdrop-filter: blur(14px);
}

.stock-page .stock-health-card-top,
.stock-page .stock-health-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stock-page .stock-health-card-top {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.stock-page .system-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--stock-peach);
  box-shadow: 0 0 0 6px rgba(255, 185, 170, 0.18);
}

.stock-page .stock-health-card > strong {
  display: block;
  margin-top: 18px;
  font-size: 42px;
  line-height: 1;
}

.stock-page .stock-health-card > p {
  margin: 12px 0 24px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.55;
}

.stock-page .stock-health-meta {
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 12px;
}

.stock-page .stock-health-meta span {
  color: rgba(255, 255, 255, 0.65);
}

.stock-page .stock-workspace {
  padding-bottom: 60px;
  position: relative;
  z-index: 10;
}

.stock-page .stock-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: 25px 27px;
  border: 1px solid var(--stock-line);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--stock-shadow);
  margin-top: -58px;
}

.stock-page .stock-section-heading h2 {
  margin: 7px 0 0;
  color: var(--stock-dark);
  font-size: 26px;
  letter-spacing: -0.7px;
}

.stock-page .stock-section-heading p {
  margin: 7px 0 0;
  color: var(--stock-muted);
  font-size: 14px;
  line-height: 1.55;
}

.stock-page .section-kicker {
  color: var(--stock-red);
}

.stock-page .workspace-state-pill {
  padding: 9px 13px;
  border-radius: 999px;
  color: #8d321e;
  background: var(--stock-cream);
  font-size: 11px;
  font-weight: 900;
}

.stock-page .stock-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.stock-page .stock-panel,
.stock-page .stock-summary-card {
  border: 1px solid var(--stock-line);
  background: var(--stock-surface);
  box-shadow: var(--stock-shadow);
}

.stock-page .stock-panel {
  padding: 26px;
  border-radius: 24px;
}

.stock-page .stock-panel-heading > div {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stock-page .panel-step {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: linear-gradient(135deg, var(--stock-red), var(--stock-coral));
  font-size: 12px;
  font-weight: 900;
}

.stock-page .stock-panel-heading h3 {
  margin: 0;
  color: var(--stock-dark);
  font-size: 20px;
}

.stock-page .stock-panel-heading p {
  margin: 6px 0 0;
  color: var(--stock-muted);
  font-size: 13px;
  line-height: 1.5;
}

.stock-page .stock-drop-zone {
  min-height: 245px;
  margin-top: 22px;
  padding: 30px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 2px dashed #efb7aa;
  border-radius: 20px;
  color: var(--stock-muted);
  background:
    linear-gradient(145deg, #fffdfc, var(--stock-soft-bg));
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.stock-page .stock-drop-zone:hover {
  transform: translateY(-2px);
  border-color: var(--stock-red);
  background: var(--stock-cream);
}

.stock-page .drop-zone-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 17px;
  color: white;
  background: linear-gradient(135deg, var(--stock-red), var(--stock-coral));
  font-size: 25px;
  font-weight: 900;
}

.stock-page .stock-drop-zone strong {
  color: var(--stock-dark);
  font-size: 17px;
}

.stock-page .stock-drop-zone small {
  margin-top: 4px;
  color: #a78b84;
}

.stock-page .product-type-list {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.stock-page .product-type-option {
  min-height: 65px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--stock-line);
  border-radius: 16px;
  background: var(--stock-soft-bg);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.stock-page .product-type-option:hover {
  transform: translateX(3px);
  border-color: var(--stock-coral);
}

.stock-page .product-type-option.selected,
.stock-page .product-type-option:has(input:checked) {
  border-color: var(--stock-red);
  background: var(--stock-cream);
}

.stock-page .product-type-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.stock-page .product-type-check {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 2px solid #d7aaa0;
  border-radius: 7px;
  background: white;
}

.stock-page .product-type-option input:checked + .product-type-check {
  border-color: var(--stock-red);
  background: var(--stock-red);
}

.stock-page .product-type-option input:checked + .product-type-check::after {
  content: "✓";
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.stock-page .product-type-option strong,
.stock-page .product-type-option small {
  display: block;
}

.stock-page .product-type-option strong {
  color: var(--stock-dark);
  font-size: 13px;
}

.stock-page .product-type-option small {
  margin-top: 4px;
  color: var(--stock-muted);
  font-size: 11px;
}

.stock-page .stock-run-panel {
  margin-top: 20px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: 22px;
  color: white;
  background:
    linear-gradient(135deg, var(--stock-dark), #6d1d10 62%, var(--stock-red));
  box-shadow: var(--stock-shadow);
}

.stock-page .stock-run-copy {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stock-page .run-panel-icon {
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--stock-dark);
  background: var(--stock-peach);
  font-size: 20px;
  font-weight: 900;
}

.stock-page .stock-run-copy h3 {
  margin: 0;
}

.stock-page .stock-run-copy p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.stock-page .run-stock-btn {
  min-width: 190px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  color: var(--stock-dark);
  background: var(--stock-peach);
}

.stock-page .run-stock-btn:disabled,
.stock-page button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.stock-page .stock-results-section,
.stock-page .report-delivery-section {
  margin-top: 34px;
}

.stock-page .stock-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stock-page .stock-summary-card {
  padding: 20px;
  border-radius: 19px;
}

.stock-page .summary-label {
  color: var(--stock-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.stock-page .stock-summary-card strong {
  display: block;
  margin: 8px 0 5px;
  color: var(--stock-red);
  font-size: 36px;
  line-height: 1;
}

.stock-page .stock-summary-card small {
  color: var(--stock-muted);
}

.stock-page .results-table-panel {
  margin-top: 18px;
  padding: 0;
  overflow: hidden;
}

.stock-page .results-toolbar {
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--stock-line);
  background: var(--stock-soft-bg);
}

.stock-page .results-search-wrap {
  min-width: 280px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid var(--stock-line);
  border-radius: 13px;
  background: white;
}

.stock-page .results-search-wrap input,
.stock-page .results-filter-group select {
  min-height: 43px;
  border: 0;
  outline: none;
  color: var(--stock-text);
  background: transparent;
}

.stock-page .results-search-wrap input {
  width: 100%;
}

.stock-page .results-filter-group {
  display: flex;
  gap: 9px;
}

.stock-page .results-filter-group select {
  padding: 0 13px;
  border: 1px solid var(--stock-line);
  border-radius: 13px;
  background: white;
}

.stock-page .results-table-wrap {
  overflow-x: auto;
}

.stock-page .stock-results-table {
  width: 100%;
  border-collapse: collapse;
}

.stock-page .stock-results-table th,
.stock-page .stock-results-table td {
  padding: 15px 17px;
  border-bottom: 1px solid var(--stock-line);
  text-align: left;
  font-size: 13px;
}

.stock-page .stock-results-table th {
  color: #704c44;
  background: var(--stock-cream);
  font-size: 11px;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}

.stock-page .empty-results-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.stock-page .empty-results-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--stock-red);
  background: var(--stock-cream);
  font-size: 23px;
}

.stock-page .empty-results-state strong {
  margin-top: 12px;
  color: var(--stock-dark);
}

.stock-page .empty-results-state p {
  max-width: 430px;
  margin: 7px 0 0;
  color: var(--stock-muted);
  line-height: 1.55;
}

.stock-page .delivery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stock-page .delivery-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 19px;
}

.stock-page .delivery-card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: white;
  background: linear-gradient(135deg, var(--stock-red), var(--stock-coral));
  font-size: 18px;
  font-weight: 900;
}

.stock-page .delivery-card h3 {
  margin: 0 0 8px;
  color: var(--stock-dark);
}

.stock-page .delivery-card p {
  margin: 0;
  color: var(--stock-muted);
  line-height: 1.6;
}

.stock-page .full-width-btn {
  width: 100%;
  margin-top: auto;
}

.stock-page .schedule-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stock-page .schedule-disabled-pill {
  padding: 8px 11px;
  border-radius: 999px;
  color: #92523f;
  background: var(--stock-cream);
  font-size: 11px;
  font-weight: 900;
}

.stock-page .text-action-btn {
  border: 0;
  color: var(--stock-red);
  background: transparent;
  font-weight: 900;
}

@media (max-width: 960px) {
  .stock-page .stock-hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .stock-page .stock-health-card {
    max-width: 360px;
  }

  .stock-page .stock-control-grid,
  .stock-page .delivery-grid {
    grid-template-columns: 1fr;
  }

  .stock-page .stock-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .stock-page .stock-page-shell {
    width: min(100% - 24px, 1220px);
  }

  .stock-page .stock-hero {
    padding: 48px 0 92px;
  }

  .stock-page .stock-hero h1 {
    font-size: 42px;
    letter-spacing: -1.7px;
  }

  .stock-page .stock-hero-actions,
  .stock-page .stock-run-panel,
  .stock-page .results-toolbar,
  .stock-page .results-filter-group {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stock-page .primary-action-btn,
  .stock-page .secondary-action-btn,
  .stock-page .run-stock-btn {
    width: 100%;
  }

  .stock-page .stock-section-heading {
    align-items: flex-start;
    flex-direction: column;
    padding: 21px;
    margin-top: -58px;
  }

  .stock-page .stock-panel {
    padding: 20px;
  }

  .stock-page .stock-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stock-page .results-search-wrap {
    min-width: 0;
  }
}





.stock-page .stock-results-section {
  margin-top: 80px;
}

/* =========================
   STOCK FILE LINK INPUT
   ========================= */

.stock-page .stock-link-box {
  min-height: 245px;
  margin-top: 22px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 17px;
  border: 2px dashed #efb7aa;
  border-radius: 20px;
  background:
    linear-gradient(145deg, #fffdfc, var(--stock-soft-bg));
}

.stock-page .stock-link-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: white;
  background:
    linear-gradient(135deg, var(--stock-red), var(--stock-coral));
  font-size: 25px;
  font-weight: 900;
}

.stock-page .stock-link-heading {
  display: grid;
  gap: 5px;
}

.stock-page .stock-link-heading strong {
  color: var(--stock-dark);
  font-size: 17px;
}

.stock-page .stock-link-heading span {
  color: var(--stock-muted);
  font-size: 13px;
  line-height: 1.5;
}

.stock-page .stock-link-input-wrap {
  position: relative;
}

.stock-page .stock-link-input-wrap input {
  width: 100%;
  min-height: 52px;
  padding: 13px 46px 13px 15px;
  border: 1px solid var(--stock-line);
  border-radius: 14px;
  color: var(--stock-text);
  background: white;
  outline: none;
}

.stock-page .stock-link-input-wrap input:focus {
  border-color: var(--stock-red);
  box-shadow: 0 0 0 4px rgba(238, 67, 29, 0.11);
}

.stock-page .stock-link-input-wrap input.is-valid {
  border-color: #29966b;
  box-shadow: 0 0 0 4px rgba(41, 150, 107, 0.1);
}

.stock-page .stock-link-input-wrap input.is-invalid {
  border-color: #c9352b;
  box-shadow: 0 0 0 4px rgba(201, 53, 43, 0.09);
}

.stock-page .stock-link-clear-btn {
  position: absolute;
  top: 50%;
  right: 11px;
  width: 31px;
  height: 31px;
  padding: 0;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 9px;
  color: #8e6c65;
  background: var(--stock-cream);
  cursor: pointer;
  font-size: 19px;
}

.stock-page .stock-link-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stock-page .stock-link-footer small {
  color: var(--stock-muted);
}

.stock-page .stock-link-footer small.is-success {
  color: #15734f;
  font-weight: 800;
  font-size: 25px;
}

.stock-page .stock-link-footer small.is-error {
  color: #b32d23;
  font-weight: 800;
}

.stock-page .stock-link-check-btn {
  min-height: 39px;
  padding: 9px 14px;
  border: 0;
  border-radius: 11px;
  color: white;
  background: var(--stock-red);
  cursor: pointer;
  font-weight: 900;
}

.stock-page .stock-link-check-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.report-delivery-section {
   margin-top: 80px;
}

.stock-page .stock-workspace > .report-delivery-section {
  margin-top: 80px !important;
}


/* =========================
   CLICKABLE STOCK RESULTS
   ========================= */

.stock-page .clickable-stock-row {
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.stock-page .clickable-stock-row:hover {
  background: #fff8f5;
}

.stock-page .stock-parent-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.stock-page .stock-parent-link:hover strong {
  color: var(--stock-red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.stock-page .view-parent-details {
  display: inline-block;
  margin-top: 9px;
  color: var(--stock-red);
  font-size: 11px;
  font-weight: 900;
}

.stock-page .additional-child-link {
  color: var(--stock-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.85;
}

.stock-page .additional-child-link:hover {
  color: var(--stock-red);
  text-decoration: underline;
}


/* =========================
   PRODUCT DETAIL PAGE
   ========================= */

.stock-detail-page {
  background: var(--stock-soft-bg);
}

.stock-detail-page .stock-detail-hero {
  padding: 62px 0 105px;
  color: white;
  background:
    radial-gradient(
      circle at 88% 10%,
      rgba(255, 185, 170, 0.55),
      transparent 24rem
    ),
    linear-gradient(
      135deg,
      #170804 0%,
      #7b1e10 42%,
      #ee431d 72%,
      #fc9985 100%
    );
}

.stock-detail-page .stock-detail-back-link {
  display: inline-block;
  margin-bottom: 26px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.stock-detail-page .stock-detail-back-link:hover {
  color: white;
  text-decoration: underline;
}

.stock-detail-page .stock-detail-hero h1 {
  margin: 12px 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.stock-detail-page .stock-detail-parent-title {
  max-width: 850px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
  line-height: 1.65;
}

.stock-detail-page .stock-detail-summary {
  max-width: 760px;
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stock-detail-page .stock-detail-summary > div {
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.11);
}

.stock-detail-page .stock-detail-summary span,
.stock-detail-page .stock-detail-summary strong {
  display: block;
}

.stock-detail-page .stock-detail-summary span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.stock-detail-page .stock-detail-summary strong {
  margin-top: 7px;
  font-size: 18px;
}

.stock-detail-page .stock-detail-content {
  position: relative;
  z-index: 5;
  margin-top: -55px;
  padding-bottom: 60px;
}

.stock-detail-page .stock-detail-table-panel {
  margin-top: 20px;
  padding: 0;
  overflow: hidden;
}

.stock-detail-page .stock-detail-table {
  min-width: 1200px;
}

.stock-detail-page .problem-component-row {
  background: #fff3ef;
}

.stock-detail-page .detail-stock-danger,
.stock-detail-page .detail-stock-success {
  display: inline-flex;
  min-width: 42px;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 900;
}

.stock-detail-page .detail-stock-danger {
  color: #a62219;
  background: #ffe5df;
}

.stock-detail-page .detail-stock-success {
  color: #087348;
  background: #e8f8f1;
}

.stock-detail-page .stock-detail-error {
  max-width: 700px;
}

@media (max-width: 680px) {
  .stock-detail-page .stock-detail-summary {
    grid-template-columns: 1fr;
  }
}

/* =========================
   STOCK RESULT PAGINATION
   ========================= */

.stock-page .stock-pagination {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-top: 1px solid var(--stock-line);
  background: var(--stock-soft-bg);
}

.stock-page .stock-pagination[hidden] {
  display: none;
}

.stock-page .stock-pagination span {
  min-width: 230px;
  color: var(--stock-muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.stock-page .stock-pagination-btn {
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid var(--stock-line);
  border-radius: 11px;
  color: var(--stock-dark);
  background: white;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.stock-page .stock-pagination-btn:hover:not(:disabled) {
  border-color: var(--stock-red);
  color: var(--stock-red);
}

.stock-page .stock-pagination-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

@media (max-width: 680px) {
  .stock-page .stock-pagination {
    flex-wrap: wrap;
    gap: 10px;
  }

  .stock-page .stock-pagination span {
    width: 100%;
    order: -1;
  }

  .stock-page .stock-pagination-btn {
    flex: 1;
  }
}

/* =========================
   RUN PROGRESS BUTTON
   ========================= */

.stock-page .run-stock-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.stock-page .run-stock-progress {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: var(--run-progress, 0%);
  background:
    linear-gradient(
      90deg,
      #ef431f,
      #ff765f
    );
  transition: width 0.45s ease;
}

.stock-page .run-stock-content {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stock-page #runStockButtonPercent {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.85;
}

.stock-page .run-stock-btn.is-running {
  color: white;
}

.stock-page .run-stock-btn.is-complete {
  --run-progress: 100%;
}


/* =========================
   LARGE RUN MESSAGE
   ========================= */

.stock-page .stock-run-message {
  margin-top: 18px;
  padding: 20px 22px;
  border: 1px solid #edc5bb;
  border-radius: 18px;
  background: white;
  box-shadow: 0 16px 35px rgba(82, 24, 12, 0.07);
}

.stock-page .stock-run-message[hidden] {
  display: none;
}

.stock-page .stock-run-message strong {
  display: block;
  color: var(--stock-dark);
  font-size: 20px;
  line-height: 1.3;
}

.stock-page .stock-run-message p {
  margin: 7px 0 0;
  color: var(--stock-muted);
  font-size: 15px;
  line-height: 1.6;
}

.stock-page .stock-run-message.is-success {
  border-color: #b9dfcf;
  background: #f1fbf6;
}

.stock-page .stock-run-message.is-success strong {
  color: #087348;
}

.stock-page .stock-run-message.is-error {
  border-color: #efb4aa;
  background: #fff1ee;
}

.stock-page .stock-run-message.is-error strong {
  color: #ae291f;
}

.stock-page .stock-parent-link {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  color: inherit;
  text-decoration: none;
}

.stock-page .stock-parent-info {
  min-width: 0;
  flex: 1;
}

.stock-page .stock-parent-info strong,
.stock-page .stock-parent-info small {
  display: block;
}

.stock-page .view-parent-details {
  flex: 0 0 auto;
  margin-top: 0;
  margin-left: auto;
  white-space: nowrap;
  color: var(--stock-red);
  font-size: 11px;
  font-weight: 900;
}

.stock-page .stock-report-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stock-page .generated-sheet-result {
  margin: 18px 0 0;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #b9dfcf;
  border-radius: 16px;
  background: #f1fbf6;
}

.stock-page .generated-sheet-result[hidden] {
  display: none;
}

.stock-page .generated-sheet-result span,
.stock-page .generated-sheet-result strong {
  display: block;
}

.stock-page .generated-sheet-result span {
  color: #087348;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.stock-page .generated-sheet-result strong {
  margin-top: 4px;
}

.stock-page .generated-sheet-result a {
  flex: 0 0 auto;
  color: #087348;
  font-weight: 900;
  text-decoration: none;
}

.stock-page .generated-sheet-result a:hover {
  text-decoration: underline;
}

.stock-page .delivery-form {
  display: grid;
  gap: 10px;
}

.stock-page .delivery-form label {
  color: var(--stock-dark);
  font-size: 12px;
  font-weight: 900;
}

.stock-page .delivery-form input {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--stock-line);
  border-radius: 12px;
  background: white;
  font: inherit;
}

.stock-page .delivery-form small {
  color: var(--stock-muted);
  line-height: 1.45;
}

.stock-page .delivery-action-status {
  min-height: 20px;
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.stock-page .delivery-action-status.is-working {
  color: #92541c;
}

.stock-page .delivery-action-status.is-success {
  color: #087348;
}

.stock-page .delivery-action-status.is-error {
  color: #ae291f;
}


/* =========================================================
   SAFE STOCK GUARD ENTRANCE
   Runs only after Stock Guard is opened from the Home page.
   Does not affect Home, Neshome or navigation away from Stock.
   ========================================================= */

.stock-page.stock-page-entering .stock-hero {
  animation:
    stockPageHeroExpand 900ms
    cubic-bezier(0.22, 1, 0.36, 1)
    both;
}

.stock-page.stock-page-entering .stock-hero::before {
  animation:
    stockHeroColourFade 900ms
    cubic-bezier(0.22, 1, 0.36, 1)
    both;
}


@keyframes stockPageHeroExpand {
  from {
    transform: scaleY(0.82);
    transform-origin: top;
  }

  to {
    transform: scaleY(1);
    transform-origin: top;
  }
}

@keyframes stockHeroColourFade {
  0% {
    opacity: 0;
  }

  15% {
    opacity: 0.35;
  }

  40% {
    opacity: 0.75;
  }

  100% {
    opacity: 1;
  }
}


.stock-page.stock-page-entering .stock-eyebrow {
  animation:
    stockPageCopyEnter 500ms 90ms
    cubic-bezier(0.22, 1, 0.36, 1)
    both;
}

.stock-page.stock-page-entering .stock-hero h1 {
  animation:
    stockPageTitleEnter 600ms 120ms
    cubic-bezier(0.22, 1, 0.36, 1)
    both;
}

.stock-page.stock-page-entering .stock-hero-copy > p,
.stock-page.stock-page-entering .stock-hero-actions {
  animation:
    stockPageCopyEnter 560ms 160ms
    cubic-bezier(0.22, 1, 0.36, 1)
    both;
}

.stock-page.stock-page-entering .stock-health-card {
  animation:
    stockPageCardEnter 650ms 120ms
    cubic-bezier(0.22, 1, 0.36, 1)
    both;
}





@keyframes stockPageTitleEnter {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stockPageCopyEnter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stockPageCardEnter {
  from {
    opacity: 0;
    transform: translateX(38px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}



@media (prefers-reduced-motion: reduce) {
  .stock-page.stock-page-entering .stock-hero,
  .stock-page.stock-page-entering .stock-eyebrow,
  .stock-page.stock-page-entering .stock-hero h1,
  .stock-page.stock-page-entering .stock-hero-copy > p,
  .stock-page.stock-page-entering .stock-hero-actions,
  .stock-page.stock-page-entering .stock-health-card,
  .stock-page.stock-page-entering
  .stock-workspace
  > .stock-section-heading:first-child {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
  }
}

/* Keep the Stock Analysis card in front of the animated red hero */

.stock-page .stock-hero {
  position: relative;
  overflow: hidden;

  background:
    radial-gradient(
      circle at 84% 12%,
      rgba(88, 198, 255, 0.44),
      transparent 25rem
    ),
    linear-gradient(
      130deg,
      #06172f 0%,
      #0c3b70 48%,
      #176fc1 100%
    );
}


.stock-page .stock-hero::before {
  content: "";

  position: absolute;
  inset: 0;
  z-index: 0;

  opacity: 1;
  pointer-events: none;

  background:
    radial-gradient(
      circle at 88% 10%,
      rgba(255, 185, 170, 0.55),
      transparent 24rem
    ),
    linear-gradient(
      135deg,
      #170804 0%,
      #7b1e10 42%,
      #ee431d 72%,
      #fc9985 100%
    );
}


.stock-page .stock-workspace {
  position: relative;
  z-index: 20;
  isolation: isolate;
}

.stock-page
.stock-workspace
> .stock-section-heading:first-child {
  position: relative;
  z-index: 30;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

/* Keep the entrance animation behind the workspace */
/* Animated hero always remains behind the workspace */
.stock-page.stock-page-entering .stock-hero {
  z-index: 1;
  transform-origin: top center;
}
.stock-page.stock-page-entering .stock-workspace {
  z-index: 20;
}

/* =========================
   STOCK HEALTH STATUS
   ========================= */

.stock-page .stock-health-card.is-running
.system-status-dot {
  background: #ffd166;
  box-shadow:
    0 0 0 6px rgba(255, 209, 102, 0.2);
  animation: stock-health-pulse 1.2s ease-in-out infinite;
}

.stock-page .stock-health-card.is-connected
.system-status-dot,
.stock-page .stock-health-card.is-complete
.system-status-dot {
  background: #8ff0bd;
  box-shadow:
    0 0 0 6px rgba(143, 240, 189, 0.2);
}

.stock-page .stock-health-card.is-error
.system-status-dot {
  background: #ffb3aa;
  box-shadow:
    0 0 0 6px rgba(255, 179, 170, 0.2);
}

@keyframes stock-health-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.25);
    opacity: 0.65;
  }
}

/* =========================
   PARENT SKU COPY BUTTON
   ========================= */

.stock-page .stock-parent-link-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
}

.stock-page .stock-parent-main {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.stock-page .stock-parent-info {
  min-width: 0;
  display: grid;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.stock-page .stock-parent-sku-line {
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.stock-page .stock-parent-copy-btn {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  margin-top: -3px;
  padding: 0;
  border: 1px solid var(--stock-line);
  border-radius: 7px;
  color: var(--stock-red);
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.stock-page .stock-parent-copy-btn:hover {
  transform: translateY(-1px);
  border-color: var(--stock-red);
  background: var(--stock-cream);
}

.stock-page .stock-parent-copy-btn.is-copied {
  color: #087348;
  border-color: #9bd9bd;
  background: #e8f8f1;
}

.stock-page .view-parent-details {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* =========================
   CURRENT GOOGLE SHEET TAB
   ========================= */

.stock-page .stock-sheet-status-wrap {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.stock-page .stock-sheet-tab-name {
  display: block;
  color: var(--stock-muted);
  font-size: 12px;
  font-weight: 700;
}

/* Red toast message */
#toast {
  color: #fff !important;
  background: linear-gradient(
    135deg,
    #3d0905 0%,
    #6f1108 45%,
    #a51e10 100%
  ) !important;

  box-shadow: 0 12px 28px rgba(61, 9, 5, 0.4) !important;
}


/* Hide Status, Components and Problem components */
.stock-page .stock-detail-summary {
  display: none !important;
}

/* Remove the empty space left by the hidden summary */
.stock-page .stock-detail-hero {
  padding-bottom: 80px;
}

/* Prevent the Bill of Materials card from moving too high */
.stock-page .stock-detail-content {
  margin-top: -45px;
}



/* =========================================================
   STOCK RUN PANEL ICON
   Same 3D/reflection style as the home Stock Tracker icon
   ========================================================= */

/* White 3D stock icon for the red run panel */

.stock-run-panel .run-panel-icon.app-icon-stock {
  position: relative;
  overflow: hidden;
  isolation: isolate;

  flex: 0 0 auto;

  width: 46px;
  height: 46px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: #ee431d;

  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);

  background:
    radial-gradient(
      circle at 28% 18%,
      rgba(255, 255, 255, 1),
      transparent 34%
    ),
    linear-gradient(
      145deg,
      #ffffff 0%,
      #fff8f5 52%,
      #ffd8cf 100%
    );

  box-shadow:
    0 5px 0 #d8a69a,
    0 16px 30px rgba(60, 9, 3, 0.28),
    inset 0 2px 1px rgba(255, 255, 255, 0.95),
    inset 0 -5px 10px rgba(190, 66, 38, 0.14);

  transform:
    perspective(500px)
    rotateX(0deg)
    rotateY(0deg)
    translateY(0);

  transition:
    color 700ms ease,
    background 900ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 700ms ease,
    box-shadow 900ms ease,
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 700ms ease;
}


/* Reflection sweep */

.stock-run-panel .run-panel-icon.app-icon-stock::before {
  content: "";

  position: absolute;
  top: -45%;
  left: -70%;
  z-index: 1;

  width: 65%;
  height: 190%;

  pointer-events: none;

  background:
    linear-gradient(
      110deg,
      transparent 0%,
      rgba(255, 255, 255, 0.12) 30%,
      rgba(255, 255, 255, 0.95) 48%,
      rgba(238, 67, 29, 0.12) 64%,
      transparent 100%
    );

  transform: rotate(14deg);
  opacity: 0;
}

/* Top curved glass shine */

.stock-run-panel .run-panel-icon.app-icon-stock::after {
  content: "";

  position: absolute;
  top: 4px;
  left: 10%;
  right: 10%;
  z-index: 1;

  height: 34%;

  pointer-events: none;

  border-radius: 999px 999px 45% 45%;

  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.98),
      rgba(255, 255, 255, 0.4),
      transparent
    );

  opacity: 0.8;
}


/* SVG */

.stock-run-panel
.run-panel-icon.app-icon-stock
.stock-app-icon-svg {
  position: relative;
  z-index: 3;

  width: 29px;
  height: 29px;

  display: block;

  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;

  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.95))
    drop-shadow(0 3px 4px rgba(153, 37, 18, 0.24));

  transition:
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 420ms ease;
}


/* Hover: whole 3D icon */

.stock-run-panel:hover
.run-panel-icon.app-icon-stock {
  transform:
    perspective(500px)
    rotateX(4deg)
    rotateY(-4deg)
    translateY(-3px)
    scale(1.035);

  filter:
    saturate(1.05)
    brightness(1.02);

  box-shadow:
    3px 4px 0 #c88e81,
    0 16px 24px rgba(42, 6, 2, 0.28),
    inset 0 2px 2px rgba(255, 255, 255, 1),
    inset 0 -5px 10px rgba(190, 66, 38, 0.14);
}

/* Hover: reflection */

.stock-run-panel:hover
.run-panel-icon.app-icon-stock::before {
  animation:
    stockRunIconReflectionSweep
    850ms
    cubic-bezier(0.22, 1, 0.36, 1)
    both;
}


/* Hover: SVG lift */

.stock-run-panel:hover
.run-panel-icon.app-icon-stock
.stock-app-icon-svg {
  transform:
    translateY(-1px)
    scale(1.05);

  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 1))
    drop-shadow(0 5px 6px rgba(153, 37, 18, 0.32));
}

/* Hover: individual SVG parts */

.stock-run-panel:hover .stock-icon-box {
  animation:
    stockRunIconBoxPulse
    650ms
    cubic-bezier(0.22, 1, 0.36, 1)
    both;
}

.stock-run-panel:hover .stock-icon-lid {
  animation:
    stockRunIconLidLift
    650ms
    cubic-bezier(0.22, 1, 0.36, 1)
    both;
}

.stock-run-panel:hover .stock-icon-line-one {
  animation:
    stockRunIconLineMove
    500ms
    80ms
    ease
    both;
}

.stock-run-panel:hover .stock-icon-line-two {
  animation:
    stockRunIconLineMove
    500ms
    140ms
    ease
    both;
}

.stock-run-panel:hover .stock-icon-check {
  animation:
    stockRunIconCheckPop
    500ms
    190ms
    ease
    both;
}


/* Reflection animation */

@keyframes stockRunIconReflectionSweep {
  0% {
    left: -70%;
    opacity: 0;
  }

  15% {
    opacity: 1;
  }

  100% {
    left: 125%;
    opacity: 0;
  }
}


/* SVG animations */

@keyframes stockRunIconBoxPulse {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(0.94);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes stockRunIconLidLift {
  0% {
    transform: translateY(0);
  }

  45% {
    transform: translateY(-2px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes stockRunIconLineMove {
  from {
    opacity: 0.3;
    transform: translateX(-3px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes stockRunIconCheckPop {
  0% {
    opacity: 0;
    transform: scale(0.55);
    transform-origin: center;
  }

  70% {
    opacity: 1;
    transform: scale(1.18);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}













/* =========================================================
   STOCK RUN PANEL — GALAXY ANALYSIS MODE
   Activates while .run-stock-btn has .is-running
   No JavaScript changes required
   ========================================================= */

.stock-page .stock-run-panel {
  position: relative;
  overflow: hidden;
  isolation: isolate;

  transition:
    transform 500ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 500ms ease,
    background 500ms ease;
}


/* Moving galaxy glow */

.stock-page .stock-run-panel::before {
  content: "";

  position: absolute;
  inset: -80%;
  z-index: -2;

  pointer-events: none;

  background:
    radial-gradient(
      circle at 20% 35%,
      rgba(255, 255, 255, 0.95) 0 1px,
      transparent 2px
    ),
    radial-gradient(
      circle at 60% 25%,
      rgba(255, 190, 170, 0.9) 0 1.5px,
      transparent 2.5px
    ),
    radial-gradient(
      circle at 76% 70%,
      rgba(255, 255, 255, 0.82) 0 1px,
      transparent 2px
    ),
    radial-gradient(
      circle at 38% 78%,
      rgba(255, 136, 108, 0.9) 0 1px,
      transparent 2px
    ),
    radial-gradient(
      circle at 12% 68%,
      rgba(255, 255, 255, 0.8) 0 1px,
      transparent 2px
    ),
    radial-gradient(
      circle at 84% 18%,
      rgba(255, 204, 190, 0.82) 0 1.3px,
      transparent 2.3px
    ),
    radial-gradient(
      circle at 48% 52%,
      rgba(255, 255, 255, 0.72) 0 0.9px,
      transparent 1.9px
    ),
    radial-gradient(
      circle at 90% 82%,
      rgba(255, 138, 112, 0.72) 0 1px,
      transparent 2px
    );

  background-size:
    74px 74px,
    118px 118px,
    92px 92px,
    145px 145px,
    63px 63px,
    104px 104px,
    81px 81px,
    132px 132px;

  opacity: 0.32;

  transform:
    rotate(0deg)
    scale(0.95);

  animation:
    stockNormalStarsDrift 32s linear infinite,
    stockNormalStarsTwinkle 5s ease-in-out infinite;

  transition:
    opacity 350ms ease,
    transform 700ms ease;
}


@keyframes stockNormalStarsDrift {
  from {
    transform:
      rotate(0deg)
      scale(0.95);
  }

  to {
    transform:
      rotate(360deg)
      scale(1.02);
  }
}

@keyframes stockNormalStarsTwinkle {
  0%,
  100% {
    filter: brightness(0.82);
  }

  50% {
    filter: brightness(1.18);
  }
}


/* Aurora / nebula layer */

.stock-page .stock-run-panel::after {
  content: "";

  position: absolute;
  inset: -50%;
  z-index: -1;

  pointer-events: none;

  background:
    radial-gradient(
      ellipse at 24% 48%,
      rgba(255, 95, 60, 0.72),
      transparent 31%
    ),
    radial-gradient(
      ellipse at 70% 35%,
      rgba(255, 187, 157, 0.44),
      transparent 34%
    ),
    radial-gradient(
      ellipse at 52% 76%,
      rgba(133, 28, 14, 0.82),
      transparent 37%
    );

  opacity: 0;
  filter: blur(22px);

  transform:
    translate3d(-5%, 3%, 0)
    rotate(-8deg)
    scale(0.85);

  transition:
    opacity 400ms ease,
    transform 700ms ease;
}


/* Running state — entire panel */

.stock-page
.stock-run-panel:has(.run-stock-btn.is-running) {
  transform:
    translateY(-3px)
    scale(1.006);

  background:
    linear-gradient(
      120deg,
      #160502 0%,
      #431009 26%,
      #8f2414 53%,
      #ee431d 75%,
      #8e1e10 100%
    );

  background-size: 240% 240%;

  box-shadow:
    0 22px 55px rgba(71, 11, 4, 0.32),
    0 0 0 1px rgba(255, 158, 135, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);

  animation:
    stockGalaxyPanelShift 4.5s ease-in-out infinite;
}


.stock-page
.stock-run-panel:has(.run-stock-btn.is-running)::before {
  opacity: 0.78;

  animation:
    stockGalaxyStarsRotate 18s linear infinite,
    stockGalaxyStarsPulse 1.8s ease-in-out infinite;
}


.stock-page
.stock-run-panel:has(.run-stock-btn.is-running)::after {
  opacity: 0.94;

  animation:
    stockGalaxyNebulaMove 5s
    cubic-bezier(0.45, 0, 0.55, 1)
    infinite alternate;
}


/* Keep actual content above the effects */

.stock-page .stock-run-copy,
.stock-page .run-stock-btn {
  position: relative;
  z-index: 3;
}


/* Icon becomes an energy core */

.stock-page
.stock-run-panel:has(.run-stock-btn.is-running)
.run-panel-icon.app-icon-stock {
  color: #ffffff;

  background:
    radial-gradient(
      circle at 45% 42%,
      #ff6e4e 0%,
      #ee431d 36%,
      #8f2414 72%,
      #420b05 100%
    );

  border-color: rgba(255, 255, 255, 0.65);

  box-shadow:
    0 0 0 5px rgba(255, 113, 80, 0.14),
    0 0 24px rgba(255, 107, 75, 0.82),
    0 0 48px rgba(238, 67, 29, 0.42),
    inset 0 2px 2px rgba(255, 255, 255, 0.48),
    inset 0 -6px 12px rgba(67, 9, 3, 0.44);

  transition:
    color 700ms ease,
    background 900ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 700ms ease,
    box-shadow 900ms ease,
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 700ms ease;

  animation:
    stockGalaxyIconFloat 1.5s ease-in-out infinite,
    stockGalaxyIconGlow 1.2s ease-in-out infinite alternate;

}





/* SVG animation during analysis */

.stock-page
.stock-run-panel:has(.run-stock-btn.is-running)
.stock-app-icon-svg {
  filter:
    drop-shadow(0 0 4px rgba(255, 255, 255, 0.85))
    drop-shadow(0 0 10px rgba(255, 185, 164, 0.7));

  animation:
    stockGalaxySvgBreathe 1.3s ease-in-out infinite;
}


.stock-page
.stock-run-panel:has(.run-stock-btn.is-running)
.stock-icon-lid {
  animation:
    stockGalaxyLidScan 1.1s ease-in-out infinite;
}


.stock-page
.stock-run-panel:has(.run-stock-btn.is-running)
.stock-icon-line-one {
  animation:
    stockGalaxyDataLine 900ms ease-in-out infinite alternate;
}


.stock-page
.stock-run-panel:has(.run-stock-btn.is-running)
.stock-icon-line-two {
  animation:
    stockGalaxyDataLine 900ms 180ms ease-in-out infinite alternate;
}


.stock-page
.stock-run-panel:has(.run-stock-btn.is-running)
.stock-icon-check {
  animation:
    stockGalaxyCheckPulse 1s ease-in-out infinite;
}


/* Running title glow */

.stock-page
.stock-run-panel:has(.run-stock-btn.is-running)
.stock-run-copy h3 {
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.24),
    0 0 18px rgba(255, 122, 91, 0.34);

  animation:
    stockGalaxyTextPulse 1.7s ease-in-out infinite;
}


/* Running button gets energized */

.stock-page
.stock-run-panel:has(.run-stock-btn.is-running)
.run-stock-btn {
  border: 1px solid rgba(255, 255, 255, 0.4);

  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.08),
    0 12px 30px rgba(50, 6, 2, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);

  animation:
    stockGalaxyButtonPulse 1.5s ease-in-out infinite;
}


/* =========================================================
   GALAXY KEYFRAMES
   ========================================================= */

@keyframes stockGalaxyPanelShift {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}


@keyframes stockGalaxyStarsRotate {
  from {
    transform: rotate(0deg) scale(0.95);
  }

  to {
    transform: rotate(360deg) scale(1.05);
  }
}


@keyframes stockGalaxyStarsPulse {
  0%,
  100% {
    filter: brightness(0.85);
  }

  50% {
    filter: brightness(1.55);
  }
}


@keyframes stockGalaxyNebulaMove {
  0% {
    transform:
      translate3d(-5%, 3%, 0)
      rotate(-8deg)
      scale(0.9);
  }

  100% {
    transform:
      translate3d(8%, -5%, 0)
      rotate(11deg)
      scale(1.08);
  }
}


@keyframes stockGalaxyIconFloat {
  0%,
  100% {
    transform:
      perspective(500px)
      translateY(0)
      rotateX(0deg)
      rotateY(0deg);
  }

  50% {
    transform:
      perspective(500px)
      translateY(-4px)
      rotateX(5deg)
      rotateY(-5deg);
  }
}


@keyframes stockGalaxyIconGlow {
  from {
    filter:
      brightness(1)
      saturate(1);
  }

  to {
    filter:
      brightness(1.18)
      saturate(1.3);
  }
}


@keyframes stockGalaxyOrbit {
  from {
    transform:
      translate(-50%, -50%)
      rotate(-18deg);
  }

  to {
    transform:
      translate(-50%, -50%)
      rotate(342deg);
  }
}


@keyframes stockGalaxySparkOrbit {
  from {
    transform:
      translate(-50%, -50%)
      rotate(0deg)
      translateX(31px);
  }

  to {
    transform:
      translate(-50%, -50%)
      rotate(360deg)
      translateX(31px);
  }
}


@keyframes stockGalaxySvgBreathe {
  0%,
  100% {
    transform: scale(0.96);
  }

  50% {
    transform: scale(1.07);
  }
}


@keyframes stockGalaxyLidScan {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2.5px);
  }
}


@keyframes stockGalaxyDataLine {
  from {
    opacity: 0.35;
    transform: translateX(-3px);
  }

  to {
    opacity: 1;
    transform: translateX(2px);
  }
}


@keyframes stockGalaxyCheckPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.88);
    transform-origin: center;
  }

  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}


@keyframes stockGalaxyTextPulse {
  0%,
  100% {
    opacity: 0.9;
  }

  50% {
    opacity: 1;
  }
}


@keyframes stockGalaxyButtonPulse {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .stock-page
  .stock-run-panel:has(.run-stock-btn.is-running),
  .stock-page
  .stock-run-panel:has(.run-stock-btn.is-running)::before,
  .stock-page
  .stock-run-panel:has(.run-stock-btn.is-running)::after,
  .stock-page
  .stock-run-panel:has(.run-stock-btn.is-running)
  .run-panel-icon.app-icon-stock,
  .stock-page
  .stock-run-panel:has(.run-stock-btn.is-running)
  .stock-app-icon-svg,
  .stock-page
  .stock-run-panel:has(.run-stock-btn.is-running)
  .run-stock-btn {
    animation: none !important;
  }
}


/* =========================================================
   STOCK HERO SHOOTING STARS
   ========================================================= */

.stock-page .stock-hero {
  position: relative;
  overflow: hidden;
}

.stock-page .stock-hero-stars {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.stock-page .stock-hero-inner {
  position: relative;
  z-index: 3;
}


/* Optional soft stationary stars */

.stock-page .stock-hero-stars::before,
.stock-page .stock-hero-stars::after {
  content: "";

  position: absolute;
  inset: -20%;

  pointer-events: none;

  background:
    radial-gradient(
      circle at 12% 18%,
      rgba(255, 255, 255, 0.68) 0 1px,
      transparent 2px
    ),
    radial-gradient(
      circle at 32% 64%,
      rgba(255, 211, 197, 0.58) 0 1px,
      transparent 2px
    ),
    radial-gradient(
      circle at 58% 20%,
      rgba(255, 255, 255, 0.62) 0 1px,
      transparent 2px
    ),
    radial-gradient(
      circle at 76% 72%,
      rgba(255, 190, 168, 0.5) 0 1.2px,
      transparent 2.2px
    ),
    radial-gradient(
      circle at 90% 32%,
      rgba(255, 255, 255, 0.7) 0 1px,
      transparent 2px
    );

  background-size:
    130px 130px,
    170px 170px,
    150px 150px,
    210px 210px,
    185px 185px;

  opacity: 0.22;

  animation:
    stockHeroStarDrift 36s linear infinite;
}

.stock-page .stock-hero-stars::after {
  opacity: 0.12;

  animation-duration: 52s;
  animation-direction: reverse;
}


@keyframes stockHeroStarDrift {
  from {
    transform:
      translate3d(-1%, 0, 0)
      rotate(0deg);
  }

  to {
    transform:
      translate3d(2%, -2%, 0)
      rotate(360deg);
  }
}


@media (prefers-reduced-motion: reduce) {
  .stock-page .shooting-star,
  .stock-page .stock-hero-stars::before,
  .stock-page .stock-hero-stars::after {
    animation: none !important;
  }

  .stock-page .shooting-star {
    display: none;
  }
}



















/* =========================================================
   RESTOCK ANALYSIS CARD
   ========================================================= */

.stock-page .delivery-grid {
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
}

.stock-page .restock-analysis-card {
  min-width: 0;
}

.stock-page .restock-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stock-page .restock-card-icon {
  flex: 0 0 auto;
}


/* Switch */

.stock-page .restock-view-switch {
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 3px;

  border: 1px solid var(--stock-line);
  border-radius: 12px;

  background: var(--stock-soft-bg);
}

.stock-page .restock-switch-btn {
  min-height: 31px;
  padding: 6px 10px;

  border: 0;
  border-radius: 9px;

  color: var(--stock-muted);
  background: transparent;

  font: inherit;
  font-size: 10px;
  font-weight: 900;

  cursor: pointer;

  transition:
    color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.stock-page .restock-switch-btn:hover {
  color: var(--stock-red);
}

.stock-page .restock-switch-btn.is-active {
  color: #ffffff;

  background:
    linear-gradient(
      135deg,
      var(--stock-red),
      var(--stock-coral)
    );

  box-shadow:
    0 6px 14px rgba(238, 67, 29, 0.22);
}







/* =========================================================
   RESTOCK STATUS SWITCH
========================================================= */

.stock-page .restock-view-switch {
  width: 100%;
  padding: 6px;

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;

  border: 1px solid var(--stock-line);
  border-radius: 16px;

  background: var(--stock-soft-bg);
}

.stock-page .restock-switch-btn {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 16px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 12px;

  color: var(--stock-muted);
  background: transparent;

  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;

  cursor: pointer;
  appearance: none;

  transition:
    color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.stock-page .restock-switch-btn:hover:not(.is-active) {
  color: var(--stock-dark);
  background: rgba(255, 255, 255, 0.7);
}

.stock-page .restock-switch-btn.is-active {
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      var(--stock-red),
      #ff8878
    );

  box-shadow:
    0 8px 18px
    rgba(244, 76, 48, 0.22);
}

.stock-page .restock-switch-btn:active {
  transform: scale(0.98);
}

.stock-page .restock-switch-btn:focus-visible {
  outline: 3px solid
    rgba(244, 76, 48, 0.2);
  outline-offset: 2px;
}





/* Main analysis area */

.stock-page .restock-analysis-content {
  min-height: 150px;
  margin-top: auto;
}

.stock-page .restock-priority-box {
  padding: 16px;

  border: 1px solid var(--stock-line);
  border-radius: 16px;

  background:
    linear-gradient(
      145deg,
      #fffdfc,
      var(--stock-soft-bg)
    );
}

.stock-page .restock-priority-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stock-page .restock-priority-sku {
  min-width: 0;
}

.stock-page .restock-priority-sku span,
.stock-page .restock-priority-sku strong {
  display: block;
}

.stock-page .restock-priority-sku span {
  color: var(--stock-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.stock-page .restock-priority-sku strong {
  margin-top: 5px;

  color: var(--stock-dark);
  font-size: 17px;
  line-height: 1.25;

  overflow-wrap: anywhere;
}

.stock-page .restock-rank-badge {
  flex: 0 0 auto;

  padding: 7px 9px;

  border-radius: 999px;

  color: var(--stock-red);
  background: var(--stock-cream);

  font-size: 10px;
  font-weight: 900;
}

.stock-page .restock-metrics {
  margin-top: 15px;

  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.stock-page .restock-metric {
  padding: 11px;

  border: 1px solid var(--stock-line);
  border-radius: 12px;

  background: #ffffff;
}

.stock-page .restock-metric span,
.stock-page .restock-metric strong {
  display: block;
}

.stock-page .restock-metric span {
  color: var(--stock-muted);
  font-size: 10px;
  font-weight: 800;
}

.stock-page .restock-metric strong {
  margin-top: 5px;

  color: var(--stock-red);
  font-size: 22px;
  line-height: 1;
}

.stock-page .restock-priority-title {
  margin-top: 13px;

  color: var(--stock-muted);
  font-size: 11px;
  line-height: 1.45;
}


/* Small ranked rows */

.stock-page .restock-ranking-list {
  margin-top: 10px;
  display: grid;
  gap: 7px;
}

.stock-page .restock-ranking-row {
  padding: 9px 10px;

  display: grid;
  grid-template-columns:
    24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;

  border: 1px solid var(--stock-line);
  border-radius: 11px;

  background: #ffffff;
}

.stock-page .restock-ranking-number {
  width: 24px;
  height: 24px;

  display: grid;
  place-items: center;

  border-radius: 8px;

  color: var(--stock-red);
  background: var(--stock-cream);

  font-size: 10px;
  font-weight: 900;
}

.stock-page .restock-ranking-info {
  min-width: 0;
}

.stock-page .restock-ranking-info strong,
.stock-page .restock-ranking-info span {
  display: block;
}

.stock-page .restock-ranking-info strong {
  color: var(--stock-dark);
  font-size: 11px;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-page .restock-ranking-info span {
  margin-top: 2px;
  color: var(--stock-muted);
  font-size: 9px;
}

.stock-page .restock-ranking-count {
  color: var(--stock-red);
  font-size: 11px;
  font-weight: 900;
}


/* Empty state */

.stock-page .restock-empty-state {
  min-height: 145px;

  display: grid;
  place-items: center;
  align-content: center;

  padding: 18px;

  border: 1px dashed var(--stock-line);
  border-radius: 16px;

  color: var(--stock-muted);
  background: var(--stock-soft-bg);

  text-align: center;
}

.stock-page .restock-empty-state strong,
.stock-page .restock-empty-state span {
  display: block;
}

.stock-page .restock-empty-state strong {
  color: var(--stock-dark);
  font-size: 14px;
}

.stock-page .restock-empty-state span {
  max-width: 250px;
  margin-top: 6px;

  font-size: 11px;
  line-height: 1.45;
}


@media (max-width: 1100px) {
  .stock-page .delivery-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .stock-page .restock-analysis-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .stock-page .delivery-grid {
    grid-template-columns: 1fr;
  }

  .stock-page .restock-analysis-card {
    grid-column: auto;
  }

  .stock-page .restock-card-top {
    align-items: flex-start;
    flex-direction: column;
  }



}

/* =========================================================
   RESTOCK ANALYSIS CARD — FINAL DESIGN
========================================================= */

.stock-page .restock-analysis-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;

  background: #ffffff;
  border-color: var(--stock-line);

  transition:
    border-color 650ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 650ms cubic-bezier(0.22, 1, 0.36, 1);
}


/*
 * Red layer used for Low Stock mode.
 * Opacity creates a smooth colour fade instead
 * of changing the background instantly.
 */
.stock-page .restock-analysis-card::before {
  content: "";

  position: absolute;
  inset: 0;
  z-index: 0;

  border-radius: inherit;

  background:
    linear-gradient(
      145deg,
      var(--stock-red),
      #d93620
    );

  opacity: 0;
  pointer-events: none;

  transition:
    opacity 650ms cubic-bezier(0.22, 1, 0.36, 1);
}


.stock-page .restock-analysis-card.is-low-stock-mode::before {
  opacity: 1;
}


.stock-page .restock-analysis-card.is-low-stock-mode {
  border-color: transparent;

  box-shadow:
    0 24px 55px
    rgba(213, 54, 32, 0.28);
  

}


/*
 * Keep all real card content above the red layer.
 */
.stock-page .restock-analysis-card > * {
  position: relative;
  z-index: 1;
}


/* =========================================================
   ICON + SMALL SWITCH HEADER
========================================================= */

.stock-page .restock-card-header {
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  margin-bottom: 24px;
}


.stock-page .restock-card-icon {
  flex: 0 0 auto;
  margin: 0;

  transition:
    color 500ms ease,
    background 500ms ease,
    box-shadow 500ms ease;
}


/*
 * Compact switch placed on the right.
 */
.stock-page .restock-view-switch {
  width: 250px;
  max-width: calc(100% - 85px);
  padding: 4px;

  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 4px;

  border: 1px solid var(--stock-line);
  border-radius: 14px;

  background: var(--stock-soft-bg);

  transition:
    background 500ms ease,
    border-color 500ms ease,
    box-shadow 500ms ease;
}


.stock-page .restock-switch-btn {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 7px 11px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 10px;

  color: var(--stock-muted);
  background: transparent;

  font: inherit;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;

  cursor: pointer;
  appearance: none;

  transition:
    color 450ms ease,
    background 450ms ease,
    box-shadow 450ms ease,
    transform 180ms ease;
}


.stock-page
.restock-switch-btn:hover:not(.is-active) {
  color: var(--stock-dark);
  background: rgba(255, 255, 255, 0.75);
}


.stock-page .restock-switch-btn.is-active {
  color: #ffffff;

  background:
    linear-gradient(
      135deg,
      var(--stock-red),
      #ff8878
    );

  box-shadow:
    0 7px 16px
    rgba(244, 76, 48, 0.24);
}


.stock-page .restock-switch-btn:active {
  transform: scale(0.97);
}


.stock-page .restock-switch-btn:focus-visible {
  outline: 3px solid
    rgba(244, 76, 48, 0.22);

  outline-offset: 2px;
}


/* =========================================================
   GENERAL COLOUR TRANSITIONS
========================================================= */

.stock-page .restock-analysis-card h3,
.stock-page .restock-analysis-card p,
.stock-page .restock-analysis-card strong,
.stock-page .restock-analysis-card span,
.stock-page .restock-priority-box,
.stock-page .restock-metric,
.stock-page .restock-ranking-row,
.stock-page .restock-ranking-number,
.stock-page .restock-rank-badge,
.stock-page .restock-empty-state {
  transition:
    color 500ms ease,
    background 500ms ease,
    border-color 500ms ease,
    box-shadow 500ms ease;
}


/* =========================================================
   LOW STOCK RED MODE
========================================================= */

/* Icon */

.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-card-icon {
  color: var(--stock-red);

  background: #ffffff;

  box-shadow:
    0 12px 25px
    rgba(120, 20, 10, 0.2);
}


/* Main heading */

.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-heading-copy h3 {
  color: #ffffff;
}


/* Main description */

.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-heading-copy p {
  color: rgba(255, 255, 255, 0.82);
}


/* Switch container */

.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-view-switch {
  border-color: rgba(255, 255, 255, 0.3);

  background: rgba(120, 20, 10, 0.22);

  box-shadow:
    inset 0 1px 0
    rgba(255, 255, 255, 0.12);
}


/* Inactive switch button */

.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-switch-btn {
  color: rgba(255, 255, 255, 0.78);
}


/* Low Stock active button becomes white */

.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-switch-btn.is-active {
  color: var(--stock-red);
  background: #ffffff;

  box-shadow:
    0 8px 18px
    rgba(90, 10, 5, 0.2);
}


.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-switch-btn:hover:not(.is-active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}


/* Main priority container */

.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-priority-box {
  border-color: rgba(255, 255, 255, 0.3);

  background:
    rgba(255, 255, 255, 0.1);

  box-shadow:
    inset 0 1px 0
    rgba(255, 255, 255, 0.12);
}


/* Priority SKU labels */

.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-priority-sku span {
  color: rgba(255, 255, 255, 0.7);
}


.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-priority-sku strong {
  color: #ffffff;
}


/* Priority badge */

.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-rank-badge {
  color: var(--stock-red);
  background: #ffffff;
}


/* Metrics */

.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-metric {
  border-color: rgba(255, 255, 255, 0.25);

  background:
    rgba(255, 255, 255, 0.1);
}


.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-metric span {
  color: rgba(255, 255, 255, 0.72);
}


.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-metric strong {
  color: #ffffff;
}


/* Product/component description */

.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-priority-title {
  color: rgba(255, 255, 255, 0.82);
}


/* Ranking rows */

.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-ranking-row {
  border-color: rgba(255, 255, 255, 0.25);

  background:
    rgba(255, 255, 255, 0.1);
}


.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-ranking-number {
  color: var(--stock-red);
  background: #ffffff;
}


.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-ranking-info strong {
  color: #ffffff;
}


.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-ranking-info span {
  color: rgba(255, 255, 255, 0.72);
}


.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-ranking-count {
  color: #ffffff;
}


/* Empty analysis state */

.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-empty-state {
  border-color: rgba(255, 255, 255, 0.35);

  background:
    rgba(255, 255, 255, 0.1);
}


.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-empty-state strong {
  color: #ffffff;
}


.stock-page
.restock-analysis-card.is-low-stock-mode
.restock-empty-state span {
  color: rgba(255, 255, 255, 0.78);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 680px) {
  .stock-page .restock-card-header {
    gap: 12px;
  }

  .stock-page .restock-view-switch {
    width: min(230px, calc(100% - 75px));
    max-width: none;
  }

  .stock-page .restock-switch-btn {
    height: 38px;
    padding-inline: 7px;
    font-size: 10px;
  }
}




.stock-page .restock-card-icon-svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================================================
   ALIGN EMAIL AND SCHEDULE ACTION BUTTONS
========================================================= */

.stock-page .report-action-card {
  height: 100%;
}

/*
 * Keep both introductory text areas the same height.
 */
.stock-page
.report-action-card
.delivery-card-copy {
  min-height: 112px;
}

/*
 * Form fills the card, but content stays positioned
 * from the top rather than being pushed by card height.
 */
.stock-page
.report-action-card
.delivery-form {
  flex: 1;

  display: flex;
  flex-direction: column;

  margin: 0;
}

/*
 * Both cards reserve the same amount of space for
 * labels, inputs and helper text.
 */
.stock-page
.report-action-card
.delivery-fields {
  min-height: 190px;

  display: flex;
  flex-direction: column;
  gap: 12px;
}

/*
 * Main buttons begin at the same vertical position.
 * Status messages expand below the buttons.
 */
.stock-page
.report-action-card
.delivery-action-zone {
  display: flex;
  flex-direction: column;
  gap: 10px;

  margin-top: 0;
}

/*
 * Override the old margin-top:auto rule.
 * That rule caused the changing alignment.
 */
.stock-page
.report-action-card
.delivery-action-zone
.full-width-btn {
  width: 100%;
  margin-top: 0;
}

/*
 * Messages may become multiple lines without
 * pushing the main button upward or downward.
 */
.stock-page
.report-action-card
.delivery-action-status {
  min-height: 24px;
  margin: 0;

  overflow-wrap: anywhere;
}

/*
 * Keep the disable button area stable when hidden.
 */
.stock-page
.report-action-card
#disableStockScheduleBtn:not([hidden]) {
  min-height: 30px;
}

/*
 * Cards are stacked on smaller screens, so equal
 * desktop spacing is no longer necessary.
 */
@media (max-width: 960px) {
  .stock-page
  .report-action-card
  .delivery-card-copy,
  .stock-page
  .report-action-card
  .delivery-fields {
    min-height: 0;
  }
}


/* =========================================================
   IMPROVED STOCK PAGINATION
========================================================= */

.stock-page .stock-pagination {
  padding: 18px 20px;

  display: grid;
  grid-template-columns:
    auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;

  border-top: 1px solid var(--stock-line);
  background: var(--stock-soft-bg);
}

.stock-page .stock-pagination[hidden] {
  display: none;
}

.stock-page .stock-pagination-size {
  display: flex;
  align-items: center;
  gap: 9px;
}

.stock-page .stock-pagination-size label,
.stock-page .stock-page-jump label {
  color: var(--stock-muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.stock-page .stock-pagination-size select {
  min-height: 40px;
  padding: 7px 34px 7px 12px;

  border: 1px solid var(--stock-line);
  border-radius: 11px;

  color: var(--stock-dark);
  background: #ffffff;

  font: inherit;
  font-size: 12px;
  font-weight: 800;

  cursor: pointer;
}

.stock-page .stock-pagination-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.stock-page .stock-page-jump {
  min-height: 40px;
  padding: 5px 10px;

  display: flex;
  align-items: center;
  gap: 7px;

  border: 1px solid var(--stock-line);
  border-radius: 11px;

  background: #ffffff;
}

.stock-page .stock-page-jump input {
  width: 58px;
  height: 29px;
  padding: 4px 6px;

  border: 1px solid var(--stock-line);
  border-radius: 8px;

  color: var(--stock-dark);
  background: var(--stock-soft-bg);

  font: inherit;
  font-size: 12px;
  font-weight: 900;
  text-align: center;

  outline: none;
}

.stock-page .stock-page-jump input:focus {
  border-color: var(--stock-red);

  box-shadow:
    0 0 0 3px
    rgba(238, 67, 29, 0.1);
}

.stock-page .stock-page-jump span {
  min-width: 0;

  color: var(--stock-muted);
  font-size: 11px;
  white-space: nowrap;
}

.stock-page .stock-page-jump strong {
  color: var(--stock-dark);
}

.stock-page .stock-pagination-info {
  min-width: 190px;

  color: var(--stock-muted);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 1050px) {
  .stock-page .stock-pagination {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .stock-page .stock-pagination-info {
    text-align: center;
  }
}

@media (max-width: 680px) {
  .stock-page .stock-pagination-navigation {
    width: 100%;
    flex-wrap: wrap;
  }

  .stock-page .stock-pagination-navigation
  .stock-pagination-btn {
    flex: 1 1 calc(50% - 8px);
  }

  .stock-page .stock-page-jump {
    width: 100%;
    justify-content: center;
    order: -1;
  }
}

.stock-page .restock-analysis-card.is-low-stock-mode .restock-empty-state {
  height: 315px;
}

.stock-page .restock-empty-state {
  height: 315px;
}


/* =========================================================
   STEP 03 — STOCK THRESHOLDS
   ========================================================= */

.stock-page .stock-threshold-panel {
  grid-column: 1 / -1;
}


/* ---------------------------------------------------------
   TWO THRESHOLD SETTINGS
   --------------------------------------------------------- */

.stock-page .stock-threshold-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}


.stock-page .stock-threshold-field {
  position: relative;

  padding: 18px;

  display: flex;
  flex-direction: column;
  gap: 8px;

  border: 1px solid var(--stock-line);
  border-radius: 16px;

  background:
    linear-gradient(
      145deg,
      #fffdfc,
      var(--stock-soft-bg)
    );

  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}


.stock-page .stock-threshold-field:hover {
  transform: translateY(-2px);
  border-color: var(--stock-coral);

  box-shadow:
    0 10px 25px rgba(72, 25, 15, 0.06);
}


.stock-page .stock-threshold-field:focus-within {
  border-color: var(--stock-red);

  box-shadow:
    0 0 0 4px rgba(238, 67, 29, 0.09),
    0 12px 28px rgba(72, 25, 15, 0.08);
}


/* ---------------------------------------------------------
   LABELS
   --------------------------------------------------------- */

.stock-page .stock-threshold-field label {
  color: var(--stock-dark);

  font-size: 13px;
  font-weight: 900;
}


.stock-page .stock-threshold-field small {
  display: block;

  color: var(--stock-muted);

  font-size: 11px;
  line-height: 1.5;
}


/* ---------------------------------------------------------
   NUMBER INPUT
   --------------------------------------------------------- */

.stock-page .stock-threshold-field input[type="number"] {
  width: 100%;
  min-height: 54px;

  padding: 10px 14px;

  border: 1px solid var(--stock-line);
  border-radius: 13px;

  outline: none;

  color: var(--stock-dark);
  background: white;

  font: inherit;
  font-size: 22px;
  font-weight: 900;

  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}


.stock-page
.stock-threshold-field
input[type="number"]:focus {
  border-color: var(--stock-red);

  background: #fffdfc;

  box-shadow:
    0 0 0 4px rgba(238, 67, 29, 0.1);
}


/* Remove ugly browser number arrows */

.stock-page
.stock-threshold-field
input[type="number"]::-webkit-inner-spin-button,
.stock-page
.stock-threshold-field
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}


/* ---------------------------------------------------------
   INCLUDE BOUNDARY OPTION
   --------------------------------------------------------- */

.stock-page .stock-threshold-toggle {
  min-height: 60px;

  margin-top: 14px;
  padding: 13px 15px;

  display: flex;
  align-items: center;
  gap: 12px;

  border: 1px solid var(--stock-line);
  border-radius: 16px;

  background: var(--stock-soft-bg);

  color: var(--stock-dark);

  cursor: pointer;

  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}


.stock-page .stock-threshold-toggle:hover {
  transform: translateX(3px);

  border-color: var(--stock-coral);
}


.stock-page
.stock-threshold-toggle:has(input:checked) {
  border-color: var(--stock-red);
  background: var(--stock-cream);
}


.stock-page .stock-threshold-toggle span {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}


/* CUSTOM CHECKBOX */

.stock-page
.stock-threshold-toggle
input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;

  margin: 0;

  display: grid;
  place-items: center;

  appearance: none;

  border: 2px solid #d7aaa0;
  border-radius: 7px;

  background: white;

  cursor: pointer;

  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}


.stock-page
.stock-threshold-toggle
input[type="checkbox"]:checked {
  border-color: var(--stock-red);
  background: var(--stock-red);
}


.stock-page
.stock-threshold-toggle
input[type="checkbox"]:checked::after {
  content: "✓";

  color: white;

  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}


/* ---------------------------------------------------------
   LIVE RULE PREVIEW
   --------------------------------------------------------- */

.stock-page .stock-threshold-preview {
  position: relative;
  overflow: hidden;

  margin-top: 14px;
  padding: 16px 18px;

  border: 1px solid #efc1b7;
  border-radius: 16px;

  color: #71301f;

  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(252, 153, 133, 0.25),
      transparent 13rem
    ),
    linear-gradient(
      135deg,
      #fff8f5,
      var(--stock-cream)
    );

  font-size: 13px;
  font-weight: 900;
  line-height: 1.5;

  box-shadow:
    inset 4px 0 0 var(--stock-red);
}


/* ---------------------------------------------------------
   MOBILE
   --------------------------------------------------------- */

@media (max-width: 680px) {

  .stock-page .stock-threshold-panel {
    grid-column: auto;
  }

  .stock-page .stock-threshold-settings {
    grid-template-columns: 1fr;
  }

  .stock-page .stock-threshold-field {
    padding: 15px;
  }

  .stock-page
  .stock-threshold-field
  input[type="number"] {
    min-height: 50px;
    font-size: 19px;
  }

}


/* =========================================================
   MULTI STATUS FILTER
   ========================================================= */

.stock-page .stock-status-multiselect {
  position: relative;
  min-width: 180px;
}


.stock-page .stock-status-filter-button {
  width: 100%;
  min-height: 43px;

  padding: 0 13px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  border: 1px solid var(--stock-line);
  border-radius: 13px;

  color: var(--stock-text);
  background: white;

  font: inherit;
  font-size: 13px;

  cursor: pointer;

  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}


.stock-page
.stock-status-multiselect.is-open
.stock-status-filter-button {
  border-color: var(--stock-red);

  box-shadow:
    0 0 0 3px rgba(238, 67, 29, 0.09);
}


.stock-page .stock-status-filter-arrow {
  flex: 0 0 auto;

  color: var(--stock-muted);

  transition:
    transform 0.18s ease;
}


.stock-page
.stock-status-multiselect.is-open
.stock-status-filter-arrow {
  transform: rotate(180deg);
}


/* DROPDOWN */

.stock-page .stock-status-filter-menu {
  position: absolute;

  top: calc(100% + 7px);
  right: 0;

  z-index: 100;

  width: 220px;

  padding: 7px;

  border: 1px solid var(--stock-line);
  border-radius: 14px;

  background: white;

  box-shadow:
    0 18px 40px rgba(72, 25, 15, 0.16);
}


.stock-page
.stock-status-filter-menu[hidden] {
  display: none;
}


/* OPTION */

.stock-page .stock-status-filter-option {
  min-height: 42px;

  padding: 8px 9px;

  display: grid;
  grid-template-columns:
    20px
    minmax(0, 1fr);

  align-items: center;
  gap: 10px;

  border-radius: 10px;

  color: var(--stock-dark);

  font-size: 13px;
  font-weight: 700;

  cursor: pointer;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}


.stock-page
.stock-status-filter-option:hover {
  background: var(--stock-soft-bg);
}


.stock-page
.stock-status-filter-option:has(input:checked) {
  color: var(--stock-red);
  background: var(--stock-cream);
}


/* HIDE REAL CHECKBOX */

.stock-page
.stock-status-filter-option
input {
  position: absolute;

  opacity: 0;
  pointer-events: none;
}


/* CUSTOM CHECKBOX */

.stock-page .stock-status-filter-check {
  width: 20px;
  height: 20px;

  display: grid;
  place-items: center;

  border: 2px solid #d7aaa0;
  border-radius: 6px;

  background: white;
}


.stock-page
.stock-status-filter-option
input:checked
+
.stock-status-filter-check {
  border-color: var(--stock-red);
  background: var(--stock-red);
}


.stock-page
.stock-status-filter-option
input:checked
+
.stock-status-filter-check::after {
  content: "✓";

  color: white;

  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}


/* ALL STATUSES SEPARATOR */

.stock-page .stock-status-filter-divider {
  height: 1px;

  margin: 5px 4px;

  background: var(--stock-line);
}


.stock-page
.stock-status-filter-option-all {
  font-weight: 900;
}


/* MOBILE */

@media (max-width: 680px) {

  .stock-page .stock-status-multiselect {
    width: 100%;
  }

  .stock-page .stock-status-filter-menu {
    left: 0;
    right: 0;

    width: 100%;
  }

}

/* =========================================================
   DIRECT REPORT DOWNLOAD
   ========================================================= */

.stock-page .report-delivery-heading {
  align-items: center;
}


.stock-page .report-download-actions {
  flex: 0 0 210px;

  display: flex;
  flex-direction: column;

  gap: 8px;
}


/* BUTTON */

.stock-page .report-download-btn {
  width: 100%;
  min-height: 54px;

  padding: 9px 13px;

  display: grid;

  grid-template-columns:
    34px
    minmax(0, 1fr);

  align-items: center;

  gap: 11px;

  border: 1px solid var(--stock-line);
  border-radius: 14px;

  color: var(--stock-dark);

  background:
    linear-gradient(
      145deg,
      #ffffff,
      var(--stock-soft-bg)
    );

  text-align: left;

  font: inherit;

  cursor: pointer;

  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}


.stock-page
.report-download-btn:hover:not(:disabled) {
  transform: translateX(-3px);

  border-color: var(--stock-red);

  background: var(--stock-cream);

  box-shadow:
    0 8px 20px rgba(72, 25, 15, 0.08);
}


.stock-page .report-download-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


/* ICON */

.stock-page .report-download-icon {
  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  border-radius: 10px;

  color: white;

  background:
    linear-gradient(
      135deg,
      var(--stock-red),
      var(--stock-coral)
    );

  font-size: 17px;
  font-weight: 900;
}


/* TEXT */

.stock-page .report-download-btn strong,
.stock-page .report-download-btn small {
  display: block;
}


.stock-page .report-download-btn strong {
  color: var(--stock-dark);

  font-size: 12px;
  font-weight: 900;
}


.stock-page .report-download-btn small {
  margin-top: 2px;

  color: var(--stock-muted);

  font-size: 10px;
}


/* MOBILE */

@media (max-width: 680px) {

  .stock-page .report-download-actions {
    width: 100%;
    flex: none;
  }

}

html[data-theme="dark"] .stock-page {
  --stock-dark: #f8eee9;
  --stock-surface: #211815;
  --stock-text: #f3e7e2;
  --stock-muted: #bca8a0;
  --stock-line: #533a33;
  --stock-soft-bg: #1a1210;
  --stock-cream: #382019;
  --stock-shadow: 0 18px 45px rgba(0, 0, 0, 0.36);
  background: radial-gradient(circle at 0 0, rgba(238, 67, 29, 0.13), transparent 28rem), #140e0c;
  color-scheme: dark;
}

html[data-theme="dark"] .stock-page :is(
  .stock-panel,
  .stock-results-panel,
  .stock-run-message,
  .report-action-card,
  .restock-analysis-card,
  .restock-metric,
  .restock-ranking-row,
  .stock-page-jump,
  .stock-status-filter-menu
) {
  color: var(--stock-text);
  background: var(--stock-surface);
  border-color: var(--stock-line);
}

html[data-theme="dark"] .stock-page :is(
  .results-search-wrap,
  .results-filter-group select,
  .stock-link-input-wrap input,
  .stock-pagination-btn,
  .delivery-form input,
  .stock-pagination-size select,
  .stock-page-jump input,
  .stock-threshold-field input[type="number"],
  .stock-status-filter-button
) {
  color: var(--stock-text);
  background: #281c18;
  border-color: var(--stock-line);
}

html[data-theme="dark"] .stock-page :is(.stock-drop-zone, .stock-link-box, .restock-priority-box, .stock-threshold-field, .report-download-btn) {
  background: linear-gradient(145deg, #281c18, var(--stock-soft-bg));
  border-color: var(--stock-line);
}

html[data-theme="dark"] .stock-page .stock-section-heading {
  background: var(--stock-surface);
  border-color: var(--stock-line);
}

html[data-theme="dark"] .stock-page .workspace-state-pill {
  color: #ffb39d;
  background: var(--stock-cream);
  border-color: #8d321e;
}
