/* ============================================
   STACKWISE — TRY PAGE STYLES
   Extends the main design system (styles.css)
   ============================================ */


/* ============================================
   TRY HERO
   ============================================ */
.try-hero {
  padding: calc(64px + var(--s-8)) 0 var(--s-7);
}

.try-hero__inner {
  max-width: 720px;
}

.try-hero__headline {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--s-4);
}

.try-hero__sub {
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: var(--s-6);
}


/* ============================================
   STEP-BY-STEP EXPLANATION
   ============================================ */
.try-steps {
  background: var(--bg-warm-white);
  border: 1px solid var(--bg-sand);
  border-radius: var(--radius-card);
  padding: var(--s-5);
}

.try-steps__header {
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--bg-sand);
}

.try-steps__title {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: var(--s-1);
}

.try-steps__sub {
  font-size: 14px;
  color: var(--text-tertiary);
}

.try-steps__list {
  counter-reset: none;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.try-steps__item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
}

.try-steps__number {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-olive);
  margin-top: 2px;
}

.try-steps__item-title {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.try-steps__item-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}


/* ============================================
   DATA INPUT — DEMO / UPLOAD CHOOSER
   ============================================ */
.try-input {
  padding: var(--s-7) 0 var(--s-6);
}

.try-input__chooser {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 720px;
}

@media (min-width: 640px) {
  .try-input__chooser {
    grid-template-columns: 1fr auto 1fr;
    gap: var(--s-4);
    align-items: start;
  }
}

.try-input__option {
  background: var(--bg-warm-white);
  border: 1.5px solid var(--bg-sand);
  border-radius: var(--radius-card);
  padding: var(--s-4);
  transition: border-color var(--t-med) var(--ease-out),
              box-shadow var(--t-med) var(--ease-out);
  cursor: pointer;
}

.try-input__option:hover {
  border-color: #D5CFC7;
}

.try-input__option--active {
  border-color: var(--accent-olive);
  box-shadow: 0 0 0 1px var(--accent-olive);
}

.try-input__option-header {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.try-input__radio {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--text-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: border-color var(--t-fast) var(--ease-out);
}

.try-input__option--active .try-input__radio {
  border-color: var(--accent-olive);
}

.try-input__radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  transition: background var(--t-fast) var(--ease-out);
}

.try-input__option--active .try-input__radio-dot {
  background: var(--accent-olive);
}

.try-input__option-title {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.try-input__option-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.try-input__btn {
  width: 100%;
  margin-top: var(--s-2);
}

/* Divider */
.try-input__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-3) 0;
}

@media (min-width: 640px) {
  .try-input__divider {
    padding: var(--s-6) 0 0;
  }
}

.try-input__divider-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}


/* ============================================
   UPLOAD AREA
   ============================================ */
.try-upload {
  margin-top: var(--s-2);
}

.try-upload__dropzone {
  position: relative;
  border: 1.5px dashed var(--bg-sand);
  border-radius: var(--radius-btn);
  padding: var(--s-5) var(--s-4);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-med) var(--ease-out),
              background var(--t-med) var(--ease-out);
}

.try-upload__dropzone:hover,
.try-upload__dropzone--drag-over {
  border-color: var(--accent-olive);
  background: rgba(92, 107, 79, 0.03);
}

.try-upload__dropzone:focus-visible {
  outline: 2px solid var(--accent-olive);
  outline-offset: 2px;
}

.try-upload__icon {
  margin: 0 auto var(--s-2);
  color: var(--text-tertiary);
}

.try-upload__dropzone-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--s-1);
}

.try-upload__browse {
  color: var(--accent-olive);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.try-upload__dropzone-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.try-upload__file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* File selected state */
.try-upload__file-info {
  margin-top: var(--s-2);
}

.try-upload__file-details {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: rgba(92, 107, 79, 0.05);
  border-radius: var(--radius-btn);
}

.try-upload__file-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.try-upload__file-remove {
  font-size: 18px;
  color: var(--text-tertiary);
  padding: 2px 6px;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease-out);
}

.try-upload__file-remove:hover {
  color: var(--accent-rust);
}

/* Error state */
.try-upload__error {
  display: none;  /* explicitly hidden; shown via :not([hidden]) below */
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: rgba(184, 92, 58, 0.06);
  border-radius: var(--radius-btn);
}

.try-upload__error:not([hidden]) {
  display: flex;
}

.try-upload__error-text {
  font-size: 13px;
  color: var(--accent-rust);
  line-height: 1.4;
}


/* ============================================
   CSV FORMAT GUIDANCE
   ============================================ */
.try-csv-guide {
  max-width: 720px;
  margin-top: var(--s-4);
}

.try-csv-guide__details {
  border: 1px solid var(--bg-sand);
  border-radius: var(--radius-card);
  background: var(--bg-warm-white);
}

