/* ==========================================================
   Stock card page — builds on styles.css and feature.css
   ========================================================== */

.back {
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}

.back a {
  color: var(--accent-ink);
}

.back a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* small type chip (PUR, SI, BT…) */
.rt {
  display: inline-block;
  min-width: 34px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1f1f2;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.in {
  color: #2e9e5b;
  font-weight: 600;
}

.out {
  color: #d14343;
  font-weight: 600;
}

/* ---------- Hero: the card filling in ---------- */

.sc-hero {
  width: 100%;
  max-width: 480px;
  justify-self: end;
}

.sc-lines__head,
.sc-lines li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 64px 64px;
  align-items: center;
  gap: 10px;
}

.sc-lines__head {
  margin-top: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.sc-lines__head span:nth-child(n + 3),
.sc-lines li > :nth-child(n + 3) {
  text-align: right;
}

.sc-lines li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.sc-onhand {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
}

.sc-onhand b {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}

/* lines appear one by one, then the on-hand total; the resting state is the
   finished card, so with reduced motion (or no animation) it just shows */
@media (prefers-reduced-motion: no-preference) {
  .sc-lines li {
    animation: sc-line 9s ease-out infinite;
    animation-delay: calc(var(--i) * 0.8s);
    animation-fill-mode: backwards;
  }

  .sc-onhand {
    animation: sc-onhand 9s ease-out infinite;
  }
}

@keyframes sc-line {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  6%,
  80% {
    opacity: 1;
    transform: none;
  }
  88%,
  100% {
    opacity: 0;
  }
}

@keyframes sc-onhand {
  0%,
  52% {
    opacity: 0;
  }
  58%,
  80% {
    opacity: 1;
  }
  88%,
  100% {
    opacity: 0;
  }
}

/* ---------- Paper vs live stock card ---------- */

.vs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.vs__col {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.vs__col--yes {
  border: 2px solid var(--accent);
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.2);
}

.vs__col h3 {
  font-size: 18px;
  letter-spacing: -0.015em;
}

.vs__col--yes h3 {
  color: var(--accent-ink);
}

.vs__list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.vs__list li {
  position: relative;
  padding-left: 28px;
  font-size: 15px;
  color: var(--ink);
}

.vs__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2e9e5b
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.5l2.6 2.6L13 6.6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 18px no-repeat;
}

.vs__list--no li {
  color: var(--ink-2);
}

.vs__list--no li::before {
  background: #f1f1f2
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M6 6l6 6M12 6l-6 6' fill='none' stroke='%239a9aa0' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E")
    center / 18px no-repeat;
}

/* ---------- How to read it ---------- */

.notes {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  counter-reset: note;
}

.notes li {
  counter-increment: note;
  position: relative;
  padding-left: 40px;
  font-size: 15px;
  color: var(--ink-2);
}

.notes li::before {
  content: counter(note);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.notes b {
  color: var(--ink);
  font-weight: 600;
}

.sc-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
}

.sc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.sc-table th {
  padding: 0 8px 8px;
  font-size: 11px;
  font-weight: 500;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.sc-table td {
  padding: 8px;
  border-top: 1px solid var(--line);
  white-space: nowrap;
}

/* ---------- On every card ---------- */

.sc-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 32px;
  margin-top: 48px;
}

.sc-features .feature h3 {
  font-size: 17px;
}

/* ---------- Chart ----------
   Drawn like the app's stock card chart: IN above zero, OUT below, the
   running balance as a line with dots, all on one scale. */

.chart-intro {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 48px;
  align-items: end;
}

.chart-intro .checks {
  margin: 0;
}

.sc-year {
  margin-top: 48px;
  padding: 20px 24px 12px;
}

.sc-year__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 15px;
}

.sc-year__tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-size: 14px;
  color: var(--ink-2);
}

.toggle {
  position: relative;
  width: 34px;
  height: 14px;
  border-radius: 7px;
  background: #bdbdbd;
}

.toggle i {
  position: absolute;
  top: -3px;
  left: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fafafa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.sc-year__nav {
  margin-left: 6px;
  font-size: 18px;
  color: var(--muted);
}

.sc-year__item {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.sc-year__scroll {
  overflow-x: auto;
}

.sc-chart {
  display: block;
  width: 100%;
  min-width: 720px;
  margin-top: 4px;
  font-family: var(--font);
  font-size: 11px;
  fill: #666;
}

.sc-chart .grid {
  stroke: #e6e6e6;
  stroke-dasharray: 3 3;
}

.sc-chart .zero {
  stroke: #d6d6d6;
}

.sc-chart .cin {
  fill: #5b9cf6;
}

.sc-chart .cout {
  fill: #d9584b;
}

.sc-chart .cbal {
  fill: #5fa84d;
}

.sc-chart .lbal {
  fill: none;
  stroke: #5fa84d;
  stroke-width: 3;
  stroke-linejoin: round;
}

.sc-chart .dot {
  fill: #fff;
  stroke: #5fa84d;
  stroke-width: 2;
}

/* ---------- Product balance ---------- */

.pb {
  margin-top: 14px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.pb div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.pb dd {
  margin: 0;
}

.pb__head {
  font-size: 12px;
  color: var(--muted);
}

.pb__total {
  font-weight: 600;
}

.pb__less {
  color: #d14343;
}

.pb .pb__avail {
  border-bottom: 0;
  font-weight: 600;
  color: var(--accent-ink);
}

.pb__btn {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .sc-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sc-hero {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .chart-intro {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

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

@media (max-width: 600px) {
  .sc-features {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .sc-lines__head,
  .sc-lines li {
    grid-template-columns: 42px minmax(0, 1fr) 54px 54px;
    gap: 6px;
  }
}

/* particulars, under the reference */
.sc-part {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.sc-table th:nth-child(n + 3),
.sc-table td:nth-child(n + 3) {
  text-align: right;
}

.sc-table td {
  vertical-align: top;
}
