/* widgets/stc/assets/css/style.css */

/* =========================================
   ۱. بیس سیستم و متغیرهای سبک iOS (SYSTEM ROOT)
========================================= */
#stc-app {
  /* پالت رنگی رسمی و مینیمال Apple iOS */
  --stc-apple-blue: #007af5;
  --stc-apple-blue-rgb: 0, 122, 245;
  --stc-apple-red: #ff3b30;
  --stc-apple-red-rgb: 255, 59, 48;
  --stc-apple-bg: #f6f6f8;
  --stc-apple-card: #ffffff;
  --stc-apple-gray-input: #f7f7fa;
  --stc-apple-text: #000000;
  --stc-apple-muted: #8e8e93;
  --stc-apple-border: rgba(0, 0, 0, 0.05);

  /* قوانین ساختاری فرم‌های iOS */
  --stc-radius-lg: 20px;
  --stc-radius-md: 12px;
  --stc-radius-sm: 8px;
  --stc-transition: cubic-bezier(0.25, 0.8, 0.25, 1) 0.28s;

  color: var(--stc-apple-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background-color: var(--stc-apple-bg);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}

#stc-app *,
#stc-app *::before,
#stc-app *::after {
  box-sizing: inherit;
}

/* =========================================
   ۲. کدهای کمکی بومی جایگزین بوت‌استرپ (LOCAL UTILITIES)
========================================= */
.stc-d-none {
  display: none !important;
}
.stc-d-flex {
  display: flex !important;
}
.stc-align-items-center {
  align-items: center !important;
}
.stc-justify-content-between {
  justify-content: space-between !important;
}
.stc-flex-wrap {
  flex-wrap: wrap !important;
}
.stc-text-center {
  text-align: center !important;
}

/* فاصله‌گذاری‌های اختصاصی جایگزین ابعاد مارس و پدینگ بوت‌استرپ */
.stc-mb-0 {
  margin-bottom: 0 !important;
}
.stc-mb-1 {
  margin-bottom: 0.25rem !important;
}
.stc-mb-3 {
  margin-bottom: 1rem !important;
}
.stc-mb-4 {
  margin-bottom: 1.5rem !important;
}
.stc-mt-4 {
  margin-top: 1.5rem !important;
}
.stc-py-4 {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}
.stc-gap-2 {
  gap: 0.5rem !important;
}
.stc-gap-3 {
  gap: 1rem !important;
}

/* =========================================
   ۳. سیستم گرید هوشمند و داینامیک (IOS FLEX GRID)
========================================= */
/* ساختار ردیف‌های اصلی کنترلرها */
.stc-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* کاستومایز چیدمان برای بخش‌های عریض‌تر مثل مقیاس‌ها */
.stc-scale-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

/* ریپوزیشن کردن المان‌ها روی ساختار ستون‌های قدیمی */
.stc-col-12 {
  grid-column: span 12;
}

/* =========================================
   ۴. ساختار و شل اصلی (SHELL & CONTAINER)
========================================= */
.stc-shell {
  max-width: 1200px;
  margin: auto;
  padding: 1.5rem;
}

/* =========================================
   ۵. هدر به سبک اپل (TYPOGRAPHY & LARGE TITLES)
========================================= */
.stc-header {
  padding: 0.5rem 0;
}

.stc-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--stc-apple-text);
  margin: 0;
}

.stc-subtitle {
  color: var(--stc-apple-muted);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-top: 2px;
}

.stc-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--stc-apple-muted);
  margin-bottom: 4px;
}

/* =========================================
   ۶. کپسول تب‌ها (SEGMENTED CONTROLS)
========================================= */
.stc-tabs-wrapper {
  overflow-x: auto;
  padding: 4px;
  background: #ececf1;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 14px;
  -webkit-overflow-scrolling: touch;
}

#stc-app .stc-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  padding: 0;
  margin: 0;
  width: max-content;
}

.stc-tab-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}

#stc-app .stc-tab-btn,
.stc-real-tab {
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #000000;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--stc-transition);
}

#stc-app .stc-tab-btn.active,
.stc-real-tab.active {
  background: var(--stc-apple-card) !important;
  color: var(--stc-apple-text) !important;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 16px rgba(0, 0, 0, 0.05);
}

.stc-add-tab {
  color: var(--stc-apple-blue) !important;
  font-size: 1.3rem !important;
  font-weight: 400 !important;
  padding: 4px 16px !important;
}