.try-csv-guide__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  list-style: none;
}

.try-csv-guide__summary::-webkit-details-marker {
  display: none;
}

.try-csv-guide__summary .faq__icon {
  flex-shrink: 0;
  margin-left: var(--s-3);
  transition: transform var(--t-med) var(--ease-out);
}

details[open] > .try-csv-guide__summary .faq__icon {
  transform: rotate(180deg);
}

.try-csv-guide__content {
  padding: 0 var(--s-4) var(--s-4);
}

.try-csv-guide__intro {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: var(--s-4);
}

.try-csv-guide__schema-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: var(--s-2);
}

.try-csv-guide__table-wrap {
  overflow-x: auto;
  margin-bottom: var(--s-4);
}

.try-csv-guide__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.try-csv-guide__table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  padding: var(--s-2);
  border-bottom: 1px solid var(--bg-sand);
}

.try-csv-guide__table td {
  padding: var(--s-2);
  border-bottom: 1px solid var(--bg-sand);
  color: var(--text-primary);
  vertical-align: top;
}

.try-csv-guide__table tr:last-child td {
  border-bottom: none;
}

.try-csv-guide__table code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: rgba(92, 107, 79, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
}

.try-csv-guide__required {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-olive);
  background: rgba(92, 107, 79, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
}

.try-csv-guide__optional {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: rgba(156, 149, 144, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
}

.try-csv-guide__example {
  margin-bottom: var(--s-4);
}

.try-csv-guide__code {
  background: var(--bg-cream);
  border: 1px solid var(--bg-sand);
  border-radius: var(--radius-btn);
  padding: var(--s-3);
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-primary);
}

.try-csv-guide__note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-tertiary);
  font-style: italic;
}


/* ============================================
   RESULTS SECTION
   ============================================ */
.try-results {
  padding: var(--s-7) 0;
  background: var(--bg-warm-white);
  /* Reveal animation */
  animation: results-slide-in 500ms var(--ease-out);
}

@keyframes results-slide-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.try-results__header {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

@media (min-width: 640px) {
  .try-results__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.try-results__title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: var(--s-1);
}

.try-results__source {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* Forecast horizon selector */
.try-results__horizon {
  display: flex;
  background: var(--bg-cream);
  border: 1px solid var(--bg-sand);
  border-radius: var(--radius-btn);
  padding: 3px;
  gap: 2px;
}

.try-results__horizon-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: all var(--t-fast) var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
}

.try-results__horizon-btn:hover {
  color: var(--text-primary);
}

.try-results__horizon-btn--active {
  background: var(--bg-warm-white);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(26, 25, 21, 0.06);
}

/* Results panels */
.try-results__panel {
  background: var(--bg-cream);
  border: 1px solid var(--bg-sand);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: var(--s-4);
}

.try-results__panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--bg-sand);
  background: var(--bg-warm-white);
}

.try-results__panel-title {
  font-size: 14px;
  font-weight: 600;
}

.try-results__panel-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

.try-results__panel-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-terra);
  background: rgba(196, 132, 92, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Results table */
.try-results__table-wrap {
  overflow-x: auto;
  padding: var(--s-3);
}

.try-results__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.try-results__table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  padding: var(--s-2);
  border-bottom: 1px solid var(--bg-sand);
}

.try-results__table td {
  padding: var(--s-2);
  border-bottom: 1px solid var(--bg-sand);
  color: var(--text-primary);
  white-space: nowrap;
}

.try-results__table tr:last-child td {
  border-bottom: none;
}

/* Row reveal animation */
.try-results__table tbody tr {
  animation: row-fade-in 400ms var(--ease-out) both;
}

.try-results__table tbody tr:nth-child(1) { animation-delay: 0ms; }
.try-results__table tbody tr:nth-child(2) { animation-delay: 50ms; }
.try-results__table tbody tr:nth-child(3) { animation-delay: 100ms; }
.try-results__table tbody tr:nth-child(4) { animation-delay: 150ms; }
.try-results__table tbody tr:nth-child(5) { animation-delay: 200ms; }
.try-results__table tbody tr:nth-child(6) { animation-delay: 250ms; }
.try-results__table tbody tr:nth-child(7) { animation-delay: 300ms; }
.try-results__table tbody tr:nth-child(8) { animation-delay: 350ms; }
.try-results__table tbody tr:nth-child(9) { animation-delay: 400ms; }
.try-results__table tbody tr:nth-child(10) { animation-delay: 450ms; }
.try-results__table tbody tr:nth-child(11) { animation-delay: 500ms; }
.try-results__table tbody tr:nth-child(12) { animation-delay: 550ms; }

@keyframes row-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reorder list */
.try-results__reorder-list {
  padding: var(--s-3);
}

.try-results__reorder-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--bg-sand);
  animation: row-fade-in 400ms var(--ease-out) both;
}

