.sox-client:not(.management-mode) {
    --sox-primary: #8f2942;
    --sox-canvas: #faf6f2;
    --sox-surface: #fff;
    --sox-text: #2e2a2b;
    --sox-text-muted: #665558;
    --sox-border: #ded1ce;
    --sox-client-blush: #f5e5e9;
    --sox-success: #2e7d54;
    color: var(--sox-text);
    background: var(--sox-canvas);
}

.sox-client:not(.management-mode) #main-content :focus-visible {
    outline: 2px solid var(--sox-primary);
    outline-offset: 2px;
}

.sox-client .sox-help-action:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.sox-client .sox-help-action svg {
    width: 1.05em;
    height: 1.05em;
    flex: none;
}

.sox-client:not(.management-mode) .app-navigation nav[aria-label="Menú principal"] > a {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.sox-client:not(.management-mode) .app-navigation nav[aria-label="Menú principal"] > a svg {
    width: 1.1em;
    height: 1.1em;
    flex: none;
}

.sox-client .workspace-events { display: grid; gap: 7px; padding: 0; margin: 0; list-style: none; }
.sox-client .workspace-events a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 5px 12px;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--sox-border);
    border-radius: 11px;
    background: var(--sox-surface);
    color: var(--sox-text);
    text-decoration: none;
    overflow-wrap: anywhere;
}
.sox-client .workspace-events a:hover { border-color: var(--sox-primary); }
.sox-client .workspace-events small { display: block; }
.sox-client .workspace-events :is(small, .workspace-event-state) { color: var(--sox-text-muted); font-size: .875rem; }
.sox-client .workspace-date {
    display: grid;
    place-items: center;
    align-self: center;
    min-width: 38px;
    padding: 5px;
    border-radius: 7px;
    line-height: 1.15;
    background: var(--sox-client-blush);
    color: var(--sox-primary);
}
.sox-client .workspace-date span { font-size: .75rem; }
.sox-client .workspace-empty { color: var(--sox-text-muted); }

@media (max-width: 680px) {
    .sox-client .workspace-events a { grid-template-columns: auto minmax(0, 1fr); }
    .sox-client .workspace-event-state { grid-column: 2; }
}

.sox-access #main-content {
    max-width: 56rem;
    margin: auto;
    width: 100%;
}

.sox-access-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 1rem;
    align-items: stretch;
}

.sox-access-brand {
    display: grid;
    justify-items: center;
    align-content: center;
    text-align: center;
    padding: 1.5rem;
    gap: .5rem;
    border-radius: 1rem;
    color: var(--sox-primary);
    background: var(--sox-client-blush);
}

.sox-access-brand img {
    width: min(100%, 11rem);
    height: auto;
}

.sox-access-brand p {
    margin: 0;
    font-weight: 700;
}

.sox-access-form {
    min-width: 0;
    margin: 0;
    padding: clamp(1.125rem, 4vw, 2.5rem);
    overflow-wrap: anywhere;
}

.sox-access-form :is(input:not([type="checkbox"]), button) {
    max-width: 100%;
    min-height: 44px;
}

.sox-access-form .sox-access-link {
    margin: 1rem 0 0;
}

.sox-access-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
}

.sox-create {
    margin-bottom: 1.25rem;
    scroll-margin-top: 6rem;
}

.sox-create > header {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: .75rem;
}

.sox-create > header img {
    border-radius: 50%;
    object-fit: cover;
    background: var(--sox-client-blush);
}

.sox-create > header :is(h2, p) {
    margin: 0;
}

.sox-formats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
    gap: .6rem;
}

.sox-formats :is(a, .sox-format-unavailable) {
    display: grid;
    align-content: start;
    gap: .3rem;
    padding: .8rem;
    border: 1px solid var(--sox-border);
    border-radius: .75rem;
    background: var(--sox-surface);
    color: var(--sox-primary);
    font-weight: 700;
    text-decoration: none;
}

.sox-formats .sox-format-unavailable {
    color: var(--sox-text-muted);
    background: #f3ebe5;
}

.sox-formats a:hover {
    background: var(--sox-client-blush);
    border-color: var(--sox-primary);
}

.sox-formats span {
    color: var(--sox-text-muted);
    font-size: .875rem;
    font-weight: 400;
}

.sox-create-more {
    margin-bottom: 1rem;
}

.sox-create-more summary {
    padding-block: .55rem;
    font-weight: 700;
    color: var(--sox-primary);
}

.sox-create-more .sox-create {
    margin: .75rem 0;
}

.sox-client:not(.management-mode) .sox-review-media {
    padding: clamp(.75rem, 2vw, 1.25rem);
    border: 1px solid var(--sox-border);
    border-radius: .9rem;
    background: #f3ebe5;
    margin-block: .75rem 1rem;
    min-width: 0;
}

.sox-client:not(.management-mode) .sox-review-media .card {
    margin-bottom: 0;
}

.sox-client:not(.management-mode) .sox-review-media > iframe {
    display: block;
    width: 100%;
    height: 34rem;
    border: 1px solid var(--sox-border);
    border-radius: .65rem;
    background: var(--sox-surface);
}

.publication-editor {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
}

.publication-editor > .publication-preview {
    flex: 2 1 28rem;
    min-width: 0;
}

.publication-editor > .publication-controls {
    flex: 1 1 22rem;
    min-width: 0;
}

.publication-controls .publication-action {
    border-top: 1px solid var(--sox-border);
    padding-block: .85rem;
}

.publication-controls .publication-action > h3 {
    font-size: .95rem;
    margin: 0 0 .55rem;
}

.publication-controls .publication-action :is(details, form, p) {
    margin-block: .55rem;
}

.publication-controls .publication-action > :last-child {
    margin-bottom: 0;
}

.publication-controls .publication-action summary {
    padding-block: .4rem;
}

.publication-controls fieldset {
    min-width: 0;
}

#aprobar-propuesta, .publication-action > h3[id] {
    scroll-margin-top: 6rem;
}

.publication-controls .publication-action form > div:has(> label) {
    margin-block: .6rem;
}

.publication-control-links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-block: .6rem;
}

@media (min-width: 820px) {
    .publication-editor > .publication-controls {
        order: -1;
    }
}

@media (max-width: 767px) {
    body.sox-client:has(.conversation-shell) {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    body.sox-client:has(.conversation-shell) > .shell {
        flex: 1 0 auto;
    }

    body.sox-client:has(.conversation-shell) main {
        overflow: visible;
    }

    .sox-client .conversation-layout,
    .sox-client .conversation-stream {
        flex: 0 0 auto;
    }

    .sox-client .conversation-shell {
        height: auto;
    }

    .sox-client .conversation-shell .conversation-stream {
        max-height: 56dvh;
    }
}

@media (max-width: 620px) {
    .sox-access-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .sox-access-brand {
        grid-row: 2;
        padding: .75rem;
    }

    .sox-access-brand img {
        width: 4rem;
    }
}