#stc-app .stc-tab-content {
  position: relative;
}
#stc-app .stc-tab-pane {
  display: none;
}
#stc-app .stc-tab-pane.stc-active {
  display: block;
}

/* =========================================
   ۷. کارت‌های یکپارچه و تمیز (IOS CLEAN CARDS)
========================================= */
.stc-main-card,
.stc-chart-card,
.stc-products-card,
.stc-glass-card {
  background: rgba(255, 255, 255, 0.82);
  border-radius: var(--stc-radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 8px 24px rgba(0, 0, 0, 0.04);
  padding: 24px;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.stc-main-card:hover,
.stc-chart-card:hover,
.stc-products-card:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04), 0 18px 40px rgba(0, 0, 0, 0.06);
}
.stc-control-card {
  background: #f7f7fa;
  border: none;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.stc-control-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

/* =========================================
   ۸. فرم‌ها و فیلدهای ورودی (IOS DESIGN INPUTS)
========================================= */
.stc-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: #3a3a3c;
}

.stc-calculator .form-control,
.stc-calculator .form-select,
.stc-select,
.stc-input,
.stc-tension-output,
.stc-total-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--stc-radius-md) !important;
  border: none;
  min-height: 40px;
  background: #f2f2f7;
  border: none;
  font-size: 0.95rem;
  color: var(--stc-apple-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.stc-select:hover,
.stc-input:hover {
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}
/* استایل آیکون فلش برای سلکت باکس‌های بومی بدون بوت‌استرپ */
.stc-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 32px;
}

.stc-calculator .form-control:focus,
.stc-calculator .form-select:focus,
.stc-select:focus,
.stc-input:focus {
  background: #ffffff;
  border-color: rgba(var(--stc-apple-blue-rgb), 0.25);
  box-shadow: 0 0 0 4px rgba(var(--stc-apple-blue-rgb), 0.12);
}

/* سیستم ادغام پسوند در ورودی (iOS Input Groups) */
.stc-input-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.stc-input-group .stc-input,
.stc-input-group .stc-tension-output {
  padding-right: 42px; /* فضای باز برای پسوند ثابت */
}

.stc-tension-output {
  font-weight: 700;
  color: var(--stc-apple-blue);
}

.stc-addon {
  position: absolute;
  right: 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--stc-apple-muted);
  pointer-events: none;
}

/* کپسول‌های دکمه انتخابی رادیویی */
.stc-ios-switch {
  display: inline-flex;
  background: #ececf1;
  padding: 4px;
  border-radius: 14px;
  border: none;
}

.stc-ios-switch .btn.active,
.ScaleModeGroup label.active,
.TensionUnitGroup label.active,
.LengthUnitGroup label.active {
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 6px 14px rgba(0, 0, 0, 0.06);
}