.try-results__reorder-item:last-child {
  border-bottom: none;
}

.try-results__reorder-item:nth-child(1) { animation-delay: 100ms; }
.try-results__reorder-item:nth-child(2) { animation-delay: 180ms; }
.try-results__reorder-item:nth-child(3) { animation-delay: 260ms; }
.try-results__reorder-item:nth-child(4) { animation-delay: 340ms; }
.try-results__reorder-item:nth-child(5) { animation-delay: 420ms; }

.try-results__reorder-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.try-results__reorder-icon--high {
  background: rgba(184, 92, 58, 0.1);
  color: var(--accent-rust);
}

.try-results__reorder-icon--medium {
  background: rgba(107, 101, 96, 0.1);
  color: var(--text-secondary);
}

.try-results__reorder-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.try-results__reorder-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* Empty state */
.try-results__empty {
  padding: var(--s-6) var(--s-4);
  text-align: center;
}

.try-results__empty-text {
  font-size: 14px;
  color: var(--text-tertiary);
}


/* ============================================
   SAVE / EXPORT GATE
   ============================================ */
.try-results__gate {
  background: var(--bg-cream);
  border: 2px solid var(--accent-olive);
  border-radius: var(--radius-card);
  padding: var(--s-5);
  margin-top: var(--s-4);
}

.try-results__gate-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  margin-bottom: var(--s-2);
}

.try-results__gate-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: var(--s-4);
  max-width: 480px;
}

.try-results__gate-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

@media (min-width: 640px) {
  .try-results__gate-form {
    flex-direction: row;
    align-items: flex-end;
    gap: var(--s-4);
  }
}

.try-results__gate-input-wrap {
  flex: 1;
  max-width: 320px;
}

.try-results__gate-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: var(--s-1);
}

.try-results__gate-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  border: 1.5px solid var(--bg-sand);
  border-radius: var(--radius-btn);
  background: var(--bg-warm-white);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--t-med) var(--ease-out);
}

.try-results__gate-input::placeholder {
  color: var(--text-tertiary);
}

.try-results__gate-input:focus {
  border-color: var(--accent-olive);
}

.try-results__gate-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: var(--s-1);
}

.try-results__gate-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

@media (min-width: 640px) {
  .try-results__gate-actions {
    flex-direction: row;
    gap: var(--s-3);
  }
}

/* Gate success state */
.try-results__gate-success {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-4);
  background: rgba(92, 107, 79, 0.05);
  border-radius: var(--radius-btn);
  animation: results-slide-in 400ms var(--ease-out);
}

.try-results__gate-success svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.try-results__gate-success-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.try-results__gate-success-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}


/* ============================================
   TRUST BLOCK (TRY PAGE VERSION)
   ============================================ */
.try-trust {
  padding: var(--s-7) 0;
  border-top: 1px solid var(--bg-sand);
}

.try-trust__inner {
  max-width: 720px;
}

.try-trust__title {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: var(--s-4);
}

.try-trust__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}

@media (min-width: 640px) {
  .try-trust__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.try-trust__item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
}

.try-trust__icon {
  flex-shrink: 0;
  color: var(--accent-olive);
  margin-top: 1px;
}

.try-trust__item-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.try-trust__item-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}


/* ============================================
   DEMO FAQ
   ============================================ */
.try-faq {
  padding: var(--s-7) 0;
  background: var(--bg-warm-white);
}

.try-faq__link {
  color: var(--accent-olive);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.try-faq__link:hover {
  color: var(--accent-olive-light);
}


/* ============================================
   BOTTOM CTA — CONVERT DEMO USERS
   ============================================ */
.try-cta {
  padding: var(--s-8) 0;
  background: var(--bg-dark);
}

.try-cta__inner {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.try-cta__headline {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  line-height: 1.1;
  color: var(--text-inverse);
  margin-bottom: var(--s-4);
}

.try-cta__sub {
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.6;
  color: var(--text-tertiary);
  margin-bottom: var(--s-5);
}

.try-cta__actions .btn--primary {
  background: var(--text-inverse);
  color: var(--bg-dark);
  border-color: var(--text-inverse);
}

.try-cta__actions .btn--primary:hover {
  background: var(--bg-sand);
  border-color: var(--bg-sand);
}

.try-cta__note {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: var(--s-3);
}


/* ============================================
   LOADING / PROCESSING STATE
   ============================================ */
.try-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-8) 0;
  text-align: center;
}

.try-loading__spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--bg-sand);
  border-top-color: var(--accent-olive);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
  margin-bottom: var(--s-3);
}

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

.try-loading__text {
  font-size: 14px;
  color: var(--text-secondary);
}

.try-loading__sub {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: var(--s-1);
}


