/* Calculadora de Cubagem — complementa global.css */
.cub-opcoes {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin-bottom: 18px;
}
.cub-opcoes label, .cub-linha label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-soft);
    margin-bottom: 6px;
}
.cub-opcoes select, .cub-opcoes input { width: 100%; }

.cub-linhas { display: grid; gap: 12px; }
.cub-linha {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
    gap: 10px;
    align-items: end;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px 14px 14px;
    margin: 0;
    background: var(--surface-2, #f7f9fc);
}
.cub-linha legend {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary);
    padding: 0 6px;
}
.cub-linha label { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.cub-linha input { width: 100%; min-width: 0; }
.cub-remover {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0;
}
.cub-remover:disabled { opacity: 0.35; cursor: not-allowed; }

.cub-acoes { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.cub-resultado {
    margin-top: 24px;
    padding: 22px;
    border-radius: 12px;
    background: var(--bg-body);
    border-left: 5px solid var(--primary);
}
.cub-destaque {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 16px;
}
.cub-destaque div { display: flex; flex-direction: column; gap: 2px; }
.cub-rotulo { font-size: 0.9rem; color: var(--text-soft); }
.cub-destaque strong { font-size: 2.1rem; font-weight: 800; color: var(--primary); line-height: 1.15; }
.cub-destaque small { color: var(--text-muted); font-size: 0.88rem; }
.cub-lista {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 18px;
    margin: 0 0 14px;
}
.cub-lista dt { color: var(--text-soft); }
.cub-lista dd { margin: 0; font-weight: 700; }
.cub-resultado h3 { margin-top: 22px; font-size: 1.05rem; }

@media (max-width: 720px) {
    .cub-linha { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cub-linha label:nth-of-type(5) { grid-column: 1 / 2; }
    .cub-remover { justify-self: end; align-self: end; }
}

/* Botões secundários da calculadora (o global só estiliza os de envio). */
.cub-acoes button, #copiarResumo, .cub-remover {
    font: inherit;
    font-weight: 700;
    color: var(--ink, #0f172a);
    background: var(--surface, #fff);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md, 10px);
    padding: 10px 16px;
    min-height: 44px;
    cursor: pointer;
}
.cub-acoes button:hover, #copiarResumo:hover, .cub-remover:not(:disabled):hover {
    border-color: var(--primary);
    color: var(--primary);
}
.cub-acoes button:disabled { opacity: 0.5; cursor: not-allowed; }

/* O nome do modal é longo: em telas largas o seletor ocupa duas colunas. */
@media (min-width: 721px) {
    .cub-opcoes { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.25fr) minmax(0, 0.9fr); }
    .cub-opcoes > #fatorPersonalizadoBox:not(.hidden) ~ div { grid-column: auto; }
}
