/* RoomUpItalia — Documenti legali pubblici e gestione amministrativa */

.legal-page,
.legal-admin-page {
    width: min(1180px, calc(100% - 24px));
    margin: 24px auto 56px;
}

.legal-page__shell {
    max-width: 900px;
    margin: 0 auto;
}

.legal-page__header,
.legal-content,
.legal-unavailable,
.legal-document-card,
.legal-editor-card,
.legal-editor-status,
.legal-preview,
.legal-admin-note,
.legal-editor-warning {
    border: 1px solid #dce3ee;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

.legal-page__header {
    padding: 24px;
    background: linear-gradient(145deg, #eff6ff, #ffffff 68%);
}

.legal-page__eyebrow,
.legal-document-card__label {
    margin: 0 0 8px;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.legal-page__header h1,
.legal-admin-header h1,
.legal-document-card h2 {
    margin: 0;
    color: #0f172a;
    letter-spacing: -0.03em;
}

.legal-page__header h1 {
    font-size: clamp(32px, 7vw, 52px);
    line-height: 1.05;
}

.legal-page__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.legal-page__meta span {
    padding: 7px 10px;
    border-radius: 999px;
    background: #e8eef8;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.legal-page__meta .legal-page__meta-archived {
    background: #fef3c7;
    color: #92400e;
}

.legal-content {
    margin-top: 18px;
    padding: 24px;
    color: #334155;
    font-size: 15px;
    line-height: 1.75;
}

.legal-content h2,
.legal-content h3 {
    color: #0f172a;
    line-height: 1.25;
}

.legal-content h2 {
    margin: 32px 0 12px;
    font-size: 24px;
}

.legal-content h2:first-child {
    margin-top: 0;
}

.legal-content h3 {
    margin: 24px 0 10px;
    font-size: 18px;
}

.legal-content p,
.legal-content ul,
.legal-content ol {
    margin: 0 0 16px;
}

.legal-content ul,
.legal-content ol {
    padding-left: 22px;
}

.legal-content li + li {
    margin-top: 7px;
}

.legal-content hr {
    margin: 28px 0;
    border: 0;
    border-top: 1px solid #dce3ee;
}

.legal-page__footer {
    padding: 18px 6px 0;
    color: #64748b;
    font-size: 14px;
}

.legal-page__footer a,
.legal-editor-status a,
.legal-back-link {
    color: #1d4ed8;
    font-weight: 700;
}

.legal-unavailable {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 18px;
    padding: 22px;
    border-color: #fde68a;
    background: #fffbeb;
}

.legal-unavailable img,
.legal-admin-note img,
.legal-editor-warning img {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    filter: brightness(0);
}

.legal-unavailable h2,
.legal-unavailable p {
    margin: 0;
}

.legal-unavailable p {
    margin-top: 6px;
    color: #78350f;
    line-height: 1.55;
}

.legal-admin-header {
    margin-bottom: 20px;
}

.legal-admin-header p:last-child {
    max-width: 720px;
}

.legal-admin-header--editor {
    display: block;
}

.legal-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    text-decoration: none;
}

.legal-back-link img {
    width: 18px;
    height: 18px;
    filter: brightness(0);
}

.legal-admin-alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 14px;
    font-weight: 700;
}

.legal-admin-alert--success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.legal-admin-alert--error {
    border-color: #fecaca;
    background: #fff1f2;
    color: #991b1b;
}

.legal-document-grid,
.legal-editor-layout {
    display: grid;
    gap: 18px;
}

.legal-document-card {
    padding: 20px;
}

.legal-document-card__top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.legal-document-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 15px;
    background: #eff6ff;
}

.legal-document-card__icon img {
    width: 24px;
    height: 24px;
    filter: brightness(0);
}

.legal-document-card h2 {
    font-size: 23px;
}

.legal-document-status {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.legal-document-status div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf1f6;
}

.legal-document-status dt {
    color: #64748b;
}

.legal-document-status dd {
    margin: 0;
    color: #0f172a;
    font-weight: 800;
    text-align: right;
}