/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .try-results {
    animation: none;
  }

  .try-results__table tbody tr,
  .try-results__reorder-item,
  .try-results__gate-success {
    animation: none;
  }

  .try-loading__spinner {
    animation: none;
    border-top-color: var(--accent-olive);
  }
}


/* ============================================
   MODE BANNER — Forecast-only vs Inventory-aware
   ============================================ */
.try-results__mode-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-btn);
  background: rgba(156, 149, 144, 0.08);
  border: 1px solid var(--bg-sand);
  margin-bottom: var(--s-5);
}

.try-results__mode-banner--inventory {
  background: rgba(92, 107, 79, 0.06);
  border-color: var(--accent-olive);
}

.try-results__mode-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-tertiary);
}

.try-results__mode-banner--inventory .try-results__mode-icon {
  color: var(--accent-olive);
}

.try-results__mode-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.try-results__mode-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}


/* ============================================
   STOCK INPUT SECTION
   ============================================ */
.try-results__stock-input {
  padding: var(--s-4);
  background: var(--bg-cream);
  border: 1px solid var(--bg-sand);
  border-radius: var(--radius-card);
  margin-bottom: var(--s-5);
}

.try-results__stock-header {
  margin-bottom: var(--s-3);
}

.try-results__stock-title {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.try-results__stock-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.try-results__stock-options {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.try-results__stock-or {
  font-size: 13px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.try-results__stock-upload {
  position: relative;
}

.try-results__stock-upload-btn {
  cursor: pointer;
}

.try-results__stock-error {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: rgba(184, 92, 58, 0.06);
  border-radius: var(--radius-btn);
}

.try-results__stock-error-text {
  font-size: 13px;
  color: var(--accent-rust);
  line-height: 1.4;
}

.try-results__stock-loaded {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: rgba(92, 107, 79, 0.06);
  border-radius: var(--radius-btn);
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.try-results__stock-remove {
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-rust);
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px 6px;
  transition: opacity var(--t-fast) var(--ease-out);
}

.try-results__stock-remove:hover {
  opacity: 0.7;
}


/* ============================================
   REORDER FORMULA & CALCULATION DISPLAY
   ============================================ */
.try-results__formula {
  margin-top: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--bg-cream);
  border-radius: var(--radius-btn);
  border: 1px solid var(--bg-sand);
}

.try-results__formula-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--s-1);
}

.try-results__formula-detail {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: var(--s-1);
}

.try-results__formula-note {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.try-results__reorder-calc {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.text-muted {
  color: var(--text-tertiary);
}


/* ============================================
   STOCK PANEL — Tabbed 3-method interface
   ============================================ */
.stock-panel {
  background: var(--bg-cream);
  border: 1.5px solid var(--bg-sand);
  border-radius: var(--radius-card);
  margin-bottom: var(--s-5);
  overflow: hidden;
  animation: results-slide-in 400ms var(--ease-out);
}

.stock-panel__header {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4);
  border-bottom: 1px solid var(--bg-sand);
  background: var(--bg-warm-white);
}

@media (min-width: 640px) {
  .stock-panel__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.stock-panel__title {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.stock-panel__subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Status indicator */
.stock-panel__status {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(156, 149, 144, 0.08);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background var(--t-med) var(--ease-out), color var(--t-med) var(--ease-out);
}

.stock-panel__status--complete {
  background: rgba(92, 107, 79, 0.1);
  color: var(--accent-olive);
}

.stock-panel__status--partial {
  background: rgba(196, 132, 92, 0.1);
  color: var(--accent-terra);
}

.stock-panel__status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  transition: background var(--t-med) var(--ease-out);
}

.stock-panel__status--complete .stock-panel__status-dot {
  background: var(--accent-olive);
}

.stock-panel__status--partial .stock-panel__status-dot {
  background: var(--accent-terra);
}

/* Demo CTA */
.stock-panel__demo-cta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--bg-sand);
  background: rgba(92, 107, 79, 0.03);
}

.stock-panel__demo-note {
  font-size: 12px;
  color: var(--text-tertiary);
}


/* ===== Tab Navigation ===== */
.stock-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--bg-sand);
  padding: 0 var(--s-4);
  overflow-x: auto;
}

.stock-tabs__tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}

.stock-tabs__tab:hover {
  color: var(--text-secondary);
}

.stock-tabs__tab--active {
  color: var(--accent-olive);
  border-bottom-color: var(--accent-olive);
}

.stock-tabs__tab svg {
  flex-shrink: 0;
}

/* Tab panels */
.stock-tabs__panel {
  padding: var(--s-4);
}


/* ===== Editor Tab ===== */
.stock-editor__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
  flex-wrap: wrap;
}

.stock-editor__actions {
  display: flex;
  gap: var(--s-2);
}

.stock-editor__hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.stock-editor__table-wrap {
  overflow-x: auto;
  border: 1px solid var(--bg-sand);
  border-radius: var(--radius-btn);
  background: var(--bg-warm-white);
}

