
    #breakeven-calculator {
      font-family: 'Segoe UI', Tahoma, Geneva, Vazir, sans-serif;
      max-width: 860px;
      margin: 40px auto;
      background: #ffffff;
      border-radius: 20px;
      box-shadow: 0 10px 60px rgba(0,0,0,0.12);
      overflow: hidden;
    }

    /* ===== HEADER ===== */
    .bec-header {
      background: linear-gradient(135deg, #1a3c5e 0%, #2d6a9f 100%);
      padding: 30px 35px;
      text-align: center;
      position: relative;
    }
    .bec-header::after {
      content: '';
      position: absolute;
      bottom: -1px;
      left: 0;
      right: 0;
      height: 30px;
      background: #ffffff;
      border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    }
    .bec-header h2 {
      color: #ffffff;
      margin: 0 0 6px 0;
      font-size: 1.6rem;
      font-weight: 700;
      letter-spacing: -0.5px;
    }
    .bec-header p {
      color: rgba(255,255,255,0.8);
      margin: 0;
      font-size: 0.92rem;
    }
    .bec-header-icon {
      font-size: 2.4rem;
      margin-bottom: 10px;
      display: block;
    }

    /* ===== TABS ===== */
    .bec-tabs {
      display: flex;
      padding: 20px 35px 0;
      gap: 8px;
      border-bottom: 2px solid #f0f4f8;
      margin-bottom: 0;
    }
    .bec-tab {
      padding: 10px 20px;
      border-radius: 10px 10px 0 0;
      border: none;
      cursor: pointer;
      font-size: 0.88rem;
      font-weight: 600;
      transition: all 0.25s;
      background: #f0f4f8;
      color: #64748b;
      font-family: inherit;
    }
    .bec-tab.active {
      background: #2d6a9f;
      color: #ffffff;
    }
    .bec-tab:hover:not(.active) {
      background: #dde8f5;
      color: #2d6a9f;
    }

    /* ===== BODY ===== */
    .bec-body {
      padding: 30px 35px;
    }

    /* ===== TAB PANELS ===== */
    .bec-panel { display: none; }
    .bec-panel.active { display: block; }

    /* ===== INPUT GRID ===== */
    .bec-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 18px;
      margin-bottom: 22px;
    }
    @media(max-width: 600px) {
      .bec-grid { grid-template-columns: 1fr; }
      .bec-body { padding: 20px 18px; }
      .bec-tabs { padding: 16px 18px 0; }
      .bec-header { padding: 24px 18px; }
    }

    .bec-field {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .bec-field.full-width {
      grid-column: 1 / -1;
    }
    .bec-field label {
      font-size: 0.84rem;
      font-weight: 600;
      color: #374151;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .bec-field label .badge {
      font-size: 0.7rem;
      padding: 2px 7px;
      border-radius: 20px;
      font-weight: 500;
    }
    .badge-fixed {
      background: #fff3cd;
      color: #856404;
    }
    .badge-var {
      background: #d1fae5;
      color: #065f46;
    }
    .bec-field label .tip {
      font-size: 0.75rem;
      color: #94a3b8;
      font-weight: 400;
      margin-right: 2px;
      cursor: help;
      position: relative;
    }
    .bec-field label .tip:hover::after {
      content: attr(data-tip);
      position: absolute;
      top: 22px;
      right: 0;
      background: #1e293b;
      color: #fff;
      padding: 6px 10px;
      border-radius: 8px;
      font-size: 0.78rem;
      white-space: nowrap;
      z-index: 10;
      max-width: 220px;
      white-space: normal;
      width: 200px;
      line-height: 1.5;
      font-weight: 400;
    }

    .bec-input-wrap {
      position: relative;
    }
    .bec-input-wrap input {
      width: 100%;
      padding: 11px 14px 11px 70px;
      border: 1.5px solid #e2e8f0;
      border-radius: 10px;
      font-size: 1rem;
      font-family: inherit;
      color: #1e293b;
      background: #f8fafc;
      transition: border-color 0.2s, box-shadow 0.2s;
      box-sizing: border-box;
      text-align: left;
      direction: ltr;
    }
    .bec-input-wrap input:focus {
      outline: none;
      border-color: #2d6a9f;
      box-shadow: 0 0 0 3px rgba(45,106,159,0.15);
      background: #fff;
    }
    .bec-input-wrap input.error {
      border-color: #ef4444;
      box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
    }
    .bec-input-unit {
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      display: flex;
      align-items: center;
      padding: 0 12px;
      background: #e2e8f0;
      border-radius: 0 10px 10px 0;
      font-size: 0.8rem;
      color: #64748b;
      font-weight: 600;
      pointer-events: none;
      border: 1.5px solid #e2e8f0;
      border-right: none;
    }
    .bec-error-msg {
      color: #ef4444;
      font-size: 0.78rem;
      min-height: 16px;
      display: block;
    }

    /* ===== RANGE SLIDER ===== */
    .bec-slider-wrap {
      padding: 4px 0 0;
    }
    .bec-slider-wrap input[type="range"] {
      width: 100%;
      accent-color: #2d6a9f;
      cursor: pointer;
    }
    .bec-slider-labels {
      display: flex;
      justify-content: space-between;
      font-size: 0.75rem;
      color: #94a3b8;
      margin-top: 2px;
    }

    /* ===== CALCULATE BUTTON ===== */
    .bec-btn {
      width: 100%;
      padding: 14px;
      background: linear-gradient(135deg, #1a3c5e, #2d6a9f);
      color: #fff;
      border: none;
      border-radius: 12px;
      font-size: 1.05rem;
      font-weight: 700;
      cursor: pointer;
      transition: transform 0.15s, box-shadow 0.15s;
      font-family: inherit;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      margin-top: 6px;
    }
    .bec-btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 8px 25px rgba(45,106,159,0.35);
    }
    .bec-btn:active {
      transform: translateY(0);
    }
    .bec-btn-reset {
      background: transparent;
      color: #64748b;
      border: 1.5px solid #e2e8f0;
      padding: 10px;
      border-radius: 10px;
      font-size: 0.88rem;
      cursor: pointer;
      font-family: inherit;
      font-weight: 600;
      transition: all 0.2s;
      width: 100%;
      margin-top: 8px;
    }
    .bec-btn-reset:hover {
      background: #f1f5f9;
      border-color: #cbd5e1;
    }

    /* ===== RESULTS ===== */
    .bec-results {
      display: none;
      margin-top: 28px;
      animation: fadeUp 0.4s ease;
    }
    .bec-results.visible { display: block; }

    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(16px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .bec-results-title {
      font-size: 0.88rem;
      font-weight: 700;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 1px;
      margin-bottom: 14px;
      padding-bottom: 8px;
      border-bottom: 2px solid #f0f4f8;
    }

    .bec-cards {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
      margin-bottom: 20px;
    }
    @media(max-width: 500px) {
      .bec-cards { grid-template-columns: 1fr; }
    }

    .bec-card {
      background: #f8fafc;
      border-radius: 14px;
      padding: 18px 16px;
      border: 1.5px solid #e2e8f0;
      text-align: center;
      transition: box-shadow 0.2s;
    }
    .bec-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.07); }
    .bec-card.highlight {
      background: linear-gradient(135deg, #1a3c5e, #2d6a9f);
      border-color: transparent;
    }
    .bec-card .card-icon { font-size: 1.6rem; margin-bottom: 8px; }
    .bec-card .card-label {
      font-size: 0.78rem;
      color: #94a3b8;
      font-weight: 600;
      margin-bottom: 6px;
    }
    .bec-card.highlight .card-label { color: rgba(255,255,255,0.75); }
    .bec-card .card-value {
      font-size: 1.55rem;
      font-weight: 800;
      color: #1e293b;
      direction: ltr;
    }
    .bec-card.highlight .card-value { color: #ffffff; }
    .bec-card .card-sub {
      font-size: 0.76rem;
      color: #94a3b8;
      margin-top: 4px;
    }
    .bec-card.highlight .card-sub { color: rgba(255,255,255,0.65); }

    /* Safety margin bar */
    .bec-safety {
      background: #f8fafc;
      border-radius: 14px;
      padding: 18px 20px;
      border: 1.5px solid #e2e8f0;
      margin-bottom: 16px;
    }
    .bec-safety-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 10px;
    }
    .bec-safety-head span:first-child {
      font-size: 0.84rem;
      font-weight: 700;
      color: #374151;
    }
    .bec-safety-head span:last-child {
      font-size: 1rem;
      font-weight: 800;
      color: #2d6a9f;
    }
    .bec-progress-bg {
      background: #e2e8f0;
      border-radius: 99px;
      height: 10px;
      overflow: hidden;
    }
    .bec-progress-fill {
      height: 100%;
      border-radius: 99px;
      transition: width 0.8s cubic-bezier(.4,0,.2,1);
    }
    .bec-progress-labels {
      display: flex;
      justify-content: space-between;
      font-size: 0.73rem;
      color: #94a3b8;
      margin-top: 5px;
    }

    /* Scenario Table */
    .bec-scenario {
      background: #f8fafc;
      border-radius: 14px;
      border: 1.5px solid #e2e8f0;
      overflow: hidden;
      margin-bottom: 16px;
    }
    .bec-scenario-title {
      padding: 12px 16px;
      font-size: 0.82rem;
      font-weight: 700;
      color: #374151;
      border-bottom: 1px solid #e2e8f0;
      background: #f1f5f9;
    }
    .bec-scenario table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.82rem;
    }
    .bec-scenario thead th {
      padding: 9px 14px;
      text-align: center;
      color: #64748b;
      font-weight: 600;
      background: #f1f5f9;
      font-size: 0.78rem;
    }
    .bec-scenario tbody td {
      padding: 8px 14px;
      text-align: center;
      color: #374151;
      border-top: 1px solid #f0f4f8;
    }
    .bec-scenario tbody tr.current-row {
      background: #dbeafe;
      font-weight: 700;
    }
    .bec-scenario tbody tr:hover:not(.current-row) {
      background: #f8fafc;
    }
    .bec-scenario .profit { color: #059669; font-weight: 700; }
    .bec-scenario .loss { color: #dc2626; font-weight: 700; }
    .bec-scenario .zero { color: #d97706; font-weight: 700; }

    /* ===== CHART ===== */
    .bec-chart-wrap {
      background: #f8fafc;
      border-radius: 14px;
      border: 1.5px solid #e2e8f0;
      padding: 16px;
      margin-bottom: 16px;
    }
    .bec-chart-title {
      font-size: 0.82rem;
      font-weight: 700;
      color: #374151;
      margin-bottom: 12px;
      text-align: center;
    }
    #beChart {
      width: 100%;
      height: 240px;
    }

    /* ===== FORMULA BOX ===== */
    .bec-formula {
      background: #fff7ed;
      border: 1.5px solid #fed7aa;
      border-radius: 12px;
      padding: 14px 18px;
      font-size: 0.82rem;
      color: #7c2d12;
      line-height: 1.8;
    }
    .bec-formula strong { color: #c2410c; }
    .bec-formula .formula-line {
      background: #fff;
      border-radius: 8px;
      padding: 6px 12px;
      margin: 6px 0;
      border-right: 3px solid #fb923c;
      direction: ltr;
      text-align: left;
      font-family: monospace;
      font-size: 0.9rem;
    }

    /* ===== DISCLAIMER ===== */
    .bec-disclaimer {
      font-size: 0.75rem;
      color: #94a3b8;
      text-align: center;
      margin-top: 20px;
      padding: 12px;
      background: #f8fafc;
      border-radius: 10px;
      line-height: 1.6;
    }
  