/* v4.7 — mesa centrada na comparação, uma rolagem vertical, seletor controlado e sugestões explícitas */

/* UMA rolagem vertical: o próprio diálogo. */
.cmp-dialog{
  display:block!important;
  overflow:auto!important;
  overscroll-behavior:contain;
  font-size:13px;
  background:#f5f8fc;
}
.cmp-dialog-head,.cmp-addbar,#cmpCompatSuggestions,#cmpTableMeta,#cmpTableWrap,#cmpFinalReport{
  width:100%;
  max-width:100%;
  box-sizing:border-box;
}

/* O diagnóstico antigo sai do topo. Seu conteúdo relevante reaparece no relatório final. */
#cmpDiagnosis{display:none!important}

/* Topo com fonte confortável. */
.cmp-dialog-head{padding:20px 22px!important}
.cmp-dialog-head h2{font-size:28px!important;line-height:1.08}
.cmp-dialog-head p{font-size:12px!important;line-height:1.45}
.cmp-kicker{font-size:10px!important}
.cmp-addbar{
  grid-template-columns:minmax(180px,.55fr) minmax(0,2.45fr) auto auto!important;
  gap:10px!important;
  padding:13px 22px!important;
  align-items:end!important;
  position:relative;
  z-index:40;
}
.cmp-addbar label{font-size:10px!important}
.cmp-addbar label>span{font-size:10px!important;margin-bottom:5px!important}
.cmp-addbar select,.cmp-addbar .btn{font-size:13px!important;min-height:42px}
.cmp-addbar .btn{padding:10px 14px!important}

