.wizard-text-color { margin: .15rem 0 .6rem; }
.wizard-text-color[hidden] { display: none; }
.wizard-text-color summary { display: inline-flex; align-items: center; gap: .45rem; min-height: 36px; cursor: pointer; color: #595959; font-size: .8rem; list-style: none; }
.wizard-text-color summary::-webkit-details-marker { display: none; }
.wizard-text-color__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-color); border: 1px solid #0002; }
.wizard-text-color__chevron { transition: transform .15s; }
.wizard-text-color[open] .wizard-text-color__chevron { transform: rotate(180deg); }
.wizard-text-color__palette { display: flex; flex-wrap: wrap; gap: 2px; padding: 2px 0; }
.wizard-text-color__swatch { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.wizard-text-color__swatch span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--text-color); color: white; }
.wizard-text-color__swatch[data-text-color="#FFFFFF"] span,
.wizard-text-color__swatch[data-text-color="#FBF8D9"] span,
.wizard-text-color__swatch[data-text-color="#FACC15"] span { color: #171717; box-shadow: inset 0 0 0 1px #0003; }
.wizard-text-color__swatch[aria-pressed="true"] span::after { content: '✓'; font-size: 16px; }
.wizard-text-color__swatch:hover { background: #00000008; }
.wizard-text-color summary:focus-visible, .wizard-text-color__swatch:focus-visible { outline: 2px solid #495768; outline-offset: 2px; }
/* Nagłówek koloru jest obok przełącznika; paleta nadal rozwija się pod polami. */
.wizard-text-section { position: relative; margin-bottom: 1rem; min-width: 0; }
.wizard-text-section > .stage3-text-switch { display: flex; align-items: center; gap: .5rem; min-height: 44px; margin: 0; padding-right: 125px; }
.wizard-text-section > .stage3-text-switch .form-check-input { flex-shrink: 0; margin-top: 0; }
.page-stage3 .stage3-couple-text-fields { gap: 0; }
body.wizard-page .wizard-text-section > .attribute-line-group { margin-bottom: 0; }
body.wizard-page .wizard-text-section > .attribute-line-group + .attribute-line-group { margin-top: .375rem; }
/* Wspólny nagłówek wyglądu oraz panele rozwijane pod polem. */
.wizard-text-appearance:has(.wizard-text-color[hidden]) { display: none; }
.wizard-text-section:has(> .wizard-text-appearance .wizard-text-color:not([hidden])) > .stage3-text-switch {
    padding-inline-end: 8.75rem;
}
.wizard-text-appearance > details { margin: 0; }
.wizard-text-appearance > details > summary {
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    min-height: 44px;
    inline-size: 4.125rem;
    padding: .25rem .3rem;
    border: 1px solid #d5e0e8;
    border-radius: 8px;
    background: #fff;
    color: #314a5e;
    cursor: pointer;
    font-size: .75rem;
    list-style: none;
    white-space: nowrap;
}
.wizard-text-appearance > .wizard-text-font > summary { inset-inline-end: 4.375rem; }
.wizard-text-font summary::-webkit-details-marker { display: none; }
.wizard-text-font summary:focus-visible { outline: 2px solid #495768; }
.wizard-text-font[open] .wizard-text-color__chevron { transform: rotate(180deg); }
.wizard-text-font__options {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 3px;
    padding-block: .25rem;
}
body.wizard-page .stage-shell .wizard-text-appearance .wizard-font-label {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: .2rem .1rem;
    font-size: clamp(.65rem, 3vw, .9rem);
    white-space: nowrap;
}
.wizard-text-appearance .wizard-text-color__palette {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 1px;
    padding: 2px;
}
.wizard-text-appearance .wizard-text-color__swatch { width: 100%; }
.wizard-text-appearance .wizard-text-color__swatch span { width: min(100%, 22px); aspect-ratio: 1; height: auto; }
@media (max-width: 575.98px) {
    .wizard-text-appearance .wizard-text-color__swatch span { width: min(100%, 18px); }
    .wizard-text-appearance .wizard-text-color__swatch[aria-pressed="true"] span::after { font-size: 12px; }
}

/* Kompaktowa paleta opisów Oto: jeden rząd również w wąskiej kolumnie. */
body.wizard-project-oto-on.page-stage3 .attribute-description-layout,
body.wizard-project-oto-on.page-stage3 .attribute-description-fields,
body.wizard-project-oto-on.page-stage3 .wizard-text-color {
    min-width: 0;
    max-width: 100%;
}
body.wizard-project-oto-on.page-stage3 .wizard-text-color__palette {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    overflow-x: auto;
    padding: 3px;
}
body.wizard-project-oto-on.page-stage3 .wizard-text-color__swatch {
    flex: 0 0 30px;
    width: 30px;
    height: 32px;
}
body.wizard-project-oto-on.page-stage3 .wizard-text-color__swatch span { width: 22px; height: 22px; }
body.wizard-project-oto-on.page-stage3 .stage-shell--oto-attributes .attribute-description-fields > .attribute-description-title {
    position: relative;
    width: 100%;
    flex-wrap: nowrap;
}
body.wizard-project-oto-on.page-stage3 .attribute-description-title > .wizard-text-color {
    flex-shrink: 0;
    margin: 0;
    text-transform: none;
    font-weight: normal;
}
body.wizard-project-oto-on.page-stage3 .attribute-description-title .wizard-text-color__palette {
    position: absolute;
    inset-block-start: 100%;
    inset-inline-end: 0;
    z-index: 7;
    max-width: 100%;
    border: 1px solid #d5e0e8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 .25rem .75rem #1e304020;
}
@media (pointer: coarse) {
    body.wizard-project-oto-on.page-stage3 .wizard-text-color__swatch { height: 44px; }
}
