    .tfx-calc {
      /* ===========================================================
         COLORS DE MARCA — Novus Real Estate
         Substitueix aquests dos valors si canvia la identitat visual.
         =========================================================== */
      --ink: #262f2e;
      --paper: #f7f8f8;
      --paper-2: #edf1f1;
      --line: #dde3e2;
      --brass: #03989E;        /* color primari Novus (abans "brass") */
      --brass-dark: #027077;   /* variant fosca per a hovers */
      --gain: #0a7a53;
      --gain-bg: #e4f3ec;
      --loss: #b5352e;
      --loss-bg: #f7e6e4;
      --warn: #8a6d1f;
      --warn-bg: #f1ead2;
      --gray: #545454;         /* color secundari Novus */

      all: initial;
      *, *::before, *::after { box-sizing: border-box; }
      display: block;
      font-family: 'Inter', -apple-system, sans-serif;
      color: var(--ink);
      background: var(--paper);
      border: 1px solid var(--line);
      max-width: 780px;
      margin: 0 auto;
      line-height: 1.45;
      -webkit-font-smoothing: antialiased;
    }
    .tfx-calc *, .tfx-calc *::before, .tfx-calc *::after { box-sizing: border-box; font-family: inherit; }

    .tfx-head {
      padding: 28px 32px 22px;
      border-bottom: 1px solid var(--line);
      position: relative;
    }
    .tfx-eyebrow {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 11px;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: var(--brass);
      margin: 0 0 8px;
    }
    .tfx-title {
      font-family: 'Fraunces', serif;
      font-optical-sizing: auto;
      font-weight: 600;
      font-size: 26px;
      margin: 0;
      letter-spacing: -0.01em;
    }
    .tfx-sub {
      font-size: 14px;
      color: #5b6664;
      margin: 6px 0 0;
      max-width: 46ch;
    }

    .tfx-body { padding: 26px 32px 32px; }

    .tfx-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 18px 20px;
    }
    @media (max-width: 560px) { .tfx-grid { grid-template-columns: 1fr; } }

    .tfx-field { display: flex; flex-direction: column; gap: 6px; }
    .tfx-field label {
      font-size: 12.5px;
      font-weight: 600;
      color: #445451;
      display: flex;
      justify-content: space-between;
      align-items: baseline;
    }
    .tfx-field label span.tfx-hint {
      font-weight: 400;
      color: #8b9491;
      font-size: 11px;
    }
    .tfx-input-wrap { position: relative; }
    .tfx-input-wrap .tfx-unit {
      position: absolute;
      right: 12px; top: 50%; transform: translateY(-50%);
      font-size: 13px; color: #8b9491;
      font-family: 'IBM Plex Mono', monospace;
      pointer-events: none;
    }
    .tfx-calc input[type=number] {
      width: 100%;
      padding: 10px 40px 10px 12px;
      border: 1px solid var(--line);
      background: #fff;
      border-radius: 3px;
      font-size: 15px;
      font-family: 'IBM Plex Mono', monospace;
      color: var(--ink);
      transition: border-color .15s, box-shadow .15s;
    }
    .tfx-calc input[type=number]:focus {
      outline: none;
      border-color: var(--brass);
      box-shadow: 0 0 0 3px rgba(150,115,60,0.15);
    }
    .tfx-calc input[type=number]::-webkit-outer-spin-button,
    .tfx-calc input[type=number]::-webkit-inner-spin-button { opacity: 0.4; }

    .tfx-divider {
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 24px 0 16px;
    }
    .tfx-divider::before, .tfx-divider::after {
      content: ""; flex: 1; height: 1px; background: var(--line);
    }
    .tfx-divider span {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
      color: #8b9491;
    }

    .tfx-toggle-row {
      display: flex; justify-content: space-between; align-items: center;
      margin-top: 22px; cursor: pointer; user-select: none;
    }
    .tfx-toggle-row .tfx-toggle-label {
      font-size: 12.5px; font-weight: 600; color: #445451;
      display: flex; align-items: center; gap: 6px;
    }
    .tfx-caret { transition: transform .2s; font-size: 10px; color: var(--brass); }
    .tfx-caret.open { transform: rotate(90deg); }
    .tfx-advanced {
      display: none;
      grid-template-columns: 1fr 1fr;
      gap: 18px 20px;
      margin-top: 16px;
      padding-top: 16px;
      border-top: 1px dashed var(--line);
    }
    .tfx-advanced.open { display: grid; }
    @media (max-width: 560px) { .tfx-advanced { grid-template-columns: 1fr; } }

    /* ---- Selección de elementos a reformar (tarjetas) ----
       El usuario NO introduce precios: solo marca qué quiere reformar
       y el coste se calcula automáticamente (ver constantes COSTOS en el JS). */
    .tfx-reform-label {
      font-size: 12.5px; font-weight: 600; color: #445451;
      margin: 22px 0 10px;
    }
    .tfx-reform-cards {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 8px;
    }
    @media (max-width: 640px) { .tfx-reform-cards { grid-template-columns: repeat(3, 1fr); } }
    .tfx-reform-card {
      position: relative;
      border: 1px solid var(--line);
      border-radius: 4px;
      background: #fff;
      padding: 12px 8px 10px;
      text-align: center;
      cursor: pointer;
      user-select: none;
      transition: border-color .15s, background .15s;
    }
    .tfx-reform-card:hover { border-color: #b9d8d9; }
    .tfx-reform-card.active {
      border-color: var(--brass);
      background: var(--paper-2);
    }
    .tfx-reform-card .tfx-rc-icon { display: block; margin-bottom: 7px; color: var(--gray); }
    .tfx-reform-card .tfx-rc-icon svg { width: 21px; height: 21px; display: block; margin: 0 auto; }
    .tfx-reform-card.active .tfx-rc-icon { color: var(--brass); }
    .tfx-reform-card .tfx-rc-label { font-size: 11.5px; font-weight: 600; color: var(--ink); }
    .tfx-reform-card .tfx-rc-check {
      position: absolute; top: 6px; right: 6px;
      width: 14px; height: 14px; border-radius: 50%;
      border: 1px solid #c7d1d0; background: #fff;
      font-size: 9px; color: transparent;
      display: flex; align-items: center; justify-content: center;
    }
    .tfx-reform-card.active .tfx-rc-check {
      background: var(--brass); border-color: var(--brass); color: #fff;
    }
    .tfx-item-total {
      font-size: 12px;
      font-family: 'IBM Plex Mono', monospace;
      color: #5b6664;
      text-align: right;
      margin-top: 10px;
      padding-top: 8px;
      border-top: 1px solid var(--line);
      margin-top: 2px;
    }

    /* ---- Results ---- */
    .tfx-results { margin-top: 30px; }

    .tfx-verdict {
      border-radius: 4px;
      padding: 18px 20px;
      display: flex;
      gap: 14px;
      align-items: flex-start;
      border: 1px solid transparent;
    }
    .tfx-verdict .tfx-vicon {
      font-family: 'Fraunces', serif;
      font-size: 22px;
      line-height: 1;
      flex-shrink: 0;
      width: 34px; height: 34px;
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-weight: 600;
    }
    .tfx-verdict .tfx-vtext h4 {
      margin: 0 0 3px; font-size: 15.5px; font-family: 'Fraunces', serif; font-weight: 600;
    }
    .tfx-verdict .tfx-vtext p { margin: 0; font-size: 13px; color: #4a5553; }

    .tfx-verdict.gain { background: var(--gain-bg); border-color: #c6d8cf; }
    .tfx-verdict.gain .tfx-vicon { background: var(--gain); color: #fff; }
    .tfx-verdict.gain h4 { color: var(--gain); }

    .tfx-verdict.warn { background: var(--warn-bg); border-color: #e1d3a3; }
    .tfx-verdict.warn .tfx-vicon { background: var(--warn); color: #fff; }
    .tfx-verdict.warn h4 { color: var(--warn-dark, #6e5716); }

    .tfx-verdict.loss { background: var(--loss-bg); border-color: #e3c3ba; }
    .tfx-verdict.loss .tfx-vicon { background: var(--loss); color: #fff; }
    .tfx-verdict.loss h4 { color: var(--loss); }

    /* ---- Bridge / bars ---- */
    .tfx-bridge {
      margin-top: 22px;
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 4px;
      padding: 20px 22px 16px;
    }
    .tfx-bridge-title {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
      color: #8b9491; margin: 0 0 16px;
    }
    .tfx-bar-row { margin-bottom: 16px; }
    .tfx-bar-label {
      display: flex; justify-content: space-between;
      font-size: 12.5px; color: #445451; margin-bottom: 5px;
      font-weight: 500;
    }
    .tfx-bar-label b {
      font-family: 'IBM Plex Mono', monospace;
      font-weight: 500; color: var(--ink);
    }
    .tfx-bar-track {
      height: 22px;
      background: var(--paper-2);
      border-radius: 3px;
      overflow: hidden;
      position: relative;
    }
    .tfx-bar-fill {
      height: 100%;
      border-radius: 3px;
      transition: width .5s cubic-bezier(.22,.61,.36,1);
      width: 0%;
    }
    .tfx-bar-fill.base { background: #b7bdb7; }
    .tfx-bar-fill.net { background: var(--brass); }

    .tfx-metrics {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1px;
      background: var(--line);
      margin-top: 22px;
      border: 1px solid var(--line);
      border-radius: 4px;
      overflow: hidden;
    }
    @media (max-width: 560px) { .tfx-metrics { grid-template-columns: 1fr; } }
    .tfx-metric {
      background: #fff;
      padding: 14px 16px;
    }
    .tfx-metric .tfx-mlabel {
      font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
      color: #8b9491; margin-bottom: 4px;
    }
    .tfx-metric .tfx-mval {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 19px; font-weight: 500; color: var(--ink);
    }
    .tfx-metric .tfx-mval.pos { color: var(--gain); }
    .tfx-metric .tfx-mval.neg { color: var(--loss); }

    .tfx-foot-note {
      font-size: 11.5px; color: #8b9491; margin-top: 16px; line-height: 1.5;
    }
    .tfx-zone-note {
      font-size: 11.5px; margin: 6px 2px 0; line-height: 1.4; min-height: 15px;
    }
    .tfx-zone-note.in-zone { color: var(--gain); }
    .tfx-zone-note.out-zone { color: var(--warn); }

    /* ---- Botons ---- */
    .tfx-cta-row { margin-top: 26px; display: flex; justify-content: flex-end; gap: 10px; }
    .tfx-btn-primary {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
      background: var(--brass); color: #fff; border: none;
      padding: 13px 24px; border-radius: 3px; cursor: pointer;
      transition: background .15s;
    }
    .tfx-btn-primary:hover { background: var(--brass-dark); }
    .tfx-btn-primary:disabled { background: #b7d8d9; cursor: not-allowed; }
    .tfx-btn-secondary {
      font-family: 'IBM Plex Mono', monospace;
      font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
      background: none; color: #5b6664; border: 1px solid var(--line);
      padding: 13px 20px; border-radius: 3px; cursor: pointer;
    }
    .tfx-btn-secondary:hover { color: var(--ink); border-color: #b7bdb7; }

    /* ---- Pantalla intermedia: captación de lead ---- */
    .tfx-gate { text-align: center; padding: 6px 4px 4px; }
    .tfx-gate-icon {
      width: 52px; height: 52px; border-radius: 50%;
      background: var(--paper-2); color: var(--brass);
      display: flex; align-items: center; justify-content: center;
      font-size: 22px; margin: 0 auto 16px;
    }
    .tfx-gate h4 {
      font-family: 'Fraunces', serif; font-weight: 600; font-size: 21px;
      margin: 0 0 8px; letter-spacing: -0.01em;
    }
    .tfx-gate > p { font-size: 13.5px; color: #5b6664; max-width: 42ch; margin: 0 auto 24px; line-height: 1.55; }
    .tfx-gate-form { text-align: left; max-width: 380px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
    .tfx-check-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 4px; text-align: left; }
    .tfx-check-row input { margin-top: 3px; width: 15px; height: 15px; accent-color: var(--brass); flex-shrink: 0; }
    .tfx-check-row label { font-size: 11.5px; color: #5b6664; line-height: 1.5; }
    .tfx-check-row a { color: var(--brass); text-decoration: underline; }
    .tfx-error-msg {
      font-size: 12.5px; color: var(--loss); background: var(--loss-bg);
      padding: 9px 12px; border-radius: 3px; margin-top: 4px; display: none;
    }
    .tfx-error-msg.show { display: block; }
    .tfx-gate-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }

    /* honeypot anti-spam, invisible per a persones */
    .tfx-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

    .tfx-confirm-badge {
      display: flex; align-items: center; gap: 8px;
      background: var(--gain-bg); color: var(--gain);
      font-size: 12.5px; font-weight: 600; padding: 10px 12px;
      border-radius: 3px; margin-bottom: 18px;
    }

    #tfx-viewGate, #tfx-viewResult, #tfx-viewConfirm { display: none; }
