/* ============================================
   THAI BIOMASS - calculator page styles
   Extracted from inline <style> so the browser can cache it.
============================================ */

    /* ===== CALCULATOR PAGE STYLES ===== */
    .calc-wrapper {
      padding-top: 72px;
      min-height: 100vh;
    }

    .calc-page-hero {
      background: var(--gradient-hero);
      padding: 4rem 0 3rem;
      text-align: center;
      border-bottom: 1px solid var(--border);
      position: relative;
      overflow: hidden;
      transition: background 0.4s ease;
    }

    .calc-page-hero::before {
      content: '';
      position: absolute;
      top: -50%;
      left: 50%;
      transform: translateX(-50%);
      width: 900px;
      height: 900px;
      background: radial-gradient(circle, rgba(46,232,165,0.05) 0%, transparent 70%);
    }

    .calc-main {
      padding: 4rem 0 6rem;
    }

    .calc-layout {
      display: grid;
      grid-template-columns: 1fr 1.2fr;
      gap: 2.5rem;
      align-items: start;
    }

    /* ===== INPUT PANEL ===== */
    .calc-input-panel {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 2rem;
      width: 100%;
      box-sizing: border-box;
      transition: background 0.4s ease, border-color 0.4s ease;
    }

    .panel-title {
      font-size: 1.1rem;
      font-weight: 700;
      margin-bottom: 1.5rem;
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .panel-title i {
      color: var(--primary);
    }

    .fuel-selector {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 0.75rem;
      margin-bottom: 1.5rem;
    }

    .fuel-option {
      background: var(--bg-page);
      border: 2px solid var(--border);
      border-radius: 12px;
      padding: 0.85rem;
      text-align: center;
      cursor: pointer;
      transition: var(--transition);
    }

    .fuel-option:hover {
      border-color: rgba(46, 232, 165, 0.4);
    }

    .fuel-option.selected {
      border-color: var(--primary);
      background: var(--primary-glow);
    }

    .fuel-option i {
      font-size: 1.5rem;
      display: block;
      margin-bottom: 0.4rem;
      color: var(--text-muted);
      transition: var(--transition);
    }

    .fuel-option.selected i {
      color: var(--primary);
    }

    .fuel-option span {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--text-light);
      display: block;
    }

    .fuel-option small {
      font-size: 0.7rem;
      color: var(--text-muted);
    }

    .range-group {
      margin-bottom: 1.5rem;
    }

    .range-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.5rem;
    }

    .range-header label {
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--text-light);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .range-value {
      font-size: 1rem;
      font-weight: 700;
      color: var(--primary);
      min-width: 80px;
      text-align: right;
    }

    input[type="range"] {
      width: 100%;
      appearance: none;
      height: 6px;
      border-radius: 3px;
      background: var(--border-light);
      outline: none;
      cursor: pointer;
    }

    input[type="range"]::-webkit-slider-thumb {
      appearance: none;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: var(--gradient-primary);
      cursor: pointer;
      box-shadow: 0 2px 8px rgba(46,232,165,0.4);
      transition: var(--transition);
    }

    input[type="range"]::-webkit-slider-thumb:hover {
      transform: scale(1.2);
    }

    .range-sublabel {
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-top: 0.4rem;
    }

    .divider-line {
      border: none;
      border-top: 1px solid var(--border);
      margin: 1.5rem 0;
    }

    /* ---- Fuel price number input ---- */
    .price-input-group {
      margin-bottom: 1.5rem;
    }

    .price-input-row {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      background: var(--bg-page);
      border: 1px solid var(--border-light);
      border-radius: 10px;
      padding: 0.5rem 0.75rem;
      transition: border-color 0.2s ease;
    }

    .price-input-row:focus-within {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-glow);
    }

    .price-input-row .currency-sym {
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--text-muted);
      flex-shrink: 0;
    }

    .price-input-row input[type="number"] {
      flex: 1;
      border: none;
      background: transparent;
      outline: none;
      font-size: 1rem;
      font-weight: 700;
      color: var(--primary);
      font-family: 'Inter', sans-serif;
      width: 100%;
      min-width: 0;
    }

    .price-input-row .price-unit {
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--text-muted);
      flex-shrink: 0;
    }

    /* Unit selector inside the price input row */
    .price-input-row .price-unit-select {
      flex-shrink: 0;
      border: none;
      border-left: 1px solid var(--border);
      background: transparent;
      outline: none;
      font-family: 'Inter', sans-serif;
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--text-light);
      padding: 0.1rem 0.3rem 0.1rem 0.6rem;
      cursor: pointer;
    }

    .price-input-row .price-unit-select:focus {
      color: var(--primary);
    }

    /* Below-minimum consumption warning */
    .range-sublabel.warn {
      color: #D97706;
      font-weight: 600;
    }

    [data-theme="dark"] .range-sublabel.warn {
      color: #FBBF24;
    }

    .range-sublabel.warn i {
      margin-right: 0.3rem;
    }

    /* ---- PKS price info card ---- */
    .pks-price-card {
      background: var(--primary-glow);
      border: 1px solid rgba(46,232,165,0.3);
      border-radius: 12px;
      padding: 0.9rem 1.1rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      margin-bottom: 1.5rem;
      transition: background 0.4s ease, border-color 0.4s ease;
    }

    [data-theme="light"] .pks-price-card {
      border-color: rgba(0,168,112,0.3);
    }

    .pks-price-card .pks-price-left {
      display: flex;
      align-items: center;
      gap: 0.6rem;
    }

    .pks-price-card .pks-price-icon {
      font-size: 1.1rem;
      color: var(--primary);
    }

    .pks-price-card .pks-price-label {
      font-size: 0.72rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-muted);
      line-height: 1.2;
    }

    .pks-price-card .pks-price-val {
      font-size: 1.05rem;
      font-weight: 800;
      color: var(--primary);
      line-height: 1.2;
    }

    .pks-price-card .pks-price-updated {
      font-size: 0.7rem;
      color: var(--text-muted);
      text-align: right;
      white-space: nowrap;
    }

    /* Skeleton loader for PKS price card */
    .pks-price-skeleton {
      display: inline-block;
      width: 100px;
      height: 1em;
      border-radius: 4px;
      background: linear-gradient(90deg,
        var(--border-light) 25%,
        var(--border) 50%,
        var(--border-light) 75%);
      background-size: 200% 100%;
      animation: pks-shimmer 1.4s infinite;
      vertical-align: middle;
    }

    @keyframes pks-shimmer {
      0%   { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }

    .advanced-toggle {
      display: flex;
      align-items: center;
      justify-content: space-between;
      cursor: pointer;
      padding: 0.5rem 0;
      color: var(--text-light);
      font-size: 0.85rem;
      font-weight: 600;
    }

    .advanced-toggle i {
      color: var(--primary);
    }

    .advanced-toggle i.fa-chevron-down {
      transition: transform 0.3s;
    }

    .advanced-toggle.open i.fa-chevron-down {
      transform: rotate(180deg);
    }

    .advanced-inputs {
      display: none;
      margin-top: 1rem;
    }

    .advanced-inputs.open {
      display: block;
    }

    .advanced-grid-2 {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.75rem;
    }

    /* ===== CUSTOMIZE TOGGLE BUTTON ===== */
    .form-label-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 0.85rem;
    }

    .form-label-row .form-label {
      margin-bottom: 0; /* override default block margin */
    }

    .customize-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      padding: 0.3rem 0.75rem;
      border-radius: 999px;
      border: 1.5px solid var(--border-light);
      background: transparent;
      color: var(--text-muted);
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      cursor: pointer;
      transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
      font-family: 'Inter', sans-serif;
      white-space: nowrap;
    }

    .customize-btn i {
      font-size: 0.68rem;
      transition: transform 0.2s ease;
    }

    .customize-btn:hover {
      border-color: var(--primary);
      color: var(--primary);
    }

    .customize-btn.active {
      background: var(--primary-glow);
      border-color: var(--primary);
      color: var(--primary);
    }

    .customize-btn.active i.fa-sliders-h {
      transform: rotate(90deg);
    }

    .btn.is-loading,
    .customize-btn:disabled {
      opacity: 0.72;
      cursor: wait;
      pointer-events: none;
    }

    /* ===== CUSTOM FUEL INPUT BLOCK ===== */
    .custom-fuel-inputs {
      display: none;
      background: var(--bg-page);
      border: 1.5px solid rgba(46,232,165,0.25);
      border-radius: 12px;
      padding: 1rem 1.1rem 0.75rem;
      margin-bottom: 1.5rem;
      transition: border-color 0.2s ease;
    }

    .custom-fuel-inputs.visible {
      display: block;
    }

    .custom-fuel-inputs:focus-within {
      border-color: var(--primary);
    }

    .custom-fuel-header {
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--primary);
      margin-bottom: 0.75rem;
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }

    .custom-ncv-row {
      display: flex;
      flex-direction: column;
      gap: 0.3rem;
      margin-bottom: 0.75rem;
    }

    .custom-ncv-row label {
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--text-light);
    }

    .custom-ncv-input-wrap {
      display: flex;
      align-items: center;
      gap: 0.6rem;
      background: var(--bg-card);
      border: 1px solid var(--border-light);
      border-radius: 10px;
      padding: 0.5rem 0.75rem;
      transition: border-color 0.2s ease;
    }

    .custom-ncv-input-wrap:focus-within {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-glow);
    }

    .custom-ncv-input-wrap input[type="number"] {
      flex: 1;
      border: none;
      background: transparent;
      outline: none;
      font-size: 1rem;
      font-weight: 700;
      color: var(--primary);
      font-family: 'Inter', sans-serif;
      min-width: 0;
    }

    .custom-ncv-input-wrap .ncv-unit {
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--text-muted);
      flex-shrink: 0;
    }

    .custom-ncv-hint {
      font-size: 0.72rem;
      color: var(--text-muted);
      margin-top: 0.25rem;
    }

    /* Fuel selector hidden in custom mode */
    .fuel-selector.hidden-fuel {
      display: none;
    }

    /* ===== RESULTS PANEL ===== */
    .calc-results-panel {
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
      min-width: 0;
      width: 100%;
    }

    .result-hero-card {
      background: linear-gradient(135deg, rgba(46,232,165,0.1) 0%, rgba(56,189,248,0.06) 100%);
      border: 1px solid rgba(46, 232, 165, 0.3);
      border-radius: var(--radius-lg);
      padding: 2.5rem;
      text-align: center;
      position: relative;
      overflow: hidden;
    }

    .result-hero-card::before {
      content: '';
      position: absolute;
      top: -80px; right: -80px;
      width: 250px; height: 250px;
      background: radial-gradient(circle, rgba(46,232,165,0.1) 0%, transparent 70%);
    }

    .result-hero-card .result-label {
      font-size: 0.8rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      margin-bottom: 0.5rem;
    }

    .result-hero-card .result-amount {
      font-size: 3.5rem;
      font-weight: 900;
      background: var(--gradient-primary);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      line-height: 1;
      margin-bottom: 0.25rem;
    }

    .result-hero-card .result-sublabel {
      font-size: 0.9rem;
      color: var(--text-light);
    }

    .cofiring-badge {
      display: inline-block;
      font-size: 0.7rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: var(--primary);
      border: 1px solid rgba(46,232,165,0.4);
      border-radius: 999px;
      padding: 0.2em 0.8em;
      margin-bottom: 0.4rem;
      position: relative;
      z-index: 1;
    }

    .ncv-strip {
      display: flex;
      margin-top: 1.25rem;
      padding-top: 1rem;
      border-top: 1px solid var(--border);
      position: relative;
      z-index: 1;
    }

    .ncv-col {
      flex: 1;
      text-align: center;
      padding: 0 0.25rem;
    }

    .ncv-col + .ncv-col {
      border-left: 1px solid var(--border);
    }

    .ncv-val {
      font-size: 0.95rem;
      font-weight: 800;
      color: var(--text-light);
      margin-bottom: 0.3rem;
    }

    .ncv-col--base .ncv-val {
      font-size: 1.05rem;
      color: var(--primary);
    }

    .ncv-lbl {
      font-size: 0.62rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: var(--text-muted);
      line-height: 1.5;
    }

    .ncv-lbl span {
      display: block;
      font-size: 0.65rem;
      font-weight: 500;
      text-transform: none;
      letter-spacing: 0;
      color: var(--text-light);
    }

    .savings-band-line {
      display: none; /* replaced by .ncv-strip */
    }

    /* Carbon credit benefit line under the hero amount */
    .carbon-benefit-line {
      margin-top: 0.85rem;
      padding-top: 0.85rem;
      border-top: 1px dashed rgba(46,232,165,0.35);
      font-size: 0.85rem;
      color: var(--text-light);
      position: relative;
      z-index: 1;
    }

    .carbon-benefit-line i {
      color: var(--primary);
      margin-right: 0.35rem;
    }

    .carbon-benefit-line strong {
      color: var(--primary);
    }

    .result-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1rem;
    }

    .result-mini-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 1.25rem;
      text-align: center;
      transition: var(--transition);
    }

    .result-mini-card:hover {
      border-color: rgba(46,232,165,0.3);
    }

    .result-mini-card i {
      font-size: 1.5rem;
      margin-bottom: 0.5rem;
      display: block;
    }

    .result-mini-card .rmc-val {
      font-size: 1.4rem;
      font-weight: 800;
      color: var(--primary);
      line-height: 1;
      margin-bottom: 0.25rem;
    }

    .result-mini-card .rmc-lbl {
      font-size: 0.72rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .chart-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 2rem;
      transition: background 0.4s ease, border-color 0.4s ease;
    }

    .chart-card h3 {
      font-size: 1rem;
      font-weight: 700;
      margin-bottom: 1.5rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .chart-card h3 i {
      color: var(--primary);
    }

    .chart-container {
      position: relative;
      height: 260px;
    }

    .comparison-table-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 2rem;
    }

    .comparison-table-card h3 {
      font-size: 1rem;
      font-weight: 700;
      margin-bottom: 1.5rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .comparison-table-card h3 i {
      color: var(--primary);
    }

    /* ===== COLLAPSIBLE RESULT CARDS ===== */
    .collapsible-card > h3.card-toggle {
      cursor: pointer;
      user-select: none;
      outline: none;
    }

    .collapsible-card > h3.card-toggle:focus-visible {
      color: var(--primary);
    }

    .card-toggle .card-chevron {
      margin-left: auto;
      font-size: 0.8rem;
      transition: transform 0.3s;
      transform: rotate(180deg); /* expanded → points up */
    }

    .collapsible-card.collapsed > h3.card-toggle {
      margin-bottom: 0;
    }

    .collapsible-card.collapsed .card-chevron {
      transform: rotate(0deg); /* collapsed → points down */
    }

    .collapsible-card.collapsed .card-body {
      display: none;
    }

    /* Let the table scroll horizontally when it gets too cramped (mobile) */
    .comparison-table-card .card-body {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }

    .comparison-table {
      width: 100%;
      border-collapse: collapse;
      min-width: 480px;
    }

    .comparison-table th {
      text-align: left;
      padding: 0.75rem;
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--text-muted);
      border-bottom: 1px solid var(--border);
    }

    .comparison-table td {
      padding: 0.85rem 0.75rem;
      font-size: 0.9rem;
      border-bottom: 1px solid var(--border);
      transition: var(--transition);
    }

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

    .comparison-table tr:hover td {
      background: rgba(46,232,165,0.04);
    }

    .comparison-table .highlight-row td {
      color: var(--primary);
      font-weight: 700;
    }

    .comparison-table .green-row td {
      color: var(--primary);
    }

    .comparison-table .co2-icon-value::before {
      content: "\f06c";
      font-family: "Font Awesome 6 Free";
      font-weight: 900;
      margin-right: 0.4rem;
    }

    .cta-box {
      background: linear-gradient(135deg, var(--primary-dark) 0%, #0D8C6E 100%);
      border-radius: var(--radius-lg);
      padding: 2rem;
      text-align: center;
    }

    .cta-box h3 {
      font-size: 1.3rem;
      font-weight: 800;
      color: white;
      margin-bottom: 0.5rem;
    }

    .cta-box p {
      color: rgba(255,255,255,0.85);
      font-size: 0.9rem;
      margin-bottom: 1.5rem;
    }

    .cta-box .btn {
      background: white;
      color: var(--primary-dark);
      font-weight: 700;
    }

    .cta-box .btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    }

    /* Payback timeline */
    .payback-bar-wrap {
      margin-top: 0.75rem;
    }

    .payback-bar {
      height: 12px;
      background: var(--border);
      border-radius: 6px;
      overflow: hidden;
      margin-bottom: 0.4rem;
    }

    .payback-fill {
      height: 100%;
      background: var(--gradient-primary);
      border-radius: 6px;
      transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .payback-labels {
      display: flex;
      justify-content: space-between;
      font-size: 0.72rem;
      color: var(--text-muted);
    }

    /* Disclaimer */
    .disclaimer {
      background: rgba(100, 116, 139, 0.08);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 1rem 1.25rem;
      font-size: 0.8rem;
      color: var(--text-muted);
      line-height: 1.6;
    }

    .disclaimer i {
      color: var(--text-muted);
      margin-right: 0.4rem;
    }

    /* HOW IT WORKS SECTION */
    .how-section {
      background: var(--bg-card-2);
      border-top: 1px solid var(--border);
      padding: 4rem 0;
    }

    .how-cards {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 1.5rem;
    }

    .how-card {
      text-align: center;
      padding: 1.5rem 1rem;
    }

    .how-card .how-num {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: var(--primary-glow);
      border: 2px solid rgba(46,232,165,0.4);
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 1rem;
      font-weight: 800;
      color: var(--primary);
      font-size: 1rem;
    }

    .how-card h4 {
      font-size: 0.95rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
    }

    .how-card p {
      font-size: 0.82rem;
      color: var(--text-muted);
      line-height: 1.5;
    }

    @media (max-width: 1024px) {
      .calc-layout {
        grid-template-columns: 1fr;
        align-items: stretch;
      }
      .calc-input-panel {
        width: 100%;
        min-width: 0;
      }
      .calc-results-panel {
        width: 100%;
        min-width: 0;
      }
      .result-grid { grid-template-columns: repeat(3, 1fr); }
      .how-cards { grid-template-columns: repeat(2, 1fr); }
    }

    @media (max-width: 600px) {
      .calc-input-panel { padding: 1.25rem; }
      .result-grid { grid-template-columns: 1fr; }
      .fuel-selector { grid-template-columns: repeat(2, 1fr); }
      .advanced-grid-2 { grid-template-columns: 1fr; }
      .how-cards { grid-template-columns: 1fr 1fr; }
    }
