/*
 * The analytics consent bar (gtag-init.js) and the 쿠키 설정 controls. Its own
 * file, linked from index.html, so the bar is drawn before - or without - the
 * app's stylesheet. Colours are the app's tokens (theme.ts) with their values
 * as fallbacks; boot.js sets data-mantine-color-scheme before the first
 * paint, so the dark values apply from the start.
 *
 * While it is open, html.irx-consent-open and --irx-consent-h (its height)
 * give the page room at the foot and lift the app's own bottom pieces above
 * it (global.css "consent bar"): the agent's composer, the outage notice,
 * the sidebars.
 */
html:not(.irx-analytics) [data-irx-consent-open] {
  display: none !important;
}

.irx-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bz-surface, #ffffff);
  color: var(--bz-text, #1a1f27);
  border-top: 1px solid var(--bz-hairline, #edf0f4);
  box-shadow: 0 -8px 24px -16px rgba(15, 23, 42, 0.3);
  font: 400 14px/1.6 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo',
    'Noto Sans KR', 'Malgun Gothic', sans-serif;
  letter-spacing: -0.006em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

[data-mantine-color-scheme='dark'] .irx-consent {
  background: var(--bz-surface, #16191e);
  color: var(--bz-text, #e8ebf0);
  border-top-color: var(--bz-hairline, #22262d);
  box-shadow: 0 -8px 24px -16px rgba(0, 0, 0, 0.7);
}

.irx-consent-text {
  flex: 1 1 320px;
  max-width: 760px;
  margin: 0;
}

.irx-consent-text a {
  color: var(--bz-brand-text, #1d6156);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

[data-mantine-color-scheme='dark'] .irx-consent-text a {
  color: var(--bz-brand-text, #6cc2b2);
}

.irx-consent-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

/* The two answers look and weigh the same: neither is the easy one. */
.irx-consent .irx-consent-btn {
  min-width: 88px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--bz-text, #1a1f27);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

[data-mantine-color-scheme='dark'] .irx-consent .irx-consent-btn {
  border-color: var(--bz-text, #e8ebf0);
}

.irx-consent .irx-consent-btn:hover {
  background: var(--bz-surface-2, rgba(127, 127, 127, 0.12));
}

.irx-consent .irx-consent-btn:focus-visible,
.irx-consent-text a:focus-visible,
.irx-cookie-settings:focus-visible {
  outline: 3px solid var(--bz-brand-text, #1d6156);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .irx-consent {
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    font-size: 13px;
  }
  .irx-consent-actions {
    flex: 1 1 100%;
  }
  .irx-consent .irx-consent-btn {
    flex: 1 1 0;
  }
}

/* Room at the foot of the page for the bar, so nothing ends up under it. */
html.irx-consent-open body {
  padding-bottom: var(--irx-consent-h, 0px);
}

/* 쿠키 설정 among links: a button that reads as the links beside it. */
.irx-cookie-settings {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.irx-cookie-settings:hover {
  text-decoration: underline;
}

@media print {
  .irx-consent {
    display: none;
  }
}
