/* v4.2 — seleção explícita, diagnóstico comparativo e propostas de uso eventual */

/* Botão de seleção: primeira coluna, sempre visível */
.cmp-select-head,.cmp-select-cell{
  width:118px!important;min-width:118px!important;max-width:118px!important;
  text-align:center!important;position:sticky!important;left:0;z-index:4;background:#f8fafc!important
}
.cmp-select-head{z-index:7!important;background:#eaf0f7!important;color:#17365d!important}
.cmp-select-cell{vertical-align:middle!important;border-right:1px solid #dfe6f1!important}
.cmp-select-btn{
  width:100%;border:1px solid #9fb4ca;background:#fff;color:#17365d;border-radius:8px;
  padding:7px 6px;font-size:9px;line-height:1.15;font-weight:850;cursor:pointer;white-space:normal
}
.cmp-select-btn span{display:inline-block;margin-right:4px;font-size:12px;vertical-align:-1px}
.cmp-select-btn:hover{background:#eaf2fb;border-color:#6e98c4}
.cmp-select-btn.selected{background:#17365d;color:#fff;border-color:#17365d}
.sim-proposal-actions .cmp-select-btn{width:auto;min-width:130px;padding:8px 10px}

/* As colunas de mercado foram deslocadas em +1 pela coluna de seleção */
.market-contract-table th:nth-child(1),.market-contract-table td:nth-child(1){width:118px;min-width:118px}
.market-contract-table th:nth-child(2),.market-contract-table td:nth-child(2){width:92px;min-width:92px}
.market-contract-table th:nth-child(3),.market-contract-table td:nth-child(3){width:120px;min-width:110px}
.market-contract-table th:nth-child(4),.market-contract-table td:nth-child(4){width:180px;min-width:150px;max-width:230px}
.market-contract-table th:nth-child(5),.market-contract-table td:nth-child(5){width:115px;min-width:105px}
.market-contract-table th:nth-child(6),.market-contract-table td:nth-child(6){width:250px;min-width:210px;max-width:320px}
.market-contract-table th:nth-child(7),.market-contract-table td:nth-child(7){width:105px}
.market-contract-table th:nth-child(8),.market-contract-table td:nth-child(8),.market-contract-table th:nth-child(9),.market-contract-table td:nth-child(9){width:115px}
.market-contract-table th:nth-child(10),.market-contract-table td:nth-child(10){width:95px}
.market-contract-table th:nth-child(11),.market-contract-table td:nth-child(11){width:155px;max-width:210px}
.market-contract-table th:nth-child(12),.market-contract-table td:nth-child(12){width:130px}

.market-offers-table th:nth-child(1),.market-offers-table td:nth-child(1){width:118px;min-width:118px}
.market-offers-table th:nth-child(2),.market-offers-table td:nth-child(2){width:46px}
.market-offers-table th:nth-child(3),.market-offers-table td:nth-child(3){width:170px}
.market-offers-table th:nth-child(4),.market-offers-table td:nth-child(4){width:100px}
.market-offers-table th:nth-child(5),.market-offers-table td:nth-child(5){width:190px}
.market-offers-table th:nth-child(6),.market-offers-table td:nth-child(6){width:90px}
.market-offers-table th:nth-child(7),.market-offers-table td:nth-child(7){width:280px}
.market-offers-table th:nth-child(8),.market-offers-table td:nth-child(8){width:150px}

/* Diagnóstico comparativo */
#cmpDiagnosis{padding:12px 20px 0;overflow:auto;max-height:43vh}
.cmp-diagnosis{display:grid;gap:10px}
.cmp-analysis-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.cmp-analysis-grid>div{min-width:0;background:#fff;border:1px solid #dfe6f1;border-radius:10px;padding:10px}
.cmp-analysis-grid span{display:block;font-size:8px;text-transform:uppercase;letter-spacing:.05em;color:#69748f;font-weight:900}
.cmp-analysis-grid strong{display:block;margin-top:4px;color:#17365d;font-size:13px;overflow-wrap:anywhere}
.cmp-analysis-grid strong.good{color:#16784f}.cmp-analysis-grid strong.warn{color:#9d6700}.cmp-analysis-grid strong.neutral{color:#69748f}
.cmp-analysis-grid small{display:block;margin-top:3px;color:#69748f;font-size:9px;overflow-wrap:anywhere}

.cmp-ranking-card{background:#fff;border:1px solid #dfe6f1;border-radius:12px;padding:12px}
.cmp-ranking-card.blocked{background:#fbfcfe;border-style:dashed}
.cmp-ranking-card.blocked p{margin:6px 0 0;color:#59657d;font-size:10px}
.cmp-analysis-title{display:flex;justify-content:space-between;gap:10px;align-items:baseline;margin-bottom:8px}
.cmp-analysis-title span{font-size:8px;letter-spacing:.08em;font-weight:900;color:#69748f}
.cmp-analysis-title strong{font-size:12px;color:#17365d;text-align:right}
.cmp-rank-list{display:grid;gap:5px}
.cmp-rank-row{display:grid;grid-template-columns:34px minmax(150px,1.3fr) minmax(110px,.7fr) minmax(140px,1fr);gap:8px;align-items:center;padding:7px 8px;background:#f7f9fc;border-radius:8px;font-size:10px}
.cmp-rank-row.best{background:#e7f6ee;border:1px solid #bee2ce}
.cmp-rank-pos{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#e8eef6;color:#17365d;font-weight:900}
.cmp-rank-row.best .cmp-rank-pos{background:#16784f;color:#fff}
.cmp-rank-row strong{overflow-wrap:anywhere}.cmp-rank-row small{color:#69748f;overflow-wrap:anywhere}
.cmp-conclusion{margin-top:9px;padding:9px 10px;border-radius:8px;font-size:10px}
.cmp-conclusion.ok{background:#edf8f2;color:#155e42}.cmp-conclusion.warn{background:#fff7e5;color:#745000}
.cmp-fee-note{padding:9px 10px;border-radius:8px;background:#eef4fb;color:#35516f;font-size:10px}
.cmp-warnings{display:grid;gap:5px;background:#fff;border:1px solid #e1e7ef;border-radius:10px;padding:10px}
.cmp-warnings>strong{font-size:10px;color:#35445b;margin-bottom:2px}
.cmp-warning{display:grid;grid-template-columns:22px minmax(0,1fr);gap:7px;align-items:start;padding:6px 0;border-top:1px solid #edf1f5;font-size:9.5px}
.cmp-warning:first-of-type{border-top:0}.cmp-warning i{width:20px;height:20px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-weight:900}
.cmp-warning.warn i{background:#fff0c7;color:#8a5a00}.cmp-warning.info i{background:#e7f0fa;color:#245786}
.cmp-warning span{display:grid;gap:1px;color:#59657d}.cmp-warning b{color:#29384d}

/* crítica visual nas células */
.cmp-eval{display:inline-flex;align-items:center;gap:3px;margin:4px 0 0 5px;padding:2px 5px;border-radius:999px;font-size:7.5px;font-weight:900;white-space:nowrap;vertical-align:1px}
.cmp-eval i{font-style:normal}.cmp-eval.good{background:#e3f5eb;color:#126b45}.cmp-eval.bad{background:#feeceb;color:#9a261d}.cmp-eval.info{background:#e8f0f9;color:#315f8c}.cmp-eval.warn{background:#fff0c9;color:#805500}
.cmp-table tr.price td{background:#fbfdff}.cmp-table tr.price td:has(.cmp-eval.good){background:#f1fbf5}.cmp-table tr.price td:has(.cmp-eval.bad){background:#fff6f5}

/* O diagnóstico ocupa espaço próprio; a tabela continua abaixo com rolagem independente */
.cmp-dialog{grid-template-rows:auto auto auto minmax(0,1fr)}
.cmp-table-wrap{padding-top:10px}

/* Propostas novas: uso eventual, no final do simulador */
.sim-proposal-entry{margin-top:18px;border:1px solid #d7e0eb;border-radius:14px;background:#fff;box-shadow:0 7px 22px rgba(23,54,93,.05);overflow:hidden}
.sim-proposal-entry>summary{list-style:none;display:flex;justify-content:space-between;align-items:center;gap:16px;padding:15px 17px;cursor:pointer;background:#f8fafc}
.sim-proposal-entry>summary::-webkit-details-marker{display:none}
.sim-proposal-entry>summary div{min-width:0}.sim-proposal-entry>summary span{display:block;color:#8a6571;font-size:8px;font-weight:900;letter-spacing:.1em}
.sim-proposal-entry>summary strong{display:block;color:#17365d;font-size:15px;margin-top:2px}.sim-proposal-entry>summary small{display:block;color:#69748f;font-size:9px;margin-top:2px;overflow-wrap:anywhere}
.sim-proposal-entry>summary>b{flex:0 0 auto;background:#eef2f8;color:#17365d;padding:7px 9px;border-radius:8px;font-size:9px}
.sim-proposal-entry[open]>summary{border-bottom:1px solid #e2e8f0}.sim-proposal-entry-body{padding:0 15px 15px}
.sim-proposal-entry .sim-section-head{margin-top:14px}.sim-proposal-entry .sim-section-head h2{font-size:16px}.sim-proposal-entry .sim-section-head p{font-size:10px}
.sim-proposal-entry .sim-proposal{box-shadow:none;background:#fbfcfe}
.sim-proposal-entry input::placeholder{color:#9aa6b8;opacity:1;font-style:italic}
.sim-await{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-top:14px;background:#f9fbfd;border-style:dashed;box-shadow:none}
.sim-await span{font-size:8px;font-weight:900;letter-spacing:.08em;color:#69748f}.sim-await h2{font-size:16px;margin:3px 0}.sim-await p{margin:0;color:#69748f;font-size:10px;max-width:760px}
.sim-await>i{font-style:normal;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#e8f0f9;color:#315f8c;font-weight:900}

@media(max-width:900px){
  .cmp-analysis-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cmp-rank-row{grid-template-columns:34px minmax(140px,1fr) minmax(100px,.7fr)}
  .cmp-rank-row small{grid-column:2/-1}
  #cmpDiagnosis{max-height:48vh}
}
@media(max-width:560px){
  .cmp-select-head,.cmp-select-cell{width:104px!important;min-width:104px!important;max-width:104px!important}
  .cmp-select-btn{font-size:8px;padding:6px 4px}
  #cmpDiagnosis{padding:9px 10px 0;max-height:50vh}.cmp-analysis-grid{grid-template-columns:1fr 1fr;gap:5px}.cmp-analysis-grid>div{padding:7px}
  .cmp-analysis-title{display:block}.cmp-analysis-title strong{display:block;text-align:left;margin-top:2px}
  .cmp-rank-row{grid-template-columns:30px minmax(130px,1fr)}.cmp-rank-row>span:nth-of-type(2){grid-column:2}.cmp-rank-row small{grid-column:2}
  .sim-proposal-entry>summary{align-items:flex-start;padding:12px}.sim-proposal-entry>summary>b{display:none}.sim-proposal-entry-body{padding:0 9px 10px}
  .sim-await{align-items:flex-start;padding:12px}.sim-await>i{width:28px;height:28px}
}