/* 미기록 계정 안내 한 줄(web-consent.js C.notice, 주인님 2026-11-02 08:16Z: 로그인 때 덮던 '이용 문서 확인' 창 대신).
   main 맨 위(헤더가 있으면 그 아래)에서 본문을 밀어내는 한 줄이지 덮는 창이 아니다. 글자 14/1.4, 줄 48, 링크는 버튼 체계(파랑 면 #0056fa·모서리 8).
   색은 원천 토큰 --ink·--ink-soft·--surface-2(site.css 라이트/다크, 스튜디오는 .studio-body가 같은 이름을 덮는다) — 별칭 --primary는 :root에서 굳어 스튜디오 다크에서 글자가 안 보인다. 선택 모드만 닫기(이번 세션). */
.consent-notice {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin: 0 0 16px;
  padding: 6px 6px 6px 16px;
  border: 1px solid var(--gw-border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.025em;
}

.consent-notice-text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  word-break: keep-all;
  text-wrap: balance; /* 두 줄로 접힐 때 '않았어요.' 토막이 홀로 남지 않게 */
}

.consent-notice-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px; /* 컨트롤 높이 40(데스크톱) / 44(터치) */
  padding: 0 14px;
  border-radius: 10px; /* 행동 버튼 모서리 10(버튼 체계 2026-10-31) */
  background: #0056fa;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

.consent-notice-link:hover {
  background: #0047d6;
}

.consent-notice-close {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}

.consent-notice-close:hover {
  background: var(--gw-border);
  color: var(--ink);
}

/* 스튜디오(.studio-body)는 --gw-border를 덮지 않는다 → 그 페이지의 선 색으로 */
.studio-body .consent-notice {
  border-color: var(--edge);
}

.studio-body .consent-notice-close:hover {
  background: var(--surface-3, var(--edge));
}

.consent-notice-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
}

.consent-notice-link:focus-visible,
.consent-notice-close:focus-visible {
  outline: 2px solid var(--focus, #0056fa);
  outline-offset: 2px;
}

/* 첫 페이지(세션 캐시 없음)에만: 네트워크 응답 뒤에 끼워지므로 본문이 툭 밀리지 않게 높이로 펼친다. 움직임 줄이기면 크로스페이드만 */
.consent-notice.is-reveal {
  overflow: hidden;
  animation: consent-notice-reveal 220ms ease-out both;
}

@keyframes consent-notice-reveal {
  from { max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; border-top-width: 0; border-bottom-width: 0; opacity: 0; }
  to { max-height: 240px; opacity: 1; }
}

.consent-notice.is-leaving {
  overflow: hidden;
  pointer-events: none;
  animation: consent-notice-reveal 180ms ease-in reverse both; /* 닫기: 펼침의 역방향 */
}

@media (prefers-reduced-motion: reduce) {
  .consent-notice.is-reveal {
    animation: consent-notice-fade 220ms ease-out both;
  }

  .consent-notice.is-leaving {
    animation: consent-notice-fade 180ms ease-in reverse both;
  }

  @keyframes consent-notice-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

/* main이 그리드인 페이지(/me): main 앞 형제로 들어가며 페이지 열 폭(--content, site.css)과 같은 폭 */
.consent-notice--column {
  width: var(--content, calc(100% - 32px));
  margin: 16px auto 0;
}

/* 첫 화면(home.html): main은 전체 폭, 본문은 .wrap 열 — 안내도 같은 열에 */
main#top > .consent-notice {
  width: min(var(--content, 1280px), calc(100% - 2 * var(--gutter, 48px)));
  margin: 16px auto 0;
}

.consent-notice-short { display: none; }

/* 폰: 짧은 문장 + 버튼 + 닫기를 한 줄에(실기기 QA 2026-11-22 — 세 줄 상자가 첫 화면의 1/4을 차지했다) */
@media (max-width: 767px) {
  .consent-notice {
    gap: 8px;
    min-height: 44px;
    margin-bottom: 12px;
    padding: 0 0 0 14px;
  }

  .consent-notice-long { display: none; }
  .consent-notice-short { display: inline; }

  .consent-notice-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .consent-notice-link {
    min-height: 44px; /* 터치 타깃 44 */
    padding: 0 12px;
  }

  .consent-notice-close {
    width: 44px;
    height: 44px;
  }
}
