.dh-trl-calculator { width: 100%; padding: 0; }
.dh-trl-calculator *,
.dh-trl-calculator *::before,
.dh-trl-calculator *::after { box-sizing: border-box; }

.dh-trl-card {
    max-width: 100%;
    margin: 0;
    padding: 18px;
    border-radius: var(--radius-xl, 16px);
    background: var(--color-bg-primary, #fff);
    border: 1px solid var(--color-border, #e2e8f0);
}

/* Header */
.dh-trl-header {
    text-align: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.dh-trl-kicker {
    margin: 0 0 6px;
    color: var(--color-text-muted, #64748b);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dh-trl-title {
    margin: 0 0 4px;
    color: #346af1;
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    font-weight: 800;
    line-height: 1.15;
}

.dh-trl-subtitle {
    margin: 0;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.78rem;
}

/* Info box */
.dh-trl-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    font-size: 0.78rem;
    color: #1f2937;
    line-height: 1.5;
}

/* Support phrase (frase de apoio antes das perguntas) */
.dh-trl-support {
    background: #fffbeb;
    border-left: 3px solid #edb133;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 0.8rem;
    color: #92400e;
    line-height: 1.55;
    font-style: italic;
}

/* Section titles */
.dh-trl-section-title {
    margin: 18px 0 10px;
    padding-left: 0;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: baseline;
    gap: 8px;
    line-height: 1.3;
}

.dh-trl-section-subtitle {
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: #6b7280;
    font-style: italic;
}

.dh-trl-section-title--green   { color: #1e293b; }
.dh-trl-section-title--blue    { color: #1e293b; }
.dh-trl-section-title--purple  { color: #1e293b; }

/* Scale legend */
.dh-trl-scale-legend {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    margin: 18px 0 14px;
}

.dh-trl-scale-intro {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e293b;
}

.dh-trl-scale-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.dh-trl-scale-item {
    font-size: 0.72rem;
    color: #64748b;
}

/* Questions */
.dh-trl-question {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.dh-trl-question-header {
    color: #1e293b;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}


/* Scale options (4 in a row) */
.dh-trl-options--scale {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.dh-trl-option--scale {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    font-family: inherit;
    text-align: center;
    gap: 3px;
}

.dh-trl-option--scale:hover {
    background: rgba(52, 106, 241, 0.06);
    border-color: #edb133;
}

.dh-trl-option-value {
    font-size: 1rem;
    font-weight: 800;
    color: #346af1;
    line-height: 1;
}

.dh-trl-option--scale .dh-trl-option-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: #6b7280;
    line-height: 1.2;
}

/* Selected state */
.dh-trl-option--scale.is-selected {
    background: #346af1;
    border-color: #346af1;
}

.dh-trl-option--scale.is-selected .dh-trl-option-value,
.dh-trl-option--scale.is-selected .dh-trl-option-label { color: #fff; }

/* Actions */
.dh-trl-actions { margin-top: 16px; }

.dh-trl-primary {
    width: 100%;
    min-height: 48px;
    padding: 14px;
    background: #346af1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background 0.15s ease;
}

.dh-trl-primary:hover { background: #2855d4; }

/* Error */
.dh-trl-error {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.82rem;
    font-weight: 600;
}

/* Results */
.dh-trl-results {
    margin-top: 18px;
    animation: dhTrlFadeIn 0.3s ease;
}

@keyframes dhTrlFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Level card */
.dh-trl-level {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 16px;
}

.dh-trl-level-score {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.dh-trl-level-label {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.dh-trl-level-desc {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #1f2937;
}

.dh-trl-level--base {
    background: #fef2f2;
}
.dh-trl-level--base .dh-trl-level-score,
.dh-trl-level--base .dh-trl-level-label { color: #dc2626; }

.dh-trl-level--consolidacao {
    background: #fffbeb;
}
.dh-trl-level--consolidacao .dh-trl-level-score,
.dh-trl-level--consolidacao .dh-trl-level-label { color: #d97706; }

.dh-trl-level--lideranca {
    background: #ecfdf5;
}
.dh-trl-level--lideranca .dh-trl-level-score,
.dh-trl-level--lideranca .dh-trl-level-label { color: #059669; }

/* Breakdown */
.dh-trl-breakdown {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.dh-trl-breakdown-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}

.dh-trl-pillar-row {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.dh-trl-pillar-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.dh-trl-pillar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.dh-trl-pillar-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dh-trl-pillar-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    flex: 1;
}

.dh-trl-pillar-score {
    font-size: 0.82rem;
    font-weight: 800;
    color: #1e293b;
}

/* Progress bar */
.dh-trl-progress {
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.dh-trl-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Pillar classification badge */
.dh-trl-pillar-class {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

.dh-trl-pillar-class--alerta       { background: #fee2e2; color: #dc2626; }
.dh-trl-pillar-class--construcao   { background: #fef3c7; color: #d97706; }
.dh-trl-pillar-class--fortalecido  { background: #d1fae5; color: #059669; }

.dh-trl-pillar-class-msg {
    margin-top: 6px;
    font-size: 0.74rem;
    color: #475569;
    line-height: 1.45;
}

/* Prioridade (rodapé do bloco de pontuação) */
.dh-trl-breakdown-priority {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed #cbd5e1;
}

.dh-trl-breakdown-priority-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.dh-trl-breakdown-priority-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: #346af1;
}

/* Direction */
.dh-trl-direction {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.dh-trl-direction-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: #346af1;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.dh-trl-direction-msg {
    margin: 0 0 10px;
    font-size: 0.82rem;
    color: #1e293b;
    line-height: 1.6;
}

.dh-trl-direction-note {
    margin: 4px 0 12px;
    padding: 8px 10px;
    background: #fef3c7;
    border-radius: 6px;
    font-size: 0.72rem;
    color: #92400e;
    font-style: italic;
    line-height: 1.4;
}

.dh-trl-direction-contents-title {
    margin: 14px 0 8px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #1e293b;
}

.dh-trl-direction-contents {
    margin: 0 0 8px;
    padding-left: 20px;
}

.dh-trl-direction-contents li {
    font-size: 0.8rem;
    color: #1e293b;
    line-height: 1.5;
    margin-bottom: 4px;
}

.dh-trl-direction-quote {
    margin: 12px 0;
    padding: 12px 14px;
    border-left: 3px solid #8B5CF6;
    background: #faf5ff;
    border-radius: 6px;
    font-size: 0.82rem;
    font-style: italic;
    color: #4c1d95;
    line-height: 1.55;
}

.dh-trl-track-desc {
    margin: 14px 0 4px;
    padding: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.dh-trl-track-desc-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #346af1;
    margin-bottom: 6px;
}

.dh-trl-track-desc-text {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.55;
}

.dh-trl-cta-trilha {
    display: block;
    width: 100%;
    margin-top: 16px;
    min-height: 48px;
    padding: 14px;
    background: #346af1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background 0.15s ease;
}

a.dh-trl-cta-trilha {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dh-trl-cta-trilha:hover,
.dh-trl-cta-trilha:focus { background: #2855d4; color: #fff; }

/* Closing */
.dh-trl-closing {
    text-align: center;
    padding: 18px 20px;
    margin-top: 16px;
    background: #f0f4ff;
    border-radius: 12px;
    color: #1e3a8a;
}

.dh-trl-closing-line {
    margin: 0 0 8px;
    font-size: 0.86rem;
    line-height: 1.6;
    font-weight: 600;
}

.dh-trl-closing-line:last-child { margin-bottom: 0; }

/* Results-only mode: hide form, keep header + results */
.dh-trl-card--results-only .dh-trl-info,
.dh-trl-card--results-only .dh-trl-support,
.dh-trl-card--results-only .dh-trl-section-title,
.dh-trl-card--results-only .dh-trl-question,
.dh-trl-card--results-only .dh-trl-scale-legend,
.dh-trl-card--results-only .dh-trl-actions,
.dh-trl-card--results-only .dh-trl-error { display: none; }

.dh-trl-redo {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    background: transparent;
    color: #346af1;
    border: 2px solid #346af1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.dh-trl-redo:hover {
    background: #346af1;
    color: #fff;
}

/* Missing/unanswered highlight */
.dh-trl-question--missing {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Responsive */
@media (max-width: 600px) {
    .dh-trl-options--scale { grid-template-columns: repeat(2, 1fr); }
    .dh-trl-level-score { font-size: 2rem; }
    .dh-trl-scale-items { flex-direction: column; gap: 4px; }
    .dh-trl-section-title { flex-direction: column; gap: 2px; }
}
