.analytics-consent {
    position: fixed;
    z-index: 11000;
    inset: 0;
    box-sizing: border-box;
    width: min(480px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    margin: auto;
    padding: 28px;
    border: 1px solid #c7d3dc;
    border-radius: 12px;
    background: #fff;
    color: #37474f;
    box-shadow: 0 8px 32px rgba(20, 36, 48, 0.2);
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.analytics-consent::backdrop { background: rgba(20, 36, 48, 0.4); }
.analytics-consent:not([open]), .analytics-consent[hidden], .analytics-consent [hidden] { display: none; }
.analytics-consent h2 {
    margin: 0 28px 12px 0;
    color: inherit;
    font-size: 22px;
    line-height: 1.25;
    font-weight: 600;
}
.analytics-consent h2:focus { outline: none; }
.analytics-consent p { margin: 0; }
.analytics-consent a { color: #216899; text-decoration: underline; }
.analytics-consent-actions { display: flex; gap: 8px; margin-top: 22px; }
.analytics-consent-actions button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #9eb5c5;
    border-radius: 6px;
    background: #f1f6f9;
    color: #254b64;
    font: inherit;
    cursor: pointer;
}
.analytics-consent-actions button:hover { background: #e3edf4; }
.analytics-consent-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font: 24px/1 sans-serif;
    cursor: pointer;
}
.analytics-consent-close:hover { background: rgba(128, 128, 128, 0.12); }
.analytics-consent .analytics-consent-details { margin-top: 16px; font-size: 13px; }
.analytics-consent-status:not(:empty) { margin-top: 14px; font-size: 13px; }
.analytics-consent-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding: 16px 0;
    border-top: 1px solid #d6e0e7;
    border-bottom: 1px solid #d6e0e7;
}
.analytics-consent-setting label { font-weight: 600; cursor: pointer; }
.analytics-consent-setting p { margin-top: 3px; font-size: 13px; }
.analytics-consent-setting + .analytics-consent-setting { margin-top: 0; border-top: 0; }
.analytics-consent-required label { cursor: default; }
.analytics-consent-required .analytics-consent-switch { color: #63727d; }
.analytics-consent-switch { display: flex; align-items: center; gap: 8px; }
.analytics-consent-switch span { white-space: nowrap; }
.analytics-consent-switch input {
    appearance: none;
    position: relative;
    flex: 0 0 42px;
    width: 42px;
    height: 24px;
    margin: 0;
    border: 1px solid #788995;
    border-radius: 12px;
    background: #788995;
    cursor: pointer;
}
.analytics-consent-switch input::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
}
.analytics-consent-switch input:checked { background: #216899; border-color: #216899; }
.analytics-consent-switch input:checked::before { transform: translateX(18px); }
.analytics-consent-switch input:disabled { background: #788995; border-color: #788995; opacity: 0.65; cursor: not-allowed; }
.analytics-preferences {
    border: 0;
    padding: 0;
    background: transparent;
    color: #e0e0e0;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
.analytics-preferences:hover { color: #fff; text-decoration: underline; }
.analytics-consent button:focus-visible, .analytics-consent a:focus-visible, .analytics-consent input:focus-visible, .analytics-preferences:focus-visible {
    outline: 2px solid #387eaf;
    outline-offset: 3px;
}
body.dark-mode .analytics-consent { background: #30383e; color: #e0e7eb; border-color: #596770; }
body.dark-mode .analytics-consent a { color: #9dcdf0; }
body.dark-mode .analytics-consent-actions button { background: #38434b; color: #e0e7eb; border-color: #8097a8; }
body.dark-mode .analytics-consent-actions button:hover { background: #455561; }
body.dark-mode .analytics-consent-setting { border-color: #596770; }
body.dark-mode .analytics-consent-required .analytics-consent-switch { color: #b4c0c8; }
body.dark-mode .analytics-consent input:focus-visible { outline-color: #9dcdf0; }
@media (max-width: 480px) {
    .analytics-consent { padding: 24px 20px; }
}
@media print { .analytics-consent, .analytics-consent::backdrop, .analytics-preferences { display: none; } }
