/*
 * 방문 통계 동의 막대(gtag-init.js)와 ‘쿠키 설정’ 링크.
 * 정적 화면과 앱 셸이 함께 쓰므로 색을 스스로 갖는다(시스템 밝기 설정을 따른다).
 */
html:not(.irx-analytics) [data-irx-consent-open] {
  display: none !important;
}

:root {
  --irxc-bg: #ffffff;
  --irxc-text: #171918;
  --irxc-dim: #626761;
  --irxc-border: #cdccc4;
  --irxc-btn-bg: #f5f4f0;
  --irxc-btn-hover: #e9e8e1;
  --irxc-link: #244c45;
  --irxc-focus: #244c45;
  --irxc-shadow: rgba(23, 25, 24, 0.18);
}
@media (prefers-color-scheme: dark) {
  :root {
    --irxc-bg: #1b1d1c;
    --irxc-text: #e6e7e3;
    --irxc-dim: #a4a8a2;
    --irxc-border: #3a3e3b;
    --irxc-btn-bg: #262928;
    --irxc-btn-hover: #303432;
    --irxc-link: #9cc9bd;
    --irxc-focus: #9cc9bd;
    --irxc-shadow: rgba(0, 0, 0, 0.5);
  }
}

/* 막대가 떠 있는 동안 화면 끝(마지막 버튼·저장 막대)을 가리지 않게 */
html.irx-consent-open body {
  padding-bottom: var(--irx-consent-space, 140px);
}
html.irx-consent-open .savebar.is-dirty {
  bottom: calc(var(--irx-consent-space, 140px) + 12px);
}

.irx-consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 400;
  box-sizing: border-box;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 16px;
  border: 1px solid var(--irxc-border);
  border-radius: 14px;
  background: var(--irxc-bg);
  color: var(--irxc-text);
  box-shadow: 0 10px 30px -10px var(--irxc-shadow);
  font: 400 14px/1.55 'IRUMX Sans', 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: break-word;
}
.irx-consent-text {
  flex: 1 1 300px;
  margin: 0;
}
.irx-consent-text a {
  color: var(--irxc-link);
  font-weight: 600;
  text-decoration: underline;
}
.irx-consent-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
/* 허용과 거부는 모양·크기가 같다 */
.irx-consent .irx-consent-btn {
  min-width: 76px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--irxc-border);
  border-radius: 10px;
  background: var(--irxc-btn-bg);
  color: var(--irxc-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.irx-consent .irx-consent-btn:hover {
  background: var(--irxc-btn-hover);
}
.irx-consent a:focus-visible,
.irx-consent .irx-consent-btn:focus-visible,
.irx-consent-link:focus-visible {
  outline: 2px solid var(--irxc-focus);
  outline-offset: 2px;
}

/* 바닥글의 ‘쿠키 설정’: 옆 링크와 같은 모양의 버튼 */
.irx-consent-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.irx-consent-link:hover {
  text-decoration: underline;
}

@media (max-width: 47.99em) {
  .irx-consent {
    bottom: calc(8px + env(safe-area-inset-bottom));
    padding: 12px;
  }
  .irx-consent-actions {
    width: 100%;
  }
  .irx-consent .irx-consent-btn {
    flex: 1;
  }
}

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

/* 문장 안의 ‘쿠키 설정’(개인정보 처리방침) */
p .irx-consent-link,
td .irx-consent-link {
  display: inline;
  min-height: 0;
  font-weight: 600;
  text-decoration: underline;
}