.stock-editor__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.stock-editor__table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--bg-sand);
  background: var(--bg-cream);
}

.stock-editor__table td {
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--bg-sand);
  color: var(--text-primary);
  vertical-align: middle;
}

.stock-editor__table tr:last-child td {
  border-bottom: none;
}

.stock-editor__th-stock {
  min-width: 140px;
}

.stock-editor__input {
  width: 100%;
  max-width: 120px;
  padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  border: 1.5px solid var(--bg-sand);
  border-radius: 6px;
  background: var(--bg-warm-white);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--t-fast) var(--ease-out);
  -moz-appearance: textfield;
}

.stock-editor__input::-webkit-inner-spin-button,
.stock-editor__input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stock-editor__input:focus {
  border-color: var(--accent-olive);
}

.stock-editor__input--error {
  border-color: var(--accent-rust);
}

.stock-editor__input--filled {
  border-color: var(--accent-olive);
  background: rgba(92, 107, 79, 0.03);
}

.stock-editor__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--s-3);
}


/* ===== Ghost/XS button ===== */
.btn--ghost {
  background: none;
  border: 1px solid var(--bg-sand);
  color: var(--text-secondary);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}

.btn--ghost:hover {
  border-color: var(--text-tertiary);
  color: var(--text-primary);
}

.btn--xs {
  padding: 5px 10px;
  font-size: 12px;
}


/* ===== Paste Tab ===== */
.stock-paste__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--s-1);
}

.stock-paste__hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: var(--s-3);
  line-height: 1.4;
}

.stock-paste__example {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: rgba(92, 107, 79, 0.04);
  border-radius: 6px;
  margin-bottom: var(--s-3);
  font-size: 12px;
}

.stock-paste__example-label {
  color: var(--text-tertiary);
  font-weight: 500;
  white-space: nowrap;
}

.stock-paste__example code {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.stock-paste__textarea {
  width: 100%;
  padding: var(--s-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  border: 1.5px solid var(--bg-sand);
  border-radius: var(--radius-btn);
  background: var(--bg-warm-white);
  color: var(--text-primary);
  resize: vertical;
  outline: none;
  transition: border-color var(--t-med) var(--ease-out);
}

.stock-paste__textarea::placeholder {
  color: var(--text-tertiary);
}

.stock-paste__textarea:focus {
  border-color: var(--accent-olive);
}

/* Preview */
.stock-paste__preview {
  margin-top: var(--s-3);
  border: 1px solid var(--bg-sand);
  border-radius: var(--radius-btn);
  overflow: hidden;
  animation: results-slide-in 300ms var(--ease-out);
}

.stock-paste__preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-2) var(--s-3);
  background: var(--bg-cream);
  border-bottom: 1px solid var(--bg-sand);
}

.stock-paste__preview-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.stock-paste__preview-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.stock-paste__preview-table-wrap {
  max-height: 200px;
  overflow-y: auto;
}

.stock-paste__preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.stock-paste__preview-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  padding: 6px var(--s-3);
  border-bottom: 1px solid var(--bg-sand);
  background: var(--bg-warm-white);
  position: sticky;
  top: 0;
}

.stock-paste__preview-table td {
  padding: 5px var(--s-3);
  border-bottom: 1px solid var(--bg-sand);
  color: var(--text-primary);
}

.stock-paste__preview-table tr:last-child td {
  border-bottom: none;
}

.paste-status--matched {
  color: var(--accent-olive);
  font-weight: 500;
}

.paste-status--unmatched {
  color: var(--accent-terra);
  font-weight: 500;
}

.paste-status--invalid {
  color: var(--accent-rust);
  font-weight: 500;
}

.paste-status--duplicate {
  color: var(--text-tertiary);
  font-weight: 500;
}

.stock-paste__error {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: rgba(184, 92, 58, 0.06);
  border-radius: var(--radius-btn);
}

.stock-paste__error-text {
  font-size: 13px;
  color: var(--accent-rust);
  line-height: 1.4;
}

.stock-paste__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--s-3);
}


/* ===== CSV Upload Tab ===== */
.stock-csv__dropzone {
  position: relative;
  border: 1.5px dashed var(--bg-sand);
  border-radius: var(--radius-btn);
  padding: var(--s-5) var(--s-4);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-med) var(--ease-out), background var(--t-med) var(--ease-out);
}

.stock-csv__dropzone:hover,
.stock-csv__dropzone--drag-over {
  border-color: var(--accent-olive);
  background: rgba(92, 107, 79, 0.03);
}

.stock-csv__dropzone svg {
  margin: 0 auto var(--s-2);
  color: var(--text-tertiary);
}

.stock-csv__dropzone-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--s-1);
}

