/* TreeCookie banner — base */
.tc-root,
.tc-prefs {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--tc-text);
    --tc-z: 2147483000;
}

.tc-root {
    position: fixed;
    z-index: var(--tc-z);
    pointer-events: none;
}
.tc-root .tc-card,
.tc-root .tc-overlay { pointer-events: auto; }

.tc-card {
    background: var(--tc-bg);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    padding: 20px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .04);
}
.tc-title { margin: 0 0 8px; font-size: 16px; font-weight: 600; line-height: 1.3; }
.tc-desc  { margin: 0 0 12px; font-size: 13px; line-height: 1.55; opacity: .85; }
.tc-links { margin: 0 0 16px; font-size: 12px; opacity: .75; }
.tc-links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.tc-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.tc-btn {
    appearance: none;
    border: 1px solid var(--tc-border);
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 9px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .05s, filter .15s;
    line-height: 1;
}
.tc-btn:hover  { background: rgba(0, 0, 0, .04); }
.tc-btn:active { transform: translateY(1px); }
.tc-btn-primary {
    background: var(--tc-accent);
    color: var(--tc-accent-text);
    border-color: var(--tc-accent);
}
.tc-btn-primary:hover { filter: brightness(.95); background: var(--tc-accent); }

/* ---------- Layout: card (default) ---------- */
.tc-layout-card {
    max-width: 420px;
    width: calc(100% - 32px);
    margin: 16px;
}
.tc-layout-card.tc-pos-bottom-left   { bottom: 0; left: 0; }
.tc-layout-card.tc-pos-bottom-right  { bottom: 0; right: 0; }
.tc-layout-card.tc-pos-bottom-center { bottom: 0; left: 50%; transform: translateX(-50%); margin: 16px auto; }
.tc-layout-card.tc-pos-top           { top: 0; left: 50%; transform: translateX(-50%); margin: 16px auto; }

/* ---------- Layout: bar (full width bottom/top) ---------- */
.tc-layout-bar { left: 0; right: 0; }
.tc-layout-bar.tc-pos-top { top: 0; }
.tc-layout-bar:not(.tc-pos-top) { bottom: 0; }
.tc-layout-bar .tc-card {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 16px clamp(20px, 5vw, 64px);
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.tc-layout-bar .tc-card-body { flex: 1 1 320px; min-width: 280px; }
.tc-layout-bar .tc-title { font-size: 15px; margin-bottom: 4px; }
.tc-layout-bar .tc-desc  { margin-bottom: 6px; }
.tc-layout-bar .tc-actions { flex: 0 0 auto; }

/* ---------- Layout: modal ---------- */
.tc-layout-modal {
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tc-layout-modal .tc-overlay {
    position: absolute;
    inset: 0;
    background: var(--tc-overlay);
    backdrop-filter: blur(2px);
}
.tc-layout-modal .tc-card {
    position: relative;
    z-index: 1;
    width: min(480px, calc(100% - 32px));
    margin: 16px;
}

/* ---------- Preferences modal ---------- */
.tc-prefs {
    position: fixed;
    inset: 0;
    z-index: calc(var(--tc-z) + 10);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tc-prefs .tc-overlay {
    position: absolute;
    inset: 0;
    background: var(--tc-overlay);
    backdrop-filter: blur(2px);
}
.tc-modal {
    position: relative;
    z-index: 1;
    width: min(560px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    background: var(--tc-bg);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    box-shadow: 0 24px 48px rgba(15, 23, 42, .18), 0 4px 12px rgba(15, 23, 42, .08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.tc-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--tc-border);
}
.tc-modal-head .tc-title { margin: 0; }
.tc-close {
    appearance: none;
    background: transparent;
    border: 0;
    font-size: 22px;
    line-height: 1;
    color: inherit;
    opacity: .6;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.tc-close:hover { opacity: 1; background: rgba(0, 0, 0, .05); }

.tc-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--tc-border);
    border-radius: 10px;
}
.tc-row-meta { display: flex; flex-direction: column; gap: 2px; }
.tc-row-label { font-size: 14px; font-weight: 500; }
.tc-row-desc  { font-size: 12px; opacity: .7; line-height: 1.4; }

.tc-switch {
    position: relative;
    width: 38px; height: 22px;
    flex-shrink: 0;
}
.tc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.tc-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background .2s;
    cursor: pointer;
}
.tc-slider::before {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.tc-switch input:checked + .tc-slider { background: var(--tc-accent); }
.tc-switch input:checked + .tc-slider::before { transform: translateX(16px); }
.tc-switch input:disabled + .tc-slider { opacity: .55; cursor: not-allowed; }

.tc-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--tc-border);
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
    .tc-layout-card { width: calc(100% - 24px); margin: 12px; }
    .tc-layout-bar .tc-card { flex-direction: column; align-items: stretch; padding: 16px 20px; }
    .tc-layout-bar .tc-actions { justify-content: stretch; }
    .tc-layout-bar .tc-actions .tc-btn { flex: 1 1 0; }
    .tc-actions .tc-btn { flex: 1 1 auto; }
}