.legal-document-card__warning {
    padding: 12px 14px;
    border: 1px solid #fde68a;
    border-radius: 12px;
    background: #fffbeb;
    color: #92400e;
    font-size: 14px;
    line-height: 1.5;
}

.legal-document-card__actions,
.legal-editor-actions {
    display: grid;
    gap: 10px;
}

.legal-document-card__actions a,
.legal-editor-actions button {
    justify-content: center;
    text-align: center;
}

.legal-history {
    margin-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.legal-history summary,
.legal-preview summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0 0;
    color: #0f172a;
    font-weight: 800;
    cursor: pointer;
}

.legal-history__body {
    display: grid;
    gap: 10px;
    padding-top: 14px;
}

.legal-history__item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border-radius: 12px;
    background: #f8fafc;
}

.legal-history__item strong,
.legal-history__item small {
    display: block;
}

.legal-history__item small,
.legal-history__item time {
    color: #64748b;
    font-size: 12px;
}

.legal-history__actions {
    display: grid;
    justify-items: end;
    gap: 4px;
}

.legal-history__actions a {
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.legal-history__actions a:hover,
.legal-history__actions a:focus-visible {
    text-decoration: underline;
}

.legal-editor-card {
    padding: 20px;
}

.legal-editor-grid {
    display: grid;
    gap: 16px;
}

.legal-field {
    display: grid;
    gap: 7px;
}

.legal-field--content {
    margin-top: 18px;
}

.legal-field label {
    color: #0f172a;
    font-weight: 800;
}

.legal-field input,
.legal-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #b8c5d8;
    border-radius: 13px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
}

.legal-field input {
    min-height: 46px;
    padding: 10px 12px;
}

.legal-field textarea {
    min-height: 520px;
    padding: 14px;
    line-height: 1.55;
    resize: vertical;
}

.legal-field input:focus,
.legal-field textarea:focus {
    border-color: #2563eb;
    outline: 3px solid rgba(37, 99, 235, 0.16);
}

.legal-field__hint,
.legal-field__error {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.legal-field__hint {
    color: #64748b;
}

.legal-field__error {
    color: #b91c1c;
    font-weight: 700;
}

.legal-field__hint code {
    padding: 2px 5px;
    border-radius: 5px;
    background: #eef2f7;
}

.legal-editor-actions {
    margin-top: 20px;
}

.legal-editor-side {
    display: grid;
    align-content: start;
    gap: 16px;
}

.legal-editor-status,
.legal-editor-warning {
    padding: 18px;
}

.legal-editor-status h2,
.legal-editor-status p {
    margin: 0;
}

.legal-editor-status p + a,
.legal-editor-status h2 + p {
    display: block;
    margin-top: 8px;
}

.legal-editor-status__warning {
    color: #92400e;
}

.legal-preview {
    overflow: hidden;
}

.legal-preview summary {
    padding: 16px 18px;
}

.legal-preview__body {
    max-height: 620px;
    margin: 0;
    overflow: auto;
    border: 0;
    border-top: 1px solid #e2e8f0;
    border-radius: 0;
    box-shadow: none;
}

.legal-admin-note,
.legal-editor-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 18px;
    color: #475569;
    line-height: 1.55;
}

.legal-editor-warning {
    margin-top: 0;
    border-color: #fde68a;
    background: #fffbeb;
    color: #78350f;
}

.legal-admin-note p,
.legal-editor-warning p {
    margin: 0;
}

@media (min-width: 720px) {
    .legal-page,
    .legal-admin-page {
        width: min(1180px, calc(100% - 48px));
        margin-top: 34px;
    }

    .legal-page__header,
    .legal-content {
        padding: 34px;
    }

    .legal-document-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .legal-editor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .legal-field--wide {
        grid-column: 1 / -1;
    }

    .legal-document-card__actions,
    .legal-editor-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1020px) {
    .legal-editor-layout {
        grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
        align-items: start;
    }

    .legal-editor-side {
        position: sticky;
        top: 24px;
    }
}

.legal-compliance {
    overflow: hidden;
    border: 1px solid #dce3ee;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

.legal-compliance summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    color: #0f172a;
    font-weight: 800;
    cursor: pointer;
}