.stock-csv__browse {
  color: var(--accent-olive);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.stock-csv__dropzone-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.stock-csv__file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.stock-csv__file-info {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: rgba(92, 107, 79, 0.05);
  border-radius: var(--radius-btn);
  margin-top: var(--s-3);
}

.stock-csv__file-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-csv__file-remove {
  font-size: 18px;
  color: var(--text-tertiary);
  padding: 2px 6px;
  cursor: pointer;
  background: none;
  border: none;
  transition: color var(--t-fast) var(--ease-out);
}

.stock-csv__file-remove:hover {
  color: var(--accent-rust);
}


/* Column mapping */
.stock-csv__mapping {
  margin-top: var(--s-4);
  padding: var(--s-4);
  background: var(--bg-warm-white);
  border: 1px solid var(--bg-sand);
  border-radius: var(--radius-btn);
  animation: results-slide-in 300ms var(--ease-out);
}

.stock-csv__mapping-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.stock-csv__mapping-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: var(--s-3);
}

.stock-csv__mapping-row {
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.stock-csv__mapping-field {
  flex: 1;
  min-width: 160px;
}

.stock-csv__mapping-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stock-csv__mapping-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  border: 1.5px solid var(--bg-sand);
  border-radius: 6px;
  background: var(--bg-warm-white);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out);
  appearance: auto;
}

.stock-csv__mapping-select:focus {
  border-color: var(--accent-olive);
}


/* Match rate */
.stock-csv__match {
  margin-top: var(--s-4);
  animation: results-slide-in 300ms var(--ease-out);
}

.stock-csv__match-bar {
  height: 6px;
  background: var(--bg-sand);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--s-2);
}

.stock-csv__match-fill {
  height: 100%;
  background: var(--accent-olive);
  border-radius: 3px;
  transition: width 400ms var(--ease-out);
}

.stock-csv__match-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.stock-csv__unmatched {
  margin-top: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: rgba(196, 132, 92, 0.06);
  border-radius: 6px;
}

.stock-csv__unmatched-label {
  font-size: 12px;
  color: var(--accent-terra);
  font-weight: 500;
  margin-bottom: 4px;
}

.stock-csv__unmatched-list {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  word-break: break-all;
}

.stock-csv__error {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: rgba(184, 92, 58, 0.06);
  border-radius: var(--radius-btn);
}

.stock-csv__error-text {
  font-size: 13px;
  color: var(--accent-rust);
  line-height: 1.4;
}

.stock-csv__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--s-3);
}


/* ===== Success State ===== */
.stock-panel__success {
  animation: results-slide-in 300ms var(--ease-out);
}

.stock-panel__success-content {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: rgba(92, 107, 79, 0.06);
  border-bottom: 1px solid rgba(92, 107, 79, 0.12);
}

.stock-panel__success svg {
  flex-shrink: 0;
}

.stock-panel__success-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-olive);
}

.stock-panel__success-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.stock-panel__success-edit,
.stock-panel__success-remove {
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--t-fast) var(--ease-out);
  white-space: nowrap;
}

.stock-panel__success-edit {
  color: var(--accent-olive);
  margin-left: auto;
}

.stock-panel__success-edit:hover {
  background: rgba(92, 107, 79, 0.08);
}

.stock-panel__success-remove {
  color: var(--accent-rust);
  margin-left: 0;
}

.stock-panel__success-remove:hover {
  background: rgba(184, 92, 58, 0.08);
}


/* ===== Lead Time ===== */
.stock-panel__leadtime {
  padding: var(--s-4);
  border-top: 1px solid var(--bg-sand);
  animation: results-slide-in 300ms var(--ease-out);
}

.stock-panel__leadtime-header {
  margin-bottom: var(--s-3);
}

.stock-panel__leadtime-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.stock-panel__leadtime-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.stock-panel__leadtime-controls {
  display: flex;
  align-items: flex-end;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.stock-panel__leadtime-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stock-panel__leadtime-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.stock-panel__leadtime-input {
  width: 72px;
  padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  border: 1.5px solid var(--bg-sand);
  border-radius: 6px;
  background: var(--bg-warm-white);
  color: var(--text-primary);
  outline: none;
  text-align: center;
  -moz-appearance: textfield;
  transition: border-color var(--t-fast) var(--ease-out);
}

.stock-panel__leadtime-input::-webkit-inner-spin-button,
.stock-panel__leadtime-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stock-panel__leadtime-input:focus {
  border-color: var(--accent-olive);
}

.stock-panel__leadtime-unit {
  font-size: 13px;
  color: var(--text-tertiary);
}

.stock-panel__leadtime-toggle {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  cursor: pointer;
  margin-bottom: 4px;
}

.stock-panel__leadtime-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-olive);
  cursor: pointer;
}