.stc-ios-switch .btn,
.ScaleModeGroup .btn,
.TensionUnitGroup .btn,
.LengthUnitGroup .btn {
  border: none !important;
  border-radius: calc(var(--stc-radius-md) - 2px) !important;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--stc-apple-text);
  background: transparent;
  cursor: pointer;
  transition: var(--stc-transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stc-ios-switch .btn.active,
.ScaleModeGroup label.active,
.TensionUnitGroup label.active,
.LengthUnitGroup label.active {
  background: var(--stc-apple-card) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  font-weight: 600;
}

/* =========================================
   ۹. جداول مدرن خطی (BORDERLESS TABLES)
========================================= */
.stc-table,
.stc-table tbody,
.stc-table tr,
.stc-table td {
  display: block;
}

.stc-table thead {
  display: none;
}

.stc-table-card {
  border-radius: var(--stc-radius-md);
  background: transparent;
  box-shadow: none;
  margin-top: 1.5rem;
}

.stc-table-header {
  padding: 16px 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.stc-table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stc-table {
  width: 100%;
  border-collapse: collapse;
}

.stc-table thead th {
  background: transparent;
  color: #8e8e93;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.stc-calculator tbody {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stc-calculator tbody tr {
  display: grid;
  grid-template-columns:
    48px
    1fr
    auto;
  gap: 12px;
  align-items: center;
  background: #ffffff;
  border: none;
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
  transition: background 0.2s ease, transform 0.2s ease;
}

.stc-calculator tbody tr:hover {
  background: #fafafb;
  transform: scale(1.002);
}

.stc-calculator tbody td {
  padding: 0;
  border: none;
  vertical-align: middle;
  text-align: center;
}

.stc-string-pill {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(var(--stc-apple-blue-rgb), 0.1);
  color: var(--stc-apple-blue);
  font-weight: 600;
  font-size: 0.85rem;
}
/* =========================
   IOS STRING CARDS
========================= */

.stc-string-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stc-string-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 18px;
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
}

.stc-string-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.stc-string-title {
  font-weight: 600;
  font-size: 1rem;
  flex: 1;
}

.stc-string-tension {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stc-string-tension .stc-tension-output {
  width: 90px;
  text-align: right;
  font-weight: 700;
  color: var(--stc-apple-blue);
}

.stc-string-card-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
/* =========================================
   ۱۰. دکمه حذف و مکانیسم تب‌ها (INTERACTIONS)
========================================= */
.stc-close-tab {
  position: absolute;
  top: -6px;
  right: -6px; /* به جای left */
  width: 22px;
  height: 22px;
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.9);
  border: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  z-index: 20;

  transform: scale(1);
  transition: transform 0.2s ease, opacity 0.2s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.stc-close-tab:hover {
  transform: scale(1.12);
}
.stc-close-tab .icon {
  font-size: 11px;
  color: #6b7280;
  line-height: 1;
}
.stc-close-tab svg {
  position: absolute;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.stc-close-tab circle {
  fill: none;
  stroke-width: 2.5;
  stroke: var(--tab-color);
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset linear;
}
.stc-close-disabled {
  display: none !important;
}

.stc-tab-item.stc-tab-deleting {
  opacity: 0.4;
  transform: scale(0.95);
  transition: var(--stc-transition);
}

/* حالت حذف (fade out نرم iOS) */
.stc-tab-item.stc-tab-deleting .stc-close-tab {
  opacity: 0;
  transform: scale(0.6);
}
/* ==========================
   IOS CHART CARDS
========================== */

.stc-chart-card {
  background: rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  padding: 20px;
  margin-top: 20px;

  border: 1px solid rgba(0, 0, 0, 0.05);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 10px 30px rgba(0, 0, 0, 0.05);
}

.stc-chart-header {
  margin-bottom: 18px;
}

.stc-chart-wrapper {
  position: relative;
  width: 100%;
  height: 320px;

  background: #fafafb;

  border-radius: 18px;

  padding: 14px;
}
.stc-chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.TensionDAW,
.TotalTensionDAW {
  border: 1px solid rgba(0, 0, 0, 0.04);
}

@media (max-width: 768px) {
  .stc-chart-wrapper {
    height: 260px;
  }
}

/* =========================
   BALANCE METER
========================= */
.stc-balance-category {
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stc-balance-cv {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--stc-apple-muted);
}

.BalanceCVValue {
  font-weight: 700;
  color: var(--stc-apple-text);
}

.stc-balance-meter-wrap {
  position: relative;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.BalanceMeterCanvas {
  width: 100%;
  height: 100%;
}

.stc-balance-score {
  position: absolute;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--stc-apple-blue);
  text-align: center;
}

.stc-balance-score span {
  display: block;
}

.BalanceScoreValue {
  font-size: 3rem;
}

.stc-daw-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stc-daw-score {
  text-align: center;
}

.daw-score-value {
  font-size: 3rem;
  font-weight: 800;
  color: var(--stc-apple-blue);
}

.daw-score-label {
  font-size: 0.75rem;
  color: var(--stc-apple-muted);
  letter-spacing: 0.2em;
}

.stc-daw-metrics {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #555;
}

.DawSpectrumCanvas {
  width: 100%;
  height: 120px;
}

.stc-balance-meter-wrap {
  position: relative;
  height: 240px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.BalanceMeterCanvas {
  width: 100%;
  height: 100%;
}

.stc-balance-center {
  position: absolute;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  transform: translateY(10px);
}

.stc-balance-score {
  line-height: 1;
}

.BalanceScoreValue {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.05em;

  color: var(--stc-apple-blue);
}

.stc-balance-status {
  margin-top: 6px;

  font-size: 0.95rem;
  font-weight: 600;
}

.stc-balance-description {
  margin-top: -8px;

  text-align: center;

  font-size: 0.92rem;

  color: var(--stc-apple-muted);

  line-height: 1.5;

  max-width: 420px;

  margin-left: auto;
  margin-right: auto;
}

.stc-balance-footer {
  margin-top: 20px;

  display: flex;
  justify-content: center;
  gap: 24px;
}

.stc-balance-metric {
  min-width: 90px;

  text-align: center;

  background: #f7f7fa;

  border-radius: 16px;

  padding: 12px;
}

.stc-balance-metric-value {
  font-size: 1.15rem;
  font-weight: 700;
}

.stc-balance-metric-label {
  margin-top: 2px;

  font-size: 0.75rem;

  color: var(--stc-apple-muted);

  text-transform: uppercase;

  letter-spacing: 0.08em;
}

/* STATUS COLORS */

.balance-perfect {
  color: #30d158;
}

.balance-excellent {
  color: #30d158;
}

.balance-very-good {
  color: #34c759;
}

.balance-good {
  color: #ffd60a;
}

.balance-fair {
  color: #ff9f0a;
}

.balance-poor {
  color: #ff453a;
}

.balance-critical {
  color: #ff3b30;
}

.stc-balance-metrics {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.stc-metric-card {
  flex: 1;
  padding: 14px;
  border-radius: 18px;

  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(20px);

  border: 1px solid rgba(255, 255, 255, 0.5);

  text-align: center;
}

.stc-metric-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.stc-metric-value {
  margin-top: 6px;

  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
/* ==========================
   BALANCE CARD
========================== */

.stc-balance-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.stc-balance-ring-wrap {
  position: relative;
  width: 240px;
  height: 240px;
}

.BalanceMeterCanvas {
  width: 100%;
  height: 100%;
}

.stc-balance-center {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.BalanceScoreValue {
  font-size: 3.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stc-balance-unit {
  font-size: 0.95rem;
  color: var(--stc-apple-muted);
}

.stc-balance-info {
  text-align: center;
}

.stc-balance-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 110px;

  padding: 8px 14px;

  border-radius: 999px;

  font-size: 0.82rem;
  font-weight: 700;

  margin-bottom: 8px;
}

.stc-balance-description {
  color: var(--stc-apple-muted);
  font-size: 0.85rem;
}

.stc-balance-scale {
  width: 100%;
  max-width: 320px;
}

.stc-balance-track {
  position: relative;
  height: 8px;
  border-radius: 999px;

  background: linear-gradient(
    90deg,
    #ef4444 0%,
    #f97316 25%,
    #facc15 50%,
    #84cc16 75%,
    #10b981 100%
  );
}

.stc-balance-marker {
  position: absolute;
  top: 50%;

  width: 18px;
  height: 18px;

  border-radius: 50%;
  background: white;

  border: 3px solid currentColor;

  transform: translate(-50%, -50%);

  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.stc-balance-scale-labels {
  display: flex;
  justify-content: space-between;

  margin-top: 8px;

  font-size: 0.68rem;
  color: var(--stc-apple-muted);
}

/* =========================================
   ۱۱. کنترلرهای وضعیت لایو و دکمه‌های بالا (WIDGETS)
========================================= */
.stc-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stc-section-subtitle {
  font-size: 0.85rem;
  color: var(--stc-apple-muted);
  margin-top: 2px;
}

.stc-badge-live {
  background: rgba(255, 59, 48, 0.08);
  color: #ff3b30;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 59, 48, 0.12);
  font-weight: 600;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0.05em;
}

.stc-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b30;
  margin-right: 6px;
  animation: stcPulse 1.8s ease-in-out infinite;
}

/* دکمه‌های اکشن بالا سبک دایره‌ای متالیک کم‌رنگ اپل */
.stc-live-buttons {
  display: flex;
  gap: 0.4rem;
}

.stc-live-buttons button {
  background: #f7f7fa;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 50%;
  background-color: var(--stc-apple-gray-input);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--stc-transition);
  font-size: 0.95rem;
}

.stc-live-buttons button:hover:not(:disabled) {
  background: #ffffff;
  transform: translateY(-1px);
}

.stc-live-buttons button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* افکت تولتیپ بومی */
.stc-live-buttons button[title]::after {
  content: attr(title);
  position: absolute;
  top: -30px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.stc-live-buttons button:hover::after {
  opacity: 1;
}

/* =========================================
   محصولاتِ پیشنهادی — کاروسلِ سبکِ ووکامرس
========================================= */

.stc-carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stc-products-grid {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 2px 10px;
  flex: 1;
  min-width: 0;

  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;
}

.stc-products-grid::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.stc-product-card {
  flex: 0 0 auto;
  width: 220px;
  scroll-snap-align: start;

  display: flex;
  flex-direction: column;

  background: var(--stc-apple-card);
  border-radius: var(--stc-radius-md);
  border: 1px solid var(--stc-apple-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 6px 16px rgba(0, 0, 0, 0.04);
  overflow: hidden;

  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.stc-product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05), 0 14px 28px rgba(0, 0, 0, 0.07);
}

.stc-product-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: var(--stc-apple-gray-input);
  overflow: hidden;
}

.stc-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.stc-product-card:hover .stc-product-thumb img {
  transform: scale(1.05);
}

.stc-product-info {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stc-product-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--stc-apple-text);
  text-decoration: none;
  line-height: 1.3;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2em;
}

.stc-product-title:hover {
  color: var(--stc-apple-blue);
}

/* قیمتِ استاندارد ووکامرس (شامل حالتِ فروش ویژه با del/ins) */
.stc-product-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--stc-apple-text);
}

.stc-product-price del {
  font-weight: 400;
  color: var(--stc-apple-muted);
  text-decoration: line-through;
  margin-inline-end: 6px;
  font-size: 0.8em;
}

.stc-product-price ins {
  text-decoration: none;
  color: var(--stc-apple-red);
}

.stc-product-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.stc-product-add-cart {
  flex: 1;
  text-align: center;
  border-radius: var(--stc-radius-sm);
  background: var(--stc-apple-blue);
  color: #fff;
  border: none;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.2s;
}

.stc-product-add-cart:hover {
  filter: brightness(1.08);
  color: #fff;
}

.stc-product-view {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--stc-apple-muted);
  text-decoration: none;
  padding: 8px 4px;
}

.stc-product-view:hover {
  color: var(--stc-apple-blue);
}

/* دکمه‌های ناوبریِ چپ/راست، شناور روی لبه‌ی کاروسل */
.stc-carousel-arrow {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--stc-apple-border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  color: var(--stc-apple-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: 0.2s ease;
  z-index: 1;
}

.stc-carousel-arrow:hover {
  background: var(--stc-apple-blue);
  color: #fff;
  border-color: var(--stc-apple-blue);
}

.stc-carousel-arrow.stc-hidden {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

/* نقاطِ صفحه زیرِ کاروسل */
.stc-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.stc-carousel-dots.stc-hidden {
  display: none;
}

.stc-carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--stc-apple-border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: 0.2s ease;
}

.stc-carousel-dot.stc-active {
  background: var(--stc-apple-blue);
  width: 16px;
  border-radius: 3px;
}

@media (max-width: 640px) {
  .stc-product-card {
    width: 168px;
  }
  .stc-carousel-arrow {
    width: 28px;
    height: 28px;
  }
}

/* =========================================
   ۱۲. محاسبات نهایی فوتر و سیستم اعلان (FOOTER & TOAST)
========================================= */
.stc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.stc-total-card {
  background: #fafafb;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 20px;
  padding: 18px;
  flex: 1;
  max-width: 300px;
}

.stc-total-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--stc-apple-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
  text-align: right;
  margin-right: 30px;
}

.stc-total-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.TotalTensionDAW {
  position: relative;
  height: 260px;
  width: 100%;
  height: 260px;
}
.TotalTensionDAW canvas {
  width: 100% !important;
  height: 100% !important;
}

.stc-total-input,
.TotalTension {
  font-size: 1.8rem !important;
  font-weight: 700;
  color: var(--stc-apple-blue);
  background: transparent !important;
  padding: 3px 0 !important;
  margin: 3px 10px !important;
  min-height: auto !important;
  text-align: right;
  border: none !important;
}

.stc-total-unit {
  margin-left: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--stc-apple-muted);
}

.totalScaleUnit {
  margin-right: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--stc-apple-muted);
}

