/* ============================================================
   YohApps Cookie Kit — v0.1

   Uses the same custom properties as yohapps.com when they exist,
   and falls back to its own values when they do not, so the kit
   drops into a site with no design system and still looks right.

   Every declaration is scoped under .yc-root. Nothing here can
   reach the host page.
   ============================================================ */

.yc-root {
  /* Fallbacks are the second argument. A site that already defines
     --color-bg and friends gets its own palette for free. */
  --yc-bg: var(--color-bg-alt, #16161d);
  --yc-text: var(--color-text, #f0f0f5);
  --yc-text-2: var(--color-text-secondary, #a0a0b8);
  --yc-muted: var(--color-text-muted, #606075);
  --yc-border: var(--color-border, rgba(255, 255, 255, 0.12));
  --yc-accent: var(--color-accent, #5b8fee);
  --yc-accent-soft: var(--color-accent-soft, rgba(91, 143, 238, 0.14));
  --yc-radius: var(--radius-lg, 14px);
  --yc-radius-sm: var(--radius-sm, 6px);
  --yc-font: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI",
             "IBM Plex Sans", Roboto, Helvetica, Arial, sans-serif);
  --yc-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);

  position: fixed;
  z-index: 2147483000; /* above sticky headers, below nothing that matters */
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 16px;
  pointer-events: none; /* the page stays usable; only the card catches clicks */
  font-family: var(--yc-font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--yc-text);
}

/* A light-themed host site gets a light card, without needing to
   define anything. Sites using [data-theme] win over this. */
@media (prefers-color-scheme: light) {
  .yc-root {
    --yc-bg: var(--color-bg-alt, #ffffff);
    --yc-text: var(--color-text, #16161d);
    --yc-text-2: var(--color-text-secondary, #4a4a5a);
    --yc-muted: var(--color-text-muted, #74748a);
    --yc-border: var(--color-border, rgba(0, 0, 0, 0.12));
    --yc-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  }
}

.yc-banner,
.yc-panel {
  pointer-events: auto;
  width: 100%;
  max-width: 560px;
  padding: 20px;
  background: var(--yc-bg);
  border: 1px solid var(--yc-border);
  border-radius: var(--yc-radius);
  box-shadow: var(--yc-shadow);
  animation: yc-in 0.22s ease-out both;
}
.yc-panel {
  max-width: 620px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

@keyframes yc-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .yc-banner, .yc-panel { animation: none; }
}

.yc-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--yc-text);
}

.yc-text {
  margin: 0 0 16px;
  color: var(--yc-text-2);
}

.yc-root a {
  color: var(--yc-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.yc-root a:hover { text-decoration-thickness: 2px; }

/* ---------- buttons ---------- */
.yc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.yc-btn {
  flex: 1 1 auto;
  min-width: 132px;
  min-height: 44px; /* WCAG / HIG touch target */
  padding: 10px 16px;
  font: inherit;
  font-weight: 500;
  color: var(--yc-text);
  background: transparent;
  border: 1px solid var(--yc-border);
  border-radius: var(--yc-radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.yc-btn:hover {
  border-color: var(--yc-accent);
  background: var(--yc-accent-soft);
}
.yc-btn:focus-visible {
  outline: 2px solid var(--yc-accent);
  outline-offset: 2px;
}

/* Accept and Reject must be equally easy to press. The primary is
   filled because it is the default action, not to nudge the answer —
   both sit in the same row, at the same size. */
.yc-btn--primary {
  color: #fff;
  background: var(--yc-accent);
  border-color: var(--yc-accent);
}
.yc-btn--primary:hover {
  filter: brightness(1.08);
  background: var(--yc-accent);
}
.yc-btn--quiet {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--yc-text-2);
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.yc-btn--quiet:hover {
  color: var(--yc-text);
  background: transparent;
  border-color: transparent;
}

/* ---------- preferences panel ---------- */
.yc-cats {
  margin: 4px 0 18px;
  border-top: 1px solid var(--yc-border);
}

.yc-cat {
  padding: 14px 0;
  border-bottom: 1px solid var(--yc-border);
}

.yc-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.yc-cat-name {
  font-weight: 600;
  color: var(--yc-text);
}

.yc-cat-lock {
  font-size: 12px;
  color: var(--yc-muted);
  white-space: nowrap;
}

.yc-cat-desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--yc-text-2);
}

/* ---------- switch ---------- */
.yc-switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
}
.yc-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;      /* invisible but still the real, focusable control */
  cursor: pointer;
  z-index: 1;
}
.yc-switch-ui {
  position: absolute;
  inset: 0;
  background: var(--yc-border);
  border-radius: 13px;
  transition: background 0.18s;
}
.yc-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.18s;
}
.yc-switch input:checked + .yc-switch-ui { background: var(--yc-accent); }
.yc-switch input:checked + .yc-switch-ui::after { transform: translateX(18px); }
.yc-switch input:focus-visible + .yc-switch-ui {
  outline: 2px solid var(--yc-accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .yc-switch-ui, .yc-switch-ui::after { transition: none; }
}

.yc-fine {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--yc-muted);
}

/* ---------- small screens ---------- */
@media (max-width: 480px) {
  .yc-root { padding: 0; }
  .yc-banner, .yc-panel {
    max-width: none;
    border-radius: var(--yc-radius) var(--yc-radius) 0 0;
    border-bottom: none;
  }
  .yc-btn { flex: 1 1 100%; }
  .yc-btn--quiet { order: 3; }
}

/* ---------- the footer link ---------- */
.yc-settings-link {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.yc-settings-link:hover { color: var(--color-accent, #5b8fee); }