.stock-panel__leadtime-toggle-text {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.stock-panel__leadtime-persku {
  margin-top: var(--s-3);
  animation: results-slide-in 300ms var(--ease-out);
}

.stock-panel__leadtime-persku-wrap {
  border: 1px solid var(--bg-sand);
  border-radius: var(--radius-btn);
  overflow: auto;
  max-height: 300px;
  background: var(--bg-warm-white);
}

.stock-panel__leadtime-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.stock-panel__leadtime-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--bg-sand);
  background: var(--bg-cream);
  position: sticky;
  top: 0;
}

.stock-panel__leadtime-table td {
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--bg-sand);
  color: var(--text-primary);
}

.stock-panel__leadtime-table tr:last-child td {
  border-bottom: none;
}

.stock-panel__leadtime-table input {
  width: 72px;
  padding: 5px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  border: 1.5px solid var(--bg-sand);
  border-radius: 6px;
  background: var(--bg-warm-white);
  color: var(--text-primary);
  outline: none;
  text-align: center;
  -moz-appearance: textfield;
}

.stock-panel__leadtime-table input:focus {
  border-color: var(--accent-olive);
}

.stock-panel__leadtime-table input::-webkit-inner-spin-button,
.stock-panel__leadtime-table input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}


/* ===== Safety Stock Buffer ===== */
.stock-panel__safety {
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--bg-sand);
  animation: results-slide-in 300ms var(--ease-out);
}

.stock-panel__safety-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}

.stock-panel__safety-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.stock-panel__safety-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.stock-panel__safety-input {
  width: 56px;
  padding: 5px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  border: 1.5px solid var(--bg-sand);
  border-radius: 6px;
  background: var(--bg-warm-white);
  color: var(--text-primary);
  outline: none;
  text-align: center;
  -moz-appearance: textfield;
}

.stock-panel__safety-input::-webkit-inner-spin-button,
.stock-panel__safety-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stock-panel__safety-input:focus {
  border-color: var(--accent-olive);
}

.stock-panel__safety-unit {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.stock-panel__safety-hint {
  width: 100%;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-tertiary);
  margin-top: 2px;
}


/* ===== Collapsed state for stock panel ===== */
.stock-panel--collapsed .stock-tabs,
.stock-panel--collapsed .stock-tabs__panel,
.stock-panel--collapsed .stock-panel__demo-cta {
  display: none;
}


/* ============================================
   INVENTORY HEALTH OVERVIEW DASHBOARD
   ============================================ */
.health-overview {
  background: var(--bg-cream);
  border: 1px solid var(--bg-sand);
  border-radius: var(--radius-card);
  margin-bottom: var(--s-5);
  overflow: hidden;
  animation: results-slide-in 400ms var(--ease-out);
}

.health-overview__header {
  padding: var(--s-4);
  border-bottom: 1px solid var(--bg-sand);
  background: var(--bg-warm-white);
}

.health-overview__title {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.health-overview__sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.health-overview__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--bg-sand);
  padding: 0;
}

@media (min-width: 768px) {
  .health-overview__grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.health-card {
  padding: var(--s-4);
  background: var(--bg-cream);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.health-card__value {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 400;
  line-height: 1.1;
  color: var(--text-primary);
}

.health-card--risk .health-card__value {
  color: var(--accent-rust);
}

.health-card--overdue .health-card__value {
  color: var(--accent-terra);
}

.health-card--coverage .health-card__value {
  color: var(--accent-olive);
}

.health-card--revenue .health-card__value {
  color: var(--accent-rust);
}

.health-card--capital .health-card__value {
  color: var(--text-secondary);
}

.health-card__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.health-card__sub {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.3;
}

.health-overview__formulas {
  border-top: 1px solid var(--bg-sand);
}

.health-overview__formulas-toggle {
  cursor: pointer;
}

.health-overview__formulas-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-2) var(--s-4);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  list-style: none;
}

.health-overview__formulas-summary::-webkit-details-marker {
  display: none;
}

.health-overview__formulas-summary .faq__icon {
  transition: transform var(--t-med) var(--ease-out);
}

details[open] > .health-overview__formulas-summary .faq__icon {
  transform: rotate(180deg);
}

.health-overview__formulas-content {
  padding: 0 var(--s-4) var(--s-3);
}

.health-overview__formulas-content p {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.8;
}


/* ============================================
   VOLATILITY BADGES
   ============================================ */
.volatility-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: help;
}

.volatility--stable {
  color: var(--accent-olive);
  background: rgba(92, 107, 79, 0.08);
}

.volatility--moderate {
  color: var(--accent-terra);
  background: rgba(196, 132, 92, 0.08);
}

.volatility--volatile {
  color: var(--accent-rust);
  background: rgba(184, 92, 58, 0.08);
}


/* ============================================
   COVERAGE COLUMN COLORS
   ============================================ */
