/* Phase 4A - isolated consent UI (TEST MODE). Prefix: adm-ct. Does not touch global.css or fonts (font: inherit). */
.adm-ct { --adm-ct-ink: var(--c-text, #1a2a36); --adm-ct-bg: #fff; --adm-ct-line: var(--c-border, #e6e8ef); --adm-ct-test: #92400e; --adm-ct-focus: #1d4ed8; }
.adm-ct[hidden] { display: none !important; }
.adm-ct, .adm-ct * { box-sizing: border-box; }
.adm-ct button, .adm-ct input, .adm-ct dialog, .adm-ct .adm-ct-pop { font: inherit; color: var(--adm-ct-ink); }
.adm-ct-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Fallback when the Popover API is missing: JS adds .adm-ct--fallback and toggles [data-adm-open] */
.adm-ct--fallback .adm-ct-pop { display: none; position: fixed; z-index: 2147483000; }
.adm-ct--fallback .adm-ct-pop[data-adm-open] { display: block; }
.adm-ct--fallback .adm-ct-chip[data-adm-open] { display: inline-block; }

/* Banner (popover=manual, non-modal, top layer) */
.adm-ct-banner { position: fixed; inset: auto auto 16px 50%; transform: translateX(-50%); margin: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px 22px 18px; background: var(--adm-ct-bg); border: 2px dashed var(--adm-ct-test); border-radius: 14px; box-shadow: 0 12px 40px rgba(6,17,34,.28); }
.adm-ct-badge { display: inline-block; margin: 0 0 8px; padding: 3px 10px; border-radius: 999px; background: var(--adm-ct-test); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.4; }
.adm-ct-title { margin: 0 0 8px; font-size: 1.15rem; line-height: 1.3; color: var(--adm-ct-ink); }
.adm-ct-text { margin: 0 0 14px; font-size: .95rem; line-height: 1.5; color: var(--adm-ct-ink); }
.adm-ct-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.adm-ct-btn { flex: 1 1 170px; min-height: 44px; padding: 10px 14px; border-radius: 10px; border: 2px solid var(--adm-ct-ink); font-size: .95rem; font-weight: 600; cursor: pointer; line-height: 1.2; }
.adm-ct-btn--solid { background: var(--adm-ct-ink); color: #fff !important; }
.adm-ct-btn--ghost { background: #fff; color: var(--adm-ct-ink); }
.adm-ct-btn:hover { filter: brightness(1.15); }
.adm-ct-x { position: absolute; top: 8px; right: 10px; width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.8rem; line-height: 1; cursor: pointer; border-radius: 8px; }
.adm-ct-banner .adm-ct-badge, .adm-ct-banner .adm-ct-title { padding-right: 40px; }

/* Re-open chip (popover=manual) */
.adm-ct-chip { position: fixed; inset: auto auto 12px 50%; transform: translateX(-50%); margin: 0; padding: 8px 14px; min-height: 40px; border-radius: 999px; border: 2px dashed var(--adm-ct-test); background: #fff; color: var(--adm-ct-test) !important; font-size: .85rem; font-weight: 700; cursor: pointer; box-shadow: 0 4px 14px rgba(6,17,34,.22); }

/* Preferences dialog (modal <dialog>) */
.adm-ct-dialog { padding: 0; border: 2px dashed var(--adm-ct-test); border-radius: 14px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); background: var(--adm-ct-bg); overscroll-behavior: contain; }
.adm-ct-dialog::backdrop { background: rgba(6,17,34,.55); }
.adm-ct-dialog__inner { position: relative; padding: 22px 22px 18px; }
.adm-ct-dialog .adm-ct-badge, .adm-ct-dialog .adm-ct-title { padding-right: 40px; }
.adm-ct-cat { border: 0; margin: 0 0 14px; padding: 0; }
.adm-ct-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--adm-ct-line); cursor: pointer; }
.adm-ct-row:last-child { border-bottom: 1px solid var(--adm-ct-line); }
.adm-ct-row__txt { display: flex; flex-direction: column; gap: 2px; }
.adm-ct-row__txt small { color: #475569; font-size: .82rem; line-height: 1.35; }
.adm-ct-switch { appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 52px; height: 30px; margin: 0; border-radius: 999px; background: #64748b; position: relative; cursor: pointer; transition: background .15s; }
.adm-ct-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; }
.adm-ct-switch:checked { background: #166534; }
.adm-ct-switch:checked::after { transform: translateX(22px); }
.adm-ct-switch:disabled { opacity: .6; cursor: not-allowed; }
.adm-ct-msg { margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--adm-ct-test); border-radius: 8px; background: #fffbeb; color: var(--adm-ct-test); font-size: .88rem; line-height: 1.4; }
.adm-ct-foot { margin: 12px 0 0; text-align: center; }
.adm-ct-link { background: none; border: 0; padding: 8px; text-decoration: underline; cursor: pointer; font-size: .9rem; }

.adm-ct button:focus-visible, .adm-ct input:focus-visible { outline: 3px solid var(--adm-ct-focus); outline-offset: 2px; }

@media (max-width: 575.98px) {
  .adm-ct-banner { inset: auto 0 0 0; transform: none; width: 100%; max-height: 88vh; max-height: 88dvh; border-radius: 14px 14px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .adm-ct-btn { flex: 1 1 100%; }
  .adm-ct-chip { inset: auto auto calc(10px + env(safe-area-inset-bottom, 0px)) 50%; }
  .adm-ct-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .adm-ct-dialog__inner { padding: 18px 16px 14px; }
}
@media (prefers-reduced-motion: reduce) { .adm-ct-switch, .adm-ct-switch::after { transition: none; } }
