/* Consent presentation only. Analytics and saved choices remain in v1.js. */
:root {
  --zrindy-consent-bg: #fcfcfd;
  --zrindy-consent-surface: #f3f5f8;
  --zrindy-consent-hover: #e9edf4;
  --zrindy-consent-ink: #17202e;
  --zrindy-consent-muted: #626c7a;
  --zrindy-consent-border: #e1e5eb;
  --zrindy-consent-control: #7d8999;
  --zrindy-consent-focus: #1858dc;
}

/* The panel is appended to body, outside the homepage's theme container. */
:root:has(.zrindy-home[data-theme='dark']) {
  --zrindy-consent-bg: #151b25;
  --zrindy-consent-surface: #191f2a;
  --zrindy-consent-hover: #232d3d;
  --zrindy-consent-ink: #f0f3f8;
  --zrindy-consent-muted: #a5afbd;
  --zrindy-consent-border: #303949;
  --zrindy-consent-control: #65738a;
  --zrindy-consent-focus: #8db3ff;
}

@media (prefers-color-scheme: dark) {
  :root:has(.zrindy-home[data-theme='system']) {
    --zrindy-consent-bg: #151b25;
    --zrindy-consent-surface: #191f2a;
    --zrindy-consent-hover: #232d3d;
    --zrindy-consent-ink: #f0f3f8;
    --zrindy-consent-muted: #a5afbd;
    --zrindy-consent-border: #303949;
    --zrindy-consent-control: #65738a;
    --zrindy-consent-focus: #8db3ff;
  }
}

.zrindy-analytics-panel[hidden],
.zrindy-analytics-settings[hidden] {
  display: none !important;
}

.zrindy-analytics-panel {
  position: fixed;
  z-index: 2000;
  inset-inline-end: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  width: min(400px, calc(100% - 48px));
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 24px;
  border: 1px solid var(--zrindy-consent-border);
  border-radius: 16px;
  background: var(--zrindy-consent-bg);
  color: var(--zrindy-consent-ink);
  font: 430 14px/1.75 'Zrindy Text', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-synthesis: none;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: thin;
  scrollbar-color: var(--zrindy-consent-control) var(--zrindy-consent-bg);
}

.zrindy-analytics-panel h2 {
  margin: 0 0 12px;
  padding-inline-end: 32px;
  color: var(--zrindy-consent-ink);
  font: 720 20px/1.4 'Zrindy Display', 'Zrindy Text', 'Apple SD Gothic Neo', sans-serif;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.zrindy-analytics-panel p {
  margin: 0 0 12px;
  color: var(--zrindy-consent-muted);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.zrindy-analytics-panel a {
  display: inline-block;
  color: var(--zrindy-consent-ink);
  font-size: 13px;
  font-weight: 550;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.zrindy-analytics-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.zrindy-analytics-actions button,
.zrindy-analytics-settings {
  box-sizing: border-box;
  min-height: 46px;
  padding: 11px 16px;
  border: 1px solid var(--zrindy-consent-control);
  border-radius: 10px;
  background: var(--zrindy-consent-surface);
  color: var(--zrindy-consent-ink);
  font: 650 14px/1.4 'Zrindy Text', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  letter-spacing: -0.012em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 140ms ease-out, border-color 140ms ease-out;
}

/* Equal-size, equal-emphasis Allow/Decline; Close remains a separate action. */
.zrindy-analytics-actions button:nth-child(-n + 2) {
  width: 100%;
  min-width: 0;
}

.zrindy-analytics-actions button:hover,
.zrindy-analytics-settings:hover {
  border-color: var(--zrindy-consent-ink);
  background: var(--zrindy-consent-hover);
}

.zrindy-analytics-actions button:active,
.zrindy-analytics-settings:active {
  background: var(--zrindy-consent-hover);
}

.zrindy-analytics-actions button:nth-child(3) {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  font-size: 0;
}

.zrindy-analytics-actions button:nth-child(3)::before {
  content: '';
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 6 12 12M18 6 6 18' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.zrindy-analytics-actions button:nth-child(3):hover {
  background: var(--zrindy-consent-hover);
}

.zrindy-analytics-panel :is(a, button):focus-visible,
.zrindy-analytics-settings:focus-visible {
  outline: 2px solid var(--zrindy-consent-focus);
  outline-offset: 3px;
}

.zrindy-analytics-panel ::selection {
  color: var(--zrindy-consent-bg);
  background: var(--zrindy-consent-ink);
}

.zrindy-analytics-settings {
  position: fixed;
  z-index: 1500;
  inset-inline-end: 20px;
  bottom: max(16px, env(safe-area-inset-bottom));
  min-height: 44px;
  padding: 10px 14px;
  background: var(--zrindy-consent-bg);
  font-size: 13px;
  font-weight: 550;
}

/* Keep the independently published guide navigation unchanged. */
.zrindy-guide-product-nav { margin: 0; padding: 14px max(24px, calc((100% - 1120px) / 2)); background: #f3f5f8; color: #17202e; font: 500 14px/1.6 system-ui,sans-serif; border-bottom: 1px solid #dfe4ec; }
.zrindy-guide-product-nav a { color: #164eae; text-decoration: underline; }

@media (max-width: 600px) {
  .zrindy-analytics-panel {
    inset-inline-end: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    padding: 22px 20px 20px;
  }

  .zrindy-analytics-panel h2 {
    font-size: 19px;
  }

  .zrindy-analytics-settings {
    inset-inline-end: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .zrindy-analytics-actions button,
  .zrindy-analytics-settings {
    transition: none;
  }
}