.totalslash {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--stc-apple-muted);
}

/* اعلان شناور سیستم‌عامل */
#stc-toast,
.stc-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(0, 0, 0, 0.88);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  z-index: 99999;
}

#stc-toast.show,
.stc-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* =========================================
   ۱۳. انیمیشن‌ها (SYSTEM ANIMATIONS)
========================================= */
@keyframes stcPulse {
  0% {
    opacity: 0.4;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
  100% {
    opacity: 0.4;
    transform: scale(0.9);
  }
}

/* =========================================
   ۱۴. سازگاری کامل لایه‌ها با موبایل (RESPONSIVE RULES)
========================================= */
@media (max-width: 768px) {
  .stc-main-card,
  .stc-chart-card,
  .stc-products-card,
  .stc-glass-card {
    padding: 16px;
    border-radius: 20px;
  }
  .stc-control-card {
    border-radius: 16px;
  }
  .stc-title {
    font-size: 1.6rem;
  }
  .stc-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .stc-table thead {
    display: none;
  }

  .stc-calculator tbody tr {
    display: block;
    margin-bottom: 12px;
    border-radius: var(--stc-radius-md);
    background: var(--stc-apple-gray-input);
    padding: 10px;
  }

  .stc-calculator tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    border: none;
  }

  .stc-calculator tbody td::before {
    content: attr(data-label);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--stc-apple-muted);
  }
  .stc-chart-wrapper {
    height: 260px;
  }
}
.stc-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.stc-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 768px) {
  .stc-two-col,
  .stc-charts-grid {
    grid-template-columns: 1fr;
  }
}
.stc-hidden {
  display: none;
}
/* =========================
   IOS MODAL SYSTEM (STC)
========================= */

