.preferences-modal { width: min(1080px, calc(100% - 64px)); max-width: none; margin: clamp(64px, 13vh, 130px) auto auto; max-height: calc(100dvh - 160px); padding: 28px 32px 26px; overflow: visible; border: 0; border-radius: 16px; background: #fff; color: #272c34; box-shadow: 0 20px 90px #0003; }
.preferences-modal::backdrop { background: #0009; }
body:has(.preferences-modal[open]) { overflow: hidden; }
.preferences-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.preferences-heading h2 { font: 550 21px/1.35 Montserrat, Inter, sans-serif; letter-spacing: -.035em; margin: 0; }
.preferences-close { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; margin: -4px -8px 0 0; padding: 0; border: 0; border-radius: 50%; background: #f3f4f6; color: #59606b; font-size: 25px; cursor: pointer; }
.preferences-close:hover { color: #111; }
.preferences-columns { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 28px; margin-top: 28px; }
.preferences-section { min-width: 0; border: 0; padding: 0; margin: 0; }
.preferences-section legend, .preferences-label { display: block; padding: 0; margin-bottom: 14px; font: 600 12px/1.5 Montserrat, Inter, sans-serif; text-transform: uppercase; letter-spacing: .045em; color: #5a616c; }
.preferences-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preference-choice { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding: 10px 12px; border: 1px solid #d8dce2; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; transition: border-color .15s, background .15s; }
.preference-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.preference-choice svg { visibility: hidden; flex-shrink: 0; width: 16px; height: 16px; fill: none; stroke: #1761da; stroke-width: 2; }
.preference-choice:hover { border-color: #8d9bb3; }
.preference-choice:has(:checked) { border-color: #1761da; background: #f7faff; color: #174e9f; box-shadow: inset 0 0 0 .5px #1761da; }
.preference-choice:has(:checked) svg { visibility: visible; }
.preference-choice:has(:focus-visible) { outline: 3px solid #1761da; outline-offset: 3px; }
.preferences-actions { display: flex; justify-content: center; margin-top: 26px; }
.preferences-save { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 10px 20px; border: 0; border-radius: 7px; background: #252b34; color: white; font-size: 13px; font-weight: 600; cursor: pointer; }
.preferences-save:hover { background: #1761da; }
.preferences-error { font-size: 12px; color: #ae263e; }
@media (max-width: 900px) {
    .preferences-modal { width: calc(100% - 40px); padding: 28px; }
    .preferences-columns { gap: 22px; grid-template-columns: 1fr 1fr; }
    .preferences-section:last-child { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
    .preferences-modal { width: calc(100% - 24px); margin-top: 24px; max-height: calc(100dvh - 48px); padding: 24px 20px; overflow-y: auto; }
    .preferences-heading h2 { font-size: 20px; }
    .preferences-columns { display: flex; flex-direction: column; gap: 24px; margin-top: 28px; }
    .preferences-section legend, .preferences-label { margin-bottom: 12px; }
    .preferences-actions { margin-top: 26px; }
    .preferences-save { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .preference-choice { transition: none; } }

.preferences-modal[open] { animation: preferences-appear 240ms cubic-bezier(.2, .75, .25, 1) both; }
.preferences-modal[open]::backdrop { animation: preferences-dim 220ms ease-out both; }
@keyframes preferences-appear {
    from { opacity: 0; transform: translateY(-12px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes preferences-dim {
    from { background-color: #0000; }
    to { background-color: #0009; }
}
@media (prefers-reduced-motion: reduce) {
    .preferences-modal[open], .preferences-modal[open]::backdrop { animation: none; }
}