/* Substitui o dropdown nativo por uma lista controlada, sem estourar a largura da tela. */
.cmp-native-picker-hidden{display:none!important}
.cmp-smart-label{position:relative!important;min-width:0!important}
.cmp-smart-picker{position:relative;width:100%;min-width:0}
.cmp-smart-button{
  width:100%;min-width:0;min-height:42px;
  display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"main icon" "sub icon";
  gap:2px 10px;align-items:center;text-align:left;
  border:1px solid #c7d4e4;border-radius:9px;background:#fff;color:#17365d;
  padding:8px 11px;cursor:pointer;
}
.cmp-smart-button:hover{border-color:#7ea1c6;background:#fbfdff}
.cmp-smart-main{
  grid-area:main;display:block;min-width:0;
  font-size:12.5px;font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.cmp-smart-sub{
  grid-area:sub;display:block;min-width:0;
  font-size:10px;color:#69748f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.cmp-smart-button>i{grid-area:icon;font-style:normal;font-size:18px;color:#53718e}
.cmp-smart-menu{
  position:absolute;z-index:1000;left:0;right:0;top:calc(100% + 5px);
  width:100%;max-width:100%;max-height:410px;overflow:auto;
  border:1px solid #c8d5e4;border-radius:10px;background:#fff;
  box-shadow:0 18px 44px rgba(23,54,93,.22);
}
.cmp-smart-menu[hidden]{display:none!important}
.cmp-smart-search-wrap{position:sticky;top:0;z-index:2;padding:8px;background:#f7f9fc;border-bottom:1px solid #e4eaf1}
.cmp-smart-search{
  width:100%;box-sizing:border-box;border:1px solid #cbd6e3;border-radius:8px;
  padding:9px 10px;font-size:12px;color:#23384f;background:#fff
}
.cmp-smart-list{display:grid;padding:4px}
.cmp-smart-option{
  display:grid;grid-template-columns:56px minmax(0,1fr);gap:9px;align-items:center;
  width:100%;min-width:0;text-align:left;border:0;border-bottom:1px solid #edf1f5;
  background:#fff;padding:9px 8px;cursor:pointer
}
.cmp-smart-option:last-child{border-bottom:0}
.cmp-smart-option:hover{background:#f2f7fc}
.cmp-smart-score{text-align:center;padding-right:8px;border-right:1px solid #e4eaf1}
.cmp-smart-score strong{display:block;font-size:14px;line-height:1;color:#17365d}
.cmp-smart-score small{display:block;margin-top:3px;font-size:8px;font-weight:900;text-transform:uppercase;color:#718096}
.cmp-smart-option.high .cmp-smart-score strong{color:#116b46}
.cmp-smart-option.good .cmp-smart-score strong{color:#2e6c55}
.cmp-smart-option.partial .cmp-smart-score strong{color:#8a6200}
.cmp-smart-option.low .cmp-smart-score strong{color:#9a332c}
.cmp-smart-copy{min-width:0}
.cmp-smart-copy strong{display:block;font-size:12px;color:#25384d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cmp-smart-copy small{display:block;margin-top:3px;font-size:10px;color:#66758a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cmp-smart-empty{padding:18px;text-align:center;color:#718096;font-size:12px}

/* Sugestões explícitas de contratos comparáveis. */
.cmp-compat-zone{
  padding:11px 22px 12px!important;background:#fff;border-bottom:1px solid #dde5ef;
  position:relative;z-index:20
}
.cmp-compat-zone[hidden]{display:none!important}
.cmp-compat-empty{
  border:1px dashed #c6d4e4;border-radius:10px;background:#f8fbfe;padding:10px 12px
}
.cmp-compat-empty span,.cmp-compat-head span{font-size:9px;font-weight:950;letter-spacing:.1em;color:#6d7d92}
.cmp-compat-empty strong{display:block;margin-top:2px;font-size:13px;color:#17365d}
.cmp-compat-empty small{display:block;margin-top:2px;font-size:10.5px;line-height:1.35;color:#69748f}
.cmp-compat-head{display:flex;align-items:baseline;gap:10px;margin-bottom:8px}
.cmp-compat-head>div{display:flex;align-items:baseline;gap:8px;min-width:0}
.cmp-compat-head strong{font-size:13px;color:#17365d}
.cmp-compat-head>small{margin-left:auto;font-size:10px;color:#6f7e91;white-space:nowrap}
.cmp-compat-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.cmp-compat-card{
  min-width:0;display:grid;grid-template-columns:52px minmax(0,1fr);grid-template-areas:"score copy" "button button";
  gap:7px 9px;border:1px solid #dbe4ed;border-radius:10px;background:#fbfcfe;padding:9px
}
.cmp-compat-card.high{background:#f3faf6;border-color:#b7dcc8}
.cmp-compat-card.good{background:#f8fbf9;border-color:#c9ddd4}
.cmp-compat-card.partial{background:#fffdf7;border-color:#ead7a4}
.cmp-compat-card.low{background:#fffafa;border-color:#e7c4c1}
.cmp-compat-score{grid-area:score;text-align:center;border-right:1px solid #e3e9ef;padding-right:7px}
.cmp-compat-score strong{display:block;font-size:18px;line-height:1;color:#17365d}
.cmp-compat-score span{display:block;margin-top:4px;font-size:8px;font-weight:900;text-transform:uppercase;color:#718096}
.cmp-compat-copy{grid-area:copy;min-width:0}
.cmp-compat-copy .cmp-source{font-size:7.5px!important}
.cmp-compat-copy>strong{display:block;margin-top:4px;font-size:11.5px;color:#26384d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cmp-compat-copy>small{display:block;margin-top:2px;font-size:9.5px;color:#6b778b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cmp-compat-copy>p{margin:4px 0 0;font-size:9.5px;line-height:1.3;color:#4f6175}
.cmp-compat-card>button{
  grid-area:button;width:100%;border:1px solid #9fb7cf;border-radius:7px;background:#fff;color:#17365d;
  padding:7px 8px;font-size:10px;font-weight:900;cursor:pointer
}
.cmp-compat-card>button:hover{background:#eaf2fb}

/* Linha compacta antes da tabela. */
.cmp-table-meta{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:10px 22px 8px;background:#f5f8fc
}
.cmp-table-meta>div{min-width:0}
.cmp-table-meta strong{font-size:12px;color:#17365d}
.cmp-table-meta span{margin-left:8px;font-size:10.5px;color:#6d7d92}
.cmp-table-meta button{
  flex:0 0 auto;border-radius:999px;padding:6px 9px;font-size:10px;font-weight:850;cursor:pointer
}
.cmp-table-meta button.warn{border:1px solid #e3c66e;background:#fff8e6;color:#765200}
.cmp-table-meta button.ok{border:1px solid #b9dbc8;background:#eff9f3;color:#156344}

/* A comparação é o conteúdo principal. Sem rolagem vertical interna. */
.cmp-table-wrap{
  flex:none!important;min-height:0!important;overflow:visible!important;
  padding:0 22px 18px!important;position:relative;z-index:1
}
.cmp-table{
  width:100%!important;min-width:980px!important;max-width:none!important;
  table-layout:fixed!important;border-radius:10px!important;overflow:visible!important
}
.cmp-table th,.cmp-table td{
  padding:11px 12px!important;font-size:12.5px!important;line-height:1.35!important;
  white-space:normal!important;overflow-wrap:anywhere
}
.cmp-table thead th{
  position:sticky!important;top:0!important;z-index:22!important;
  background:#eef3f8!important;
  box-shadow:0 1px 0 #d9e2ec,0 6px 14px rgba(23,54,93,.08)
}
.cmp-table thead th:first-child{left:0!important;z-index:26!important}
.cmp-table tbody th{
  position:sticky!important;left:0!important;z-index:12!important;background:#f5f8fc!important;
  box-shadow:1px 0 0 #e3e9ef;font-size:10.5px!important;color:#52627a!important
}
.cmp-table th:first-child{width:150px!important;min-width:150px!important;max-width:150px!important}
.cmp-option-head{width:auto!important;min-width:0!important;max-width:none!important}
.cmp-option-head strong{font-size:14px!important;line-height:1.25!important}
.cmp-option-head small{font-size:10.5px!important;line-height:1.3!important}
.cmp-option-head button{font-size:10px!important}
.cmp-source{font-size:8.5px!important}
.cmp-table tr.price strong{font-size:13.5px!important}
.cmp-note{min-width:0!important;max-width:none!important;font-size:11px!important;line-height:1.4!important}
.cmp-eval{
  font-size:8.5px!important;padding:3px 6px!important;margin-top:5px!important;cursor:help
}

/* Relatório no fim: as cautelas deixam de competir com a tabela. */
.cmp-final-report{
  margin:4px 22px 28px;padding:18px;border:1px solid #d8e1eb;border-radius:12px;background:#fff;
  scroll-margin-top:10px
}
.cmp-final-report[hidden]{display:none!important}
.cmp-report-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}
.cmp-report-head>div{min-width:0}
.cmp-report-head>div>span,.cmp-report-grid article>span{font-size:9px;font-weight:950;letter-spacing:.09em;color:#718096}
.cmp-report-head h3{margin:3px 0 4px;font-size:20px;color:#17365d}
.cmp-report-head p{margin:0;max-width:900px;font-size:11.5px;line-height:1.5;color:#66758a}
.cmp-report-status{flex:0 0 auto;min-width:82px;text-align:center;border-radius:10px;padding:9px 10px}
.cmp-report-status strong{display:block;font-size:24px;line-height:1}
.cmp-report-status span{display:block;margin-top:3px;font-size:9px;font-weight:900;text-transform:uppercase}
.cmp-report-status.warn{background:#fff5da;color:#785400}
.cmp-report-status.ok{background:#edf8f2;color:#156344}
.cmp-report-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.cmp-report-grid article{border:1px solid #e0e7ef;border-radius:9px;background:#f9fbfd;padding:11px 12px}
.cmp-report-grid article strong{display:block;margin-top:4px;font-size:13px;color:#253a52}
.cmp-report-grid article p{margin:3px 0 0;font-size:10.5px;line-height:1.4;color:#68788d}
.cmp-report-cautions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.cmp-report-cautions article{display:grid;grid-template-columns:26px minmax(0,1fr);gap:8px;align-items:start;border-top:1px solid #edf1f5;padding:9px 2px}
.cmp-report-cautions i{width:24px;height:24px;display:grid;place-items:center;border-radius:50%;background:#ffefbf;color:#805a00;font-style:normal;font-size:10px;font-weight:950}
.cmp-report-cautions strong{font-size:11.5px;color:#34455b}
.cmp-report-cautions p{margin:2px 0 0;font-size:10.5px;line-height:1.4;color:#66758a}
.cmp-report-clear{margin-top:12px;padding:11px 12px;border-radius:9px;background:#edf8f2;color:#155e42}
.cmp-report-clear strong{font-size:12px}.cmp-report-clear span{margin-left:6px;font-size:10.5px}

/* O menu nunca aumenta a área rolável horizontalmente do modal. */
.cmp-smart-menu,.cmp-smart-option,.cmp-compat-zone,.cmp-compat-card{box-sizing:border-box}

@media(max-width:1200px){
  .cmp-compat-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cmp-addbar{grid-template-columns:minmax(170px,.65fr) minmax(0,2fr) auto auto!important}
}
@media(max-width:820px){
  .cmp-dialog{inset:1vh 1vw!important}
  .cmp-dialog-head{padding:15px!important}.cmp-dialog-head h2{font-size:23px!important}
  .cmp-addbar{grid-template-columns:1fr!important;padding:10px 14px!important}
  .cmp-addbar .btn{width:100%}
  .cmp-compat-zone{padding:10px 14px!important}.cmp-compat-head{display:block}.cmp-compat-head>div{display:block}.cmp-compat-head>small{display:block;margin:3px 0 0}
  .cmp-compat-cards{grid-template-columns:1fr}.cmp-compat-card:nth-child(n+3){display:none}
  .cmp-table-meta{padding:9px 14px;align-items:flex-start}.cmp-table-meta span{display:block;margin:2px 0 0}.cmp-table-meta button{white-space:nowrap}
  .cmp-table-wrap{padding:0 14px 14px!important}
  .cmp-table{min-width:860px!important}
  .cmp-final-report{margin:4px 14px 22px;padding:14px}
  .cmp-report-grid,.cmp-report-cautions{grid-template-columns:1fr}
  .cmp-report-head{gap:12px}.cmp-report-head h3{font-size:18px}
}
@media(max-width:560px){
  .cmp-dialog{inset:0!important;border-radius:0!important}
  .cmp-smart-main{font-size:11.5px}.cmp-smart-sub{font-size:9px}
  .cmp-smart-menu{position:fixed;left:8px;right:8px;top:116px;width:auto;max-height:65vh}
  .cmp-compat-card:nth-child(n+2){display:none}
  .cmp-table-meta{display:block}.cmp-table-meta button{margin-top:6px}
  .cmp-table th,.cmp-table td{font-size:11.5px!important}
  .cmp-final-report{margin-bottom:18px}
}
