.ttc-layer[hidden],
.ttc-open-settings[hidden],
#ttc-summary-view[hidden],
#ttc-settings-view[hidden] {
    display: none !important;
}

body.ttc-modal-open {
    overflow: hidden;
}

.ttc-layer {
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(7, 12, 22, 0.76);
    backdrop-filter: blur(4px);
}

.ttc-dialog {
    width: min(760px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
    padding: clamp(24px, 4vw, 38px);
    border: 1px solid rgba(15, 23, 42, 0.2);
    border-radius: 18px;
    background: #fff;
    color: #111827;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
    font: 400 16px/1.55 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ttc-dialog:focus {
    outline: none;
}

.ttc-dialog h2 {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: clamp(24px, 4vw, 32px);
    line-height: 1.2;
}

.ttc-dialog p {
    margin: 0 0 16px;
    color: #334155;
}

.ttc-legal-link a {
    color: #6f3f24;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ttc-choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.ttc-dialog button,
.ttc-open-settings {
    min-height: 48px;
    padding: 11px 16px;
    border: 2px solid #172033;
    border-radius: 10px;
    background: #fff;
    color: #172033;
    cursor: pointer;
    font: 700 15px/1.25 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ttc-dialog button:hover,
.ttc-dialog button:focus-visible,
.ttc-open-settings:hover,
.ttc-open-settings:focus-visible {
    outline: 3px solid #c89b7c;
    outline-offset: 2px;
    background: #172033;
    color: #fff;
}

.ttc-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 16px 0;
    padding: 18px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.ttc-category strong,
.ttc-category small {
    display: block;
}

.ttc-category small,
.ttc-category p {
    margin: 4px 0 0;
    color: #475569;
    font-size: 14px;
}

.ttc-category-required > span {
    flex: 0 0 auto;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.ttc-category input[type="checkbox"] {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    accent-color: #172033;
}

.ttc-settings-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.ttc-open-settings {
    position: fixed;
    z-index: 2147482999;
    left: 16px;
    bottom: 16px;
    min-height: 42px;
    padding: 8px 13px;
    border-width: 1px;
    border-radius: 999px;
    background: #172033;
    color: #fff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    font-size: 13px;
}

.ttc-noscript {
    padding: 10px;
    background: #f8fafc;
    color: #334155;
    text-align: center;
    font-size: 13px;
}

@media (max-width: 700px) {
    .ttc-layer {
        align-items: end;
        padding: 12px;
    }

    .ttc-dialog {
        max-height: calc(100vh - 24px);
        padding: 22px;
        border-radius: 16px;
    }

    .ttc-choice-grid,
    .ttc-settings-actions {
        grid-template-columns: 1fr;
    }

    .ttc-category {
        gap: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ttc-layer,
    .ttc-dialog,
    .ttc-dialog button {
        scroll-behavior: auto;
        transition: none;
    }
}