.stc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  opacity: 0;
  pointer-events: none;

  transition: opacity 0.25s ease;
}

.stc-modal-overlay.stc-active {
  opacity: 1;
  pointer-events: auto;
}

/* خود کارت مودال */
.stc-modal {
  width: min(520px, 92vw);

  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);

  border-radius: 22px;
  border: 1px solid rgba(0, 0, 0, 0.06);

  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);

  transform: translateY(20px) scale(0.98);
  opacity: 0;

  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);

  overflow: hidden;
}

.stc-modal-overlay.stc-active .stc-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* هدر مودال */
.stc-modal-header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.stc-modal-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* دکمه بستن */
.stc-modal-close {
  width: 34px;
  height: 34px;

  border-radius: 999px;
  border: none;

  background: #f2f2f7;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: 0.2s ease;
}

.stc-modal-close:hover {
  background: #e5e5ea;
  transform: scale(1.05);
}

/* بدنه */
.stc-modal-body {
  padding: 16px 18px;
  max-height: 60vh;
  overflow-y: auto;
}

/* فوتر */
.stc-modal-footer {
  padding: 14px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;

  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* لیست سیو شده‌ها */
.stc-saved-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stc-saved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 12px 14px;

  border-radius: 14px;
  background: #f7f7fa;

  transition: 0.2s ease;
}