.legal-compliance summary span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: #334155;
    font-size: 12px;
}

.legal-compliance[open] summary {
    border-bottom: 1px solid #e2e8f0;
}

.legal-compliance__body {
    padding: 18px;
    color: #475569;
    font-size: 14px;
    line-height: 1.55;
}

.legal-compliance__body p,
.legal-compliance__body ul,
.legal-compliance__body h3 {
    margin: 0;
}

.legal-compliance__body ul {
    padding-left: 20px;
}

.legal-compliance__body p + ul,
.legal-compliance__body ul + h3,
.legal-compliance__body p + h3,
.legal-placeholder-list + h3 {
    margin-top: 14px;
}

.legal-compliance__body li + li {
    margin-top: 6px;
}

.legal-compliance__body h3 {
    color: #0f172a;
    font-size: 14px;
}

.legal-compliance__success {
    padding: 12px 14px;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    background: #f0fdf4;
    color: #166534;
    font-weight: 700;
}

.legal-placeholder-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.legal-placeholder-list code {
    max-width: 100%;
    padding: 6px 8px;
    overflow-wrap: anywhere;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 11px;
}

.legal-content a {
    color: #1d4ed8;
    font-weight: 700;
    text-underline-offset: 3px;
}

.legal-content a:hover,
.legal-content a:focus-visible {
    text-decoration-thickness: 2px;
}