.coverage--healthy {
  color: var(--accent-olive);
}

.coverage--warning {
  color: var(--accent-terra);
}

.coverage--critical {
  color: var(--accent-rust);
  font-weight: 600;
}


/* ============================================
   REORDER TIER LABELS
   ============================================ */
.reorder-tier {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.reorder-tier--high {
  color: var(--accent-rust);
  background: rgba(184, 92, 58, 0.08);
}

.reorder-tier--medium {
  color: var(--text-secondary);
  background: rgba(107, 101, 96, 0.08);
}


/* ============================================
   RISK BADGE — CRITICAL STATE
   ============================================ */
.risk--critical {
  color: #fff;
  background: var(--accent-rust);
}


/* ============================================
   SAFETY PANEL — UPDATED FOR SERVICE LEVEL
   ============================================ */
.stock-panel__safety-select {
  padding: 5px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  border: 1.5px solid var(--bg-sand);
  border-radius: 6px;
  background: var(--bg-warm-white);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out);
  appearance: auto;
}

.stock-panel__safety-select:focus {
  border-color: var(--accent-olive);
}


.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  max-width: 360px;
}

.toast--visible {
  opacity: 1;
  transform: translateX(0);
}

.toast--success {
  background: var(--accent-olive);
  color: #fff;
}

.toast--error {
  background: var(--accent-rust);
  color: #fff;
}

.toast--info {
  background: var(--bg-dark);
  color: var(--text-inverse);
}


.btn--outline {
  background: transparent;
  border: 1.5px solid var(--bg-sand);
  color: var(--text-primary);
  padding: 8px 20px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 500;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}

.btn--outline:hover {
  border-color: var(--accent-olive);
  background: rgba(92, 107, 79, 0.06);
}

.btn--ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}

.btn--ghost:hover {
  color: var(--accent-rust);
  background: rgba(184, 92, 58, 0.06);
}


.nav__auth-out,
.nav__auth-in {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__auth-out[hidden],
.nav__auth-in[hidden] {
  display: none;
}

.nav__mobile-auth[hidden] {
  display: none;
}

.nav__user-pill {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-sand);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav__mobile-auth {
  display: flex;
  flex-direction: column;
}

.nav__mobile-auth-btn {
  width: 100%;
}

.nav__mobile-pill {
  text-align: center;
}


.guest-overlay {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: var(--s-5) var(--s-4);
}

.guest-overlay__card {
  background: var(--bg-warm-white);
  border: 2px solid var(--accent-olive);
  border-radius: 16px;
  padding: var(--s-6) var(--s-5);
  text-align: center;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
}

.guest-overlay__title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 24px;
  font-weight: 400;
}

.guest-overlay__desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 340px;
}

.guest-overlay__note {
  font-size: 12px;
  color: var(--text-tertiary);
}

body.is-guest .try-results > .container {
  opacity: 0.3;
  pointer-events: none;
  filter: blur(3px);
  user-select: none;
  transition: opacity var(--t-slow) var(--ease-out), filter var(--t-slow) var(--ease-out);
}


.upgrade-banner {
  margin: 0 auto;
  max-width: 1200px;
  padding: 0 var(--s-4);
}

.upgrade-banner__inner {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(196, 132, 92, 0.08), rgba(92, 107, 79, 0.08));
  border: 1px solid rgba(196, 132, 92, 0.2);
  border-radius: 12px;
  margin-bottom: var(--s-4);
}

.upgrade-banner__text {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
}


.pricing-section {
  padding: var(--s-8) 0 var(--s-7);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
  max-width: 960px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
  }
}

.pricing-card {
  background: var(--bg-warm-white);
  border: 1.5px solid var(--bg-sand);
  border-radius: 16px;
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out);
}

.pricing-card:hover {
  border-color: #D5CFC7;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.pricing-card--featured {
  border-color: var(--accent-olive);
  box-shadow: 0 0 0 1px var(--accent-olive), 0 8px 32px rgba(92, 107, 79, 0.12);
}

.pricing-card--featured:hover {
  border-color: var(--accent-olive);
}

.pricing-card__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-olive);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 16px;
  border-radius: 999px;
  white-space: nowrap;
}

.pricing-card__header {
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--bg-sand);
}

.pricing-card__name {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--s-2);
}

.pricing-card__price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: var(--s-2);
}

.pricing-card__amount {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
}

.pricing-card__period {
  font-size: 14px;
  color: var(--text-tertiary);
}

.pricing-card__desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.pricing-card__features {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: var(--s-5);
}

.pricing-card__features li {
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 22px;
  position: relative;
  line-height: 1.4;
}

.pricing-card__features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 14px;
  height: 14px;
  background: var(--accent-olive);
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 7L6 10L11 4' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 7L6 10L11 4' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

.pricing-card__btn {
  width: 100%;
  text-align: center;
}
