/* ============================================================
   Tektome — Cookie consent
   GDPR / ePrivacy banner. Light mode only, Arch Purple accent,
   Noto Sans + mono eyebrow, 8px card / 6px button radii, brand
   shadow + motion scale. Full-width bottom strip (banner design).
   ============================================================ */

.tkc,
.tkc * {
  box-sizing: border-box;
}

.tkc {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  font-family: var(--font-sans);
  /* Wrapper never eats clicks — only its children do, so the page stays
     interactive for the non-blocking (banner / card) designs. */
  pointer-events: none;
}

/* ---------- Panel (the card) ---------- */
.tkc__panel {
  position: absolute;
  background: var(--color-draft-white);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}
.tkc[data-open="1"] .tkc__panel {
  opacity: 1;
  transform: none;
}

.tkc__inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- Copy block (icon + head) ---------- */
.tkc__copy {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}
.tkc__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--purple-50);
  color: var(--color-arch-purple);
}
.tkc__icon svg {
  width: 21px;
  height: 21px;
  display: block;
}
.tkc__head {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.tkc__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-arch-purple);
  margin: 0;
}
.tkc__title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--fg-primary);
  margin: 0;
}
.tkc__body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-secondary);
  margin: 2px 0 0;
  text-wrap: pretty;
  max-width: 62ch;
}

/* Policy links — own row, each link unbreakable so the sentence above
   never collides with them and "Privacy Policy" / "Data Policy" never
   split mid-phrase. */
.tkc__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  margin: 8px 0 0;
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.4;
}
.tkc__links a {
  color: var(--color-arch-purple);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}
.tkc__links a:hover {
  color: var(--purple-700);
  border-bottom-color: currentColor;
}
.tkc__links-sep {
  color: var(--gray-400);
}

/* ---------- Category list ---------- */
.tkc__cats {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--gray-200);
}
.tkc__cat {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-200);
}
.tkc__cat:last-child {
  border-bottom: 0;
}
.tkc__cat-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tkc__cat-name {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg-primary);
}
.tkc__cat-desc {
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--fg-tertiary);
  text-wrap: pretty;
}

/* ---------- Switch ---------- */
.tkc-switch {
  position: relative;
  flex-shrink: 0;
  appearance: none;
  border: 0;
  width: 42px;
  height: 24px;
  margin-top: 1px;
  border-radius: var(--radius-pill);
  background: var(--gray-400);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
.tkc-switch[data-on="1"] {
  background: var(--color-arch-purple);
}
.tkc-switch[data-locked="1"] {
  cursor: not-allowed;
  background: var(--color-lavender);
}
.tkc-switch[data-locked="1"][data-on="1"] {
  background: var(--purple-300);
}
.tkc-switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-draft-white);
  box-shadow: 0 1px 2px rgba(16, 16, 16, 0.25);
  transition: transform var(--duration-base) var(--ease-out);
}
.tkc-switch[data-on="1"] i {
  transform: translateX(18px);
}
.tkc-switch:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ---------- Actions ---------- */
.tkc__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.tkc-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}
.tkc-btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.tkc-btn--primary {
  background: var(--color-arch-purple);
  color: var(--color-draft-white);
  border-color: var(--color-arch-purple);
}
.tkc-btn--primary:hover {
  background: var(--purple-700);
  border-color: var(--purple-700);
}
.tkc-btn--primary:active {
  background: var(--purple-800);
  border-color: var(--purple-800);
}
.tkc-btn--secondary {
  background: var(--color-draft-white);
  color: var(--fg-primary);
  border-color: var(--gray-300);
}
.tkc-btn--secondary:hover {
  background: var(--color-light-gray);
  border-color: var(--gray-400);
}
.tkc-btn--secondary:active {
  background: var(--gray-200);
}
.tkc-btn--ghost {
  background: transparent;
  color: var(--color-arch-purple);
  border-color: transparent;
  padding: 0 12px;
}
.tkc-btn--ghost:hover {
  background: var(--purple-50);
  color: var(--purple-700);
}

/* ============================================================
   Banner — full-width bottom strip
   ============================================================ */
.tkc[data-design="banner"] .tkc__panel {
  left: 0;
  right: 0;
  bottom: 0;
  border-top: 1px solid var(--gray-200);
  padding: 22px 24px calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateY(14px);
}
.tkc[data-design="banner"] .tkc__inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 16px 48px;
}
.tkc[data-design="banner"] .tkc__copy {
  flex: 1;
}
.tkc[data-design="banner"] .tkc__actions {
  flex-shrink: 0;
  justify-content: flex-end;
}
/* Expanded → categories drop to a full-width grid, actions to their
   own right-aligned row. */
.tkc[data-design="banner"][data-expanded="1"] .tkc__inner {
  flex-direction: column;
  align-items: stretch;
}
.tkc[data-design="banner"][data-expanded="1"] .tkc__cats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  border-top: 1px solid var(--gray-200);
  padding-top: 2px;
}
.tkc[data-design="banner"][data-expanded="1"] .tkc__cat {
  border-bottom: 0;
}
.tkc[data-design="banner"][data-expanded="1"] .tkc__actions {
  justify-content: flex-end;
}

/* ---------- Reopen pill (consent withdrawal entry point) ---------- */
.tkc-reopen {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 2147483500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-pill);
  background: var(--color-draft-white);
  color: var(--fg-secondary);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  pointer-events: auto;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.tkc-reopen:hover {
  color: var(--color-arch-purple);
  border-color: var(--color-arch-purple);
  transform: translateY(-1px);
}
.tkc-reopen:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.tkc-reopen svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .tkc[data-design="banner"] .tkc__inner {
    flex-direction: column;
    align-items: stretch;
  }
  .tkc[data-design="banner"] .tkc__actions {
    justify-content: stretch;
  }
  .tkc[data-design="banner"][data-expanded="1"] .tkc__cats {
    grid-template-columns: 1fr;
  }
  .tkc__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .tkc__actions .tkc-btn {
    width: 100%;
  }
  .tkc[data-design="banner"] .tkc-btn--ghost {
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tkc__panel,
  .tkc-switch i {
    transition: none;
  }
  .tkc[data-design="banner"] .tkc__panel { transform: none; }
}