.legal-version-picker {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid #dce3ee;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

.legal-version-picker label {
    display: block;
    color: #0f172a;
    font-weight: 800;
}

.legal-version-picker p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.legal-version-picker__controls {
    display: grid;
    gap: 10px;
}

.legal-version-picker select {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    border: 1px solid #b8c5d8;
    border-radius: 13px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    padding: 10px 12px;
}

.legal-admin-alert--info {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

.legal-version-summary__list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.legal-version-summary__item {
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #0f172a;
    text-decoration: none;
}

.legal-version-summary__item:hover,
.legal-version-summary__item:focus-visible,
.legal-version-summary__item.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    outline: none;
}

.legal-version-status {
    display: inline-flex;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.legal-version-status--draft {
    background: #fef3c7;
    color: #92400e;
}

.legal-version-status--published {
    background: #dcfce7;
    color: #166534;
}

.legal-version-status--archived {
    background: #eef2f7;
    color: #475569;
}

@media (min-width: 720px) {
    .legal-version-picker {
        grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
        align-items: end;
    }

    .legal-version-picker__controls {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
}


/* RoomUpItalia Professional v1 - v302
 * Le pagine legali restano pubbliche per i visitatori non autenticati.
 * Se l'utente e' autenticato vengono renderizzate nel workspace condiviso
 * con header/sidebar del profilo operativo e lo stesso linguaggio grafico
 * delle altre pagine private.
 */
body.owner-workspace-sidebar-active.page-legal {
    background: #ffffff;
}

body.owner-workspace-sidebar-active.page-legal .owner-workspace-shell__workspace,
body.owner-workspace-sidebar-active.page-legal .owner-workspace-shell__main {
    background: #ffffff;
}

body.owner-workspace-sidebar-active.page-legal .legal-page {
    width: min(calc(100% - 40px), 1540px);
    margin: 24px auto 40px;
}

body.owner-workspace-sidebar-active.page-legal .legal-page__shell {
    width: 100%;
    max-width: none;
    margin: 0;
}

body.owner-workspace-sidebar-active.page-legal .legal-page__header,
body.owner-workspace-sidebar-active.page-legal .legal-content,
body.owner-workspace-sidebar-active.page-legal .legal-unavailable {
    border-color: #dce2ea;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: none;
}

body.owner-workspace-sidebar-active.page-legal .legal-page__header {
    padding: 20px 22px;
    background: #ffffff;
}

body.owner-workspace-sidebar-active.page-legal .legal-page__eyebrow {
    color: #0b57d0;
}

body.owner-workspace-sidebar-active.page-legal .legal-page__header h1 {
    color: #111827;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.15;
}

body.owner-workspace-sidebar-active.page-legal .legal-page__meta span {
    border: 1px solid #dce2ea;
    border-radius: 999px;
    background: #f6f8fb;
    color: #475467;
}

body.owner-workspace-sidebar-active.page-legal .legal-content {
    margin-top: 14px;
    padding: 22px;
    color: #344054;
    font-size: 14px;
    line-height: 1.7;
}

body.owner-workspace-sidebar-active.page-legal .legal-content h2,
body.owner-workspace-sidebar-active.page-legal .legal-content h3 {
    color: #111827;
}

body.owner-workspace-sidebar-active.page-legal .legal-page__footer {
    padding: 16px 2px 0;
    color: #667085;
}

body.owner-workspace-sidebar-active.page-legal .legal-page__footer a,
body.owner-workspace-sidebar-active.page-legal .legal-content a {
    color: #0b57d0;
}

@media (max-width: 820px) {
    body.owner-workspace-sidebar-active.page-legal .legal-page {
        width: min(calc(100% - 20px), 1540px);
        margin: 14px auto 28px;
    }

    body.owner-workspace-sidebar-active.page-legal .legal-page__header,
    body.owner-workspace-sidebar-active.page-legal .legal-content {
        padding: 16px;
    }
}

/* ======================================================================
   v682-23 — Legal Document Builder
   ====================================================================== */
.legal-builder-page {
    width: min(1560px, calc(100% - 30px));
}

.legal-builder-form {
    display: grid;
    gap: 14px;
}

.legal-builder-meta {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(180px, 0.55fr) minmax(180px, 0.55fr);
    gap: 14px;
}

.legal-builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(340px, 0.75fr);
    gap: 16px;
    align-items: start;
}

.legal-builder-main,
.legal-builder-side {
    min-width: 0;
    display: grid;
    gap: 14px;
}

.legal-builder-side {
    position: sticky;
    top: 18px;
}

.legal-builder-panel-header,
.legal-variable-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.legal-builder-panel-header h2,
.legal-variable-panel__header h2 {
    margin: 2px 0 0;
    font-size: 1rem;
}

.legal-builder-panel-header p,
.legal-variable-panel__header p {
    margin: 4px 0 0;
}

.legal-builder-add {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legal-builder-add img {
    width: 15px;
    height: 15px;
}

.legal-section-list {
    display: grid;
    gap: 10px;
}

.legal-section-card {
    min-width: 0;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.legal-section-card.is-dragging {
    opacity: .58;
    border-color: #60a5fa;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
}

.legal-section-card__header {
    display: grid;
    grid-template-columns: 34px 28px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #e7edf5;
    background: #f8fafc;
}

.legal-section-drag,
.legal-section-actions button {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    min-height: 30px;
    padding: 5px 7px;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    background: #ffffff;
    color: #172033;
    font: inherit;
    font-size: .68rem;
    font-weight: 750;
    cursor: pointer;
}

.legal-section-drag {
    cursor: grab;
}

.legal-section-drag:active {
    cursor: grabbing;
}

.legal-section-drag img,
.legal-section-actions img {
    width: 14px;
    height: 14px;
}

.legal-section-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.legal-section-actions button:disabled {
    opacity: .4;
    cursor: default;
}

.legal-section-order {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 999px;
    background: #eaf2ff;
    color: #0b57d0;
    font-size: .7rem;
    font-weight: 850;
}

.legal-section-title-wrap {
    min-width: 0;
}

.legal-section-title-wrap label {
    display: grid;
    gap: 3px;
    color: #64748b;
    font-size: .64rem;
    font-weight: 750;
}

.legal-section-title-wrap input {
    min-width: 0;
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid #d7e0eb;
    border-radius: 7px;
    background: #ffffff;
    color: #172033;
    font-weight: 750;
}

.legal-section-card > textarea {
    display: block;
    width: 100%;
    min-height: 180px;
    margin: 0;
    padding: 13px 14px;
    border: 0;
    border-radius: 0;
    resize: vertical;
    color: #24344d;
    background: #ffffff;
    font: inherit;
    font-size: .78rem;
    line-height: 1.55;
}

.legal-section-card > textarea:focus {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.legal-variable-panel {
    max-height: calc(100vh - 36px);
    overflow: auto;
}

.legal-variable-counter {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    min-width: 48px;
    min-height: 30px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: .72rem;
    font-weight: 850;
}

.legal-variable-counter.is-complete {
    background: #ecfdf3;
    color: #047857;
}

.legal-variable-intro,
.legal-variable-empty {
    margin: 0 0 12px;
    color: #64748b;
    font-size: .72rem;
    line-height: 1.45;
}

.legal-variable-list {
    display: grid;
    gap: 9px;
}

.legal-variable-row {
    display: grid;
    gap: 9px;
    padding: 11px;
    border: 1px solid #dbe3ee;
    border-left: 3px solid #16a34a;
    border-radius: 10px;
    background: #ffffff;
}

.legal-variable-row.is-missing {
    border-left-color: #dc2626;
    background: #fffafa;
}

.legal-variable-row__top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.legal-variable-row__top > div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.legal-variable-row__top strong {
    color: #172033;
    font-size: .74rem;
    line-height: 1.25;
}

.legal-variable-row__top code {
    min-width: 0;
    color: #52657e;
    font-size: .62rem;
    overflow-wrap: anywhere;
}

.legal-variable-row__top > span {
    flex: 0 0 auto;
    color: #64748b;
    font-size: .62rem;
    font-weight: 750;
}

.legal-variable-row label {
    display: grid;
    gap: 4px;
    color: #475569;
    font-size: .64rem;
    font-weight: 750;
}

.legal-variable-row textarea,
.legal-variable-row select {
    width: 100%;
    min-width: 0;
    border: 1px solid #d7e0eb;
    border-radius: 8px;
    background: #ffffff;
    color: #172033;
    font: inherit;
}

.legal-variable-row textarea {
    min-height: 56px;
    padding: 8px;
    resize: vertical;
}

.legal-variable-row select {
    min-height: 36px;
    padding: 6px 8px;
}

.legal-variable-usage {
    color: #64748b;
    font-size: .61rem;
    line-height: 1.4;
}

.legal-variable-snapshot-note {
    margin-top: 12px;
    padding: 10px;
    border-radius: 9px;
    background: #eff6ff;
    color: #475569;
}

.legal-variable-snapshot-note strong {
    color: #0b57d0;
    font-size: .7rem;
}

.legal-variable-snapshot-note p {
    margin: 3px 0 0;
    font-size: .65rem;
    line-height: 1.4;
}

.legal-builder-actions {
    position: sticky;
    z-index: 30;
    bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 11px 13px;
    border: 1px solid #cbd8e8;
    border-radius: 12px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 12px 34px rgba(15,23,42,.14);
    backdrop-filter: blur(10px);
}

.legal-builder-actions > div:first-child {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.legal-builder-actions strong {
    color: #172033;
    font-size: .74rem;
}

.legal-builder-actions span {
    color: #64748b;
    font-size: .65rem;
}

.legal-builder-actions > div:last-child {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
}

@media (max-width: 1120px) {
    .legal-builder-layout {
        grid-template-columns: 1fr;
    }

    .legal-builder-side {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .legal-variable-panel {
        grid-column: 1 / -1;
        max-height: none;
    }
}

@media (max-width: 760px) {
    .legal-builder-page {
        width: calc(100% - 20px);
    }

    .legal-builder-meta,
    .legal-builder-side {
        grid-template-columns: 1fr;
    }

    .legal-section-card__header {
        grid-template-columns: 34px 28px minmax(0, 1fr);
    }

    .legal-section-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .legal-builder-panel-header,
    .legal-variable-panel__header,
    .legal-builder-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .legal-builder-add {
        width: 100%;
        justify-content: center;
    }

    .legal-builder-actions {
        position: static;
        backdrop-filter: none;
    }

    .legal-builder-actions > div:last-child {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .legal-builder-actions button {
        width: 100%;
    }
}

