.legal-calc-shell .legal-form-separator {
    border-top: 1px solid var(--border-color);
    margin: 8px 0 16px;
    opacity: 0.65;
}

.legal-calc-shell .legal-tribunal-group select,
.legal-calc-shell .legal-event-group select {
    width: 100%;
}

.legal-calc-shell .legal-tribunal-fallback-help {
    display: block;
    margin-top: 8px;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--secondary-color);
}

.legal-calc-shell .legal-tribunal-fallback-help a {
    color: var(--button-primary);
    font-weight: 600;
    text-decoration: underline;
}

.legal-calc-shell .legal-extra-options {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legal-calc-shell .legal-extra-switch-box {
    margin: 0;
}

.legal-calc-shell .legal-extra-switch-group {
    display: block;
    padding: 2px 0;
}

.legal-calc-shell .legal-extra-switch {
    margin: 0;
}

.legal-calc-shell .legal-count-mode-group.is-locked .segment-selector {
    pointer-events: none;
    opacity: 0.6;
}

.legal-calc-shell .prazos-calculator-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
}

.legal-calc-shell .legal-options-under-deadline,
.legal-calc-shell .legal-options-under-location {
    margin-top: 2px;
}

.legal-calc-shell .legal-global-location-line {
    margin-top: 6px;
    display: block;
}

.legal-calc-shell .prazos-calendar-column .include-options-details {
    border: 0;
    background: transparent;
    padding: 0;
}

.legal-calc-shell .prazos-calendar-column .include-options-details summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--secondary-color);
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    user-select: none;
}

.legal-calc-shell .prazos-calendar-column .include-options-details summary::-webkit-details-marker {
    display: none;
}

.legal-calc-shell .prazos-calendar-column .include-options-details summary::marker {
    content: "";
}

.legal-calc-shell .prazos-calendar-column .include-options-details[open] > summary {
    margin-bottom: 8px;
}

.legal-calc-shell .prazos-calendar-column .include-options-details[open] .switch-box-container {
    margin-top: 6px;
}

.legal-calc-shell .prazos-calendar-column .include-options-details .switch-label {
    white-space: normal;
}

.legal-calc-shell .legal-custom-exclusions {
    margin-top: 12px;
}

.legal-calc-shell .legal-predefined-deadlines {
    margin-top: 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(10, 85, 170, 0.04), rgba(10, 85, 170, 0.01));
    padding: 18px;
}

.legal-calc-shell .legal-predefined-deadlines > h4 {
    margin: 0 0 8px;
}

.legal-calc-shell .legal-predefined-deadlines > p {
    margin: 0 0 12px;
    color: var(--secondary-color);
}

.legal-calc-shell .legal-predefined-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    background: var(--content-bg);
}

.legal-calc-shell .predefined-deadlines-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.legal-calc-shell .predefined-deadlines-table thead th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(10, 85, 170, 0.06);
    font-weight: 700;
}

.legal-calc-shell .predefined-deadlines-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    vertical-align: top;
}

.legal-calc-shell .predefined-deadlines-table tbody tr:last-child td {
    border-bottom: none;
}

.legal-calc-shell .predefined-deadlines-table .separator-row td {
    background: rgba(0, 0, 0, 0.04);
    font-weight: 700;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.legal-calc-shell .predefined-deadlines-table .date-result {
    white-space: nowrap;
    font-weight: 700;
}

.legal-calc-shell .legal-predefined-btn {
    min-width: 82px;
}

.legal-calc-shell .modal-tribunal-microcard {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(10, 85, 170, 0.25);
    background: rgba(10, 85, 170, 0.06);
}

.legal-calc-shell .modal-tribunal-label {
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    opacity: 0.85;
}

.legal-calc-shell .modal-tribunal-value {
    font-weight: 700;
}

/* Juridico: calendario e localizacao como modal flutuante */
.legal-calc-shell .glass-calendar-card,
.legal-calc-shell .glass-location-card {
    display: none;
}

.legal-calc-shell .glass-calendar-card.is-open,
.legal-calc-shell .glass-location-card.is-open {
    position: fixed;
    inset: 0;
    z-index: 10070;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(20px, 5vh, 44px) 14px 16px;
    background: rgba(15, 23, 42, 0.54);
    backdrop-filter: blur(3px);
    overflow: auto;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.legal-calc-shell .glass-calendar-card.is-open #calcInputCalendarWrapper {
    width: min(760px, 96vw);
    max-height: calc(100dvh - 70px);
    overflow: auto;
    margin: 0;
    padding: 16px;
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}

.legal-calc-shell .glass-location-card.is-open .calc-side-location-panel {
    width: min(920px, 96vw);
    max-height: calc(100dvh - 70px);
    overflow: auto;
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}

body.dark-mode .legal-calc-shell .legal-predefined-table-wrap {
    border-color: rgba(255, 255, 255, 0.16);
}

body.dark-mode .legal-calc-shell .predefined-deadlines-table thead th {
    border-bottom-color: rgba(255, 255, 255, 0.16);
    background: rgba(71, 149, 255, 0.14);
}

body.dark-mode .legal-calc-shell .predefined-deadlines-table tbody td {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .legal-calc-shell .predefined-deadlines-table .separator-row td {
    background: rgba(255, 255, 255, 0.08);
    border-top-color: rgba(255, 255, 255, 0.16);
}

body.dark-mode .legal-calc-shell .modal-tribunal-microcard {
    border-color: rgba(71, 149, 255, 0.35);
    background: rgba(71, 149, 255, 0.16);
}

body.dark-mode .legal-calc-shell .glass-calendar-card.is-open,
body.dark-mode .legal-calc-shell .glass-location-card.is-open {
    background: rgba(2, 6, 23, 0.72);
}

body.dark-mode .legal-calc-shell .glass-calendar-card.is-open #calcInputCalendarWrapper,
body.dark-mode .legal-calc-shell .glass-location-card.is-open .calc-side-location-panel {
    border-color: rgba(148, 163, 184, 0.34);
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.5);
}

.legacy-legal-shell {
    display: none !important;
}

@media (max-width: 900px) {
    .legal-calc-shell .glass-calendar-card.is-open,
    .legal-calc-shell .glass-location-card.is-open {
        padding-top: calc(72px + env(safe-area-inset-top, 0px));
    }

    .legal-calc-shell .prazos-calculator-grid {
        grid-template-columns: 1fr;
    }
}