.stc-saved-item:hover {
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.stc-saved-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.stc-load-item {
  border: none;
  background: var(--stc-apple-blue);
  color: white;

  padding: 6px 12px;
  border-radius: 10px;

  cursor: pointer;
  font-size: 0.8rem;
}

.stc-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stc-item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stc-saved-date {
  font-size: 0.72rem;
  color: var(--stc-apple-muted);
}

.stc-update-item {
  border: none;
  background: var(--stc-apple-gray-input);
  color: var(--stc-apple-text);

  padding: 6px 12px;
  border-radius: 10px;

  cursor: pointer;
  font-size: 0.8rem;
}

.stc-update-item:hover {
  background: rgba(var(--stc-apple-blue-rgb), 0.12);
  color: var(--stc-apple-blue);
}

.stc-delete-item {
  border: none;
  background: transparent;
  color: var(--stc-apple-red);

  width: 30px;
  height: 30px;
  border-radius: 10px;

  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stc-delete-item:hover {
  background: rgba(var(--stc-apple-red-rgb), 0.12);
}

.stc-share-link-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.stc-share-link {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--stc-apple-border);
  background: var(--stc-apple-gray-input);
  color: var(--stc-apple-text);
  font-size: 0.85rem;
}

.stc-btn {
  border: none;
  border-radius: var(--stc-radius-md);
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--stc-transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none !important;
  white-space: nowrap;
}

.stc-btn-primary {
  background: var(--stc-apple-blue);
  color: #fff;
}

.stc-btn-primary:hover {
  background: #0064d1;
}

.stc-btn-secondary {
  background: var(--stc-apple-gray-input);
  color: var(--stc-apple-text);
}

.stc-btn-secondary:hover {
  background: #ececf1;
}

.stc-btn-native-share {
  width: 100%;
  margin-bottom: 18px;
  padding: 12px 16px;
}

.stc-qr-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}

.stc-share-qr-canvas {
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  max-width: 100%;
}

.stc-share-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.stc-share-actions .stc-btn,
.stc-share-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  font-size: 0.78rem;
}
