/* Liquid A — Liquid Memory Skin 베이스 UI
   색 세계: 심야 네이비 잉크(midnight ink) + 금빛 부유 입자(golden motes) — 단일 색 세계에 깊이 집중 */
:root {
  color-scheme: dark;
  --ink-0: #02040a;        /* 최심층 */
  --ink-1: #081020;        /* 심야 잉크 */
  --bone: #e8edf4;         /* 본문 밝은 글자 */
  --bone-dim: rgba(232, 237, 244, 0.55);
  --gold: #eec786;         /* 금빛 입자 액센트 */
  --gold-soft: rgba(238, 199, 134, 0.55);
  --gold-dim: rgba(214, 178, 120, 0.45);
  --violet-deep: rgba(110, 100, 180, 0.4);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink-0);
}

body {
  color: var(--bone);
  font-family: Inter, "Noto Sans KR", "Pretendard", "Apple SD Gothic Neo", sans-serif;
  -webkit-font-smoothing: antialiased;
  /* 한국어는 어절(단어) 단위로만 줄바꿈 — 글자 중간에서 끊기지 않게. overflow-wrap은 유지해
     URL·해시처럼 끊을 수 없는 긴 문자열이 넘치지 않고 그래도 감싸지도록 함 (사이트 전역 기준선). */
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ---- 배경: 캡틴 제공 원본 이미지 그대로 (2944x1648, 무보정) ----
   팬 시차(패럴랙스)를 위해 오버사이즈 — 오프셋 시 가장자리 노출 방지 */
.membrane-image {
  position: fixed;
  inset: -14%;
  background: #04070d url("bg_original.png") center / cover no-repeat;
  will-change: background-position;
}

/* ---- 언어 토글 (우상단 고정, EN | KO) ---- */
.lang-toggle {
  position: fixed;
  top: clamp(18px, 3vh, 30px);
  right: clamp(18px, 3vw, 34px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  padding-right: 6px; /* §5 DP2: KO 레이블 가장자리 잘림 방지 */
}
/* §3b BRAND1: 우상단 코너 방사형 소프트 음영 — 워드마크 코너와 동일한 막 깊이 처리, 앰버 대비 확보 */
.lang-toggle::before {
  content: "";
  position: absolute;
  inset: -44px -52px -72px -60px;
  background: radial-gradient(ellipse at 78% 18%, rgba(4, 8, 22, 0.78) 0%, rgba(4, 8, 22, 0.4) 44%, transparent 72%);
  pointer-events: none;
  z-index: -1;
}
.lang-toggle button {
  appearance: none;
  border: 0;
  padding: 6px 2px;
  background: transparent;
  color: var(--gold-dim);
  font: inherit;
  cursor: pointer;
  position: relative;
  transition: color 0.25s ease;
}
.lang-toggle button::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  transform: translateX(-50%) scale(0);
  transition: transform 0.25s ease;
  box-shadow: 0 0 8px var(--gold-soft);
}
.lang-toggle button[aria-pressed="true"] {
  color: var(--gold);
  text-shadow: 0 0 14px rgba(238, 199, 134, 0.4);
}
.lang-toggle button[aria-pressed="true"]::after { transform: translateX(-50%) scale(1); }
.lang-toggle button:focus-visible {
  outline: 1px solid var(--gold-soft);
  outline-offset: 4px;
}
.lang-toggle .divider {
  color: rgba(214, 178, 120, 0.3);
  user-select: none;
}

/* ---- 중앙 초점: 핵심 문장 + 첫 문장 입력 ---- */
.threshold {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 0 clamp(20px, 6vw, 64px);
  pointer-events: none; /* 유체막 포인터 반응 유지, 내부 입력만 상호작용 */
  transition: opacity 0.5s ease, transform 0.5s ease;
}
/* §3 RECOVERY: 입장 패널이 열릴 때 초대 문장 + 입력줄이 먼저 위로 흘러 물러남 (0.5s) */
.threshold.receded {
  opacity: 0;
  transform: translateY(-16px);
}
.threshold.receded .sentence-field { pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .threshold { transition: none; }
}
.threshold-core {
  position: relative;
  width: min(760px, 100%);
  height: 100%;
  text-align: center;
  pointer-events: none;
  margin: 0 auto; /* §3 DP2: 광학 중앙 정렬 명시 보장 */
}

/* 입력창이 뷰포트 정중앙(수평+수직)에 정확히 오도록 절대 배치 (R2) */
.sentence-field {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  pointer-events: auto;
}

.core-sentence {
  position: absolute;
  bottom: calc(50% + clamp(56px, 9vh, 92px));
  left: 0;
  right: 0;
  margin: 0;
  font-family: "Cormorant Garamond", "Noto Serif KR", Georgia, serif;
  font-weight: 600;
  font-style: italic;
  font-size: clamp(30px, 3.35vw, 48px);
  line-height: 1.3;
  letter-spacing: -0.005em;
  text-wrap: balance;
  white-space: pre-line; /* 로케일 사전의 \n 줄바꿈 지점 존중 */
  color: #f2f5fa;
  text-shadow:
    0 0 1px rgba(205, 222, 255, 0.9),
    0 0 26px rgba(150, 180, 255, 0.20),
    0 6px 44px rgba(0, 0, 0, 0.7);
}
html[lang="ko"] .core-sentence {
  font-family: "Noto Serif KR", "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.005em;
  /* 두 줄('당'/'첫')의 왼쪽 라인 정렬 — 블록은 중앙, 행은 좌측 */
  text-align: left;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: max-content;
  max-width: 100%;
}

.sentence-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: center;
  color: #f2f5f9;
  caret-color: var(--gold);
  /* 입력 폰트 이전 세리프로 복원 (캡틴 지시 2026-07-16) */
  font-family: "Cormorant Garamond", "Noto Serif KR", Georgia, serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.4;
  padding: 14px 18px 16px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}
html[lang="ko"] .sentence-input { font-family: "Noto Serif KR", Georgia, serif; font-weight: 400; font-style: normal; }
.sentence-input::placeholder {
  color: rgba(210, 220, 234, 0.38);
  font-style: italic;
}
html[lang="ko"] .sentence-input::placeholder { font-style: normal; }

/* 입력은 박스가 아니라 한 줄 — 잉크 수면 위의 가는 빛줄 */
.sentence-field::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft) 28%, rgba(240, 244, 250, 0.6) 50%, var(--gold-soft) 72%, transparent);
  opacity: 0.5;
  transition: opacity 0.4s ease, box-shadow 0.4s ease;
}
.sentence-field:focus-within::after {
  opacity: 0.95;
  box-shadow: 0 0 18px rgba(238, 199, 134, 0.25);
}

/* ---- 좌하단 상태 각인 ---- */
.direction-mark {
  position: fixed;
  left: clamp(18px, 3vw, 34px);
  bottom: clamp(16px, 3vh, 28px);
  z-index: 10;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(233, 242, 238, 0.4);
  line-height: 1.9;
  pointer-events: none;
}
.direction-mark .biolum-tick { color: var(--gold-dim); }

/* 조용한 /about 입구 — 하단 중앙, 첫 문장 입력(화면 정중앙)과 겹치지 않고 시선도 끌지 않는 낮은 존재감.
   .honesty-notice(같은 하단 중앙, 로그인 전 상태 표시)보다 한 줄 위에 고정해 겹침 없이 공존. */
.about-link {
  position: fixed;
  z-index: 9;
  left: 50%;
  bottom: clamp(46px, 7vh, 64px);
  transform: translateX(-50%);
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(233, 242, 238, 0.32);
  text-decoration: none;
  transition: color 0.25s ease;
}
.about-link:hover, .about-link:focus-visible { color: var(--gold-dim); outline: none; }
.direction-mark span { display: block; } /* §5 DP2: 두 줄 겹침 방지 — block으로 명시 분리 */
/* §0 RECOVERY: 배포 진실 스탬프 — 짧은 커밋 SHA, 미세 40% 톤 */
.direction-mark .build-stamp {
  font-size: 8px;
  letter-spacing: 0.2em;
  color: rgba(233, 242, 238, 0.4);
  text-transform: none;
}

/* ---- 좌상단 워드마크 + 로고 ---- */
.wordmark {
  position: fixed;
  top: clamp(16px, 2.6vh, 26px);
  left: clamp(18px, 3vw, 34px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(15px, 1.3vw, 19px);
  font-weight: 500;
  letter-spacing: 0.32em;
  pointer-events: auto;           /* §A BRAND3: 홈 링크 — 클릭 가능 */
  text-decoration: none;          /* §A BRAND3: 앵커 밑줄 제거 */
  cursor: pointer;
  transform: scale(1.4);          /* §2 DP2: ~1.4x 스케일업 */
  transform-origin: top left;
}
.wordmark:focus-visible {          /* §A BRAND3: 키보드 접근성 */
  outline: 1px solid var(--gold-soft);
  outline-offset: 6px;
  border-radius: 2px;
}
/* §2 DP2: 코너 방사형 소프트 음영 — 막 깊이 느낌 */
.wordmark::before {
  content: "";
  position: absolute;
  inset: -44px -60px -72px -52px;
  background: radial-gradient(ellipse at 22% 18%, rgba(4, 8, 22, 0.78) 0%, rgba(4, 8, 22, 0.4) 44%, transparent 72%);
  pointer-events: none;
  z-index: -1;
}
/* 로고 교체: A안(screen 블렌드)은 원본의 잔여 앰비언트(완전한 순검정이 아님)가
   크롭 사각형 경계에서 박스로 드러나 실패 — B안(루미넌스 알파 추출, 실제 투명 PNG/WebP)로 전환. */
.wordmark .logo {
  flex: none;
}
/* §2 BRAND1: 워드마크 — 조각된 금속 재질 (수직 그라데이션 + 상단 하이라이트), 글로우 스팸 없음 */
.wordmark span[data-i18n="wordmark"] {
  background: linear-gradient(180deg, #EED9A6 0%, #C9A35C 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 -1px 0 rgba(255, 246, 224, 0.35);
}

/* ---- 직조 계층: 입자 캔버스 · 엮인 기억 ---- */
#motes {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
#memories {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 7;
  pointer-events: none;
  overflow: visible;          /* 월드 공간 — 카메라 변환으로 이동 */
  transform-origin: 0 0;
  will-change: transform;
}

/* 코어 귀환 점 — 코어가 화면 밖일 때 가장자리의 앰버 미광 */
#core-cue {
  position: fixed;
  z-index: 9;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 234, 190, 0.95) 0%, rgba(238, 186, 110, 0.55) 45%, rgba(238, 186, 110, 0) 75%);
  box-shadow: 0 0 14px rgba(238, 186, 110, 0.6), 0 0 30px rgba(238, 186, 110, 0.3);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.5s ease;
  animation: cue-breathe 2.6s ease-in-out infinite;
}
#core-cue.visible { opacity: 0.9; }
#core-cue:focus-visible { outline: 1px solid var(--gold-soft); outline-offset: 4px; }
@keyframes cue-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.35); }
}
@media (prefers-reduced-motion: reduce) {
  #core-cue { animation: none; }
}

/* 엮인 기억 — 원문 그대로 읽히는 텍스트 (말줄임 금지) */
.memory {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 260px;
  min-width: min(240px, 60vw);  /* PART B follow-up: prevent narrow box that stacks chars */
  opacity: 0;
  transform: translate(-50%, -50%);
  font-family: "Cormorant Garamond", "Noto Serif KR", Georgia, serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(240, 244, 250, 0.95);
  text-shadow: 0 0 12px rgba(255, 214, 138, 0.22), 0 2px 10px rgba(0, 0, 0, 0.65);
  text-align: center;
  text-wrap: balance;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.5s ease;
}
/* PART B root cause: overflow-wrap 부재로 공백 없는 CJK가 max-height 클립 안에서 1자/행 쌓임 → 세로처럼 보임 */
html[lang="ko"] .memory {
  font-family: "Noto Serif KR", Georgia, serif;
  font-style: normal;
  writing-mode: horizontal-tb;   /* 수직 쓰기 모드 상속 차단 */
  word-break: keep-all;          /* 공백 있는 경우: 공백에서만 줄바꿈 */
}
html[lang="ko"] .memory .memory-text {
  overflow-wrap: anywhere;       /* 공백 없는 경우: 어디서나 줄바꿈 허용 */
}
.memory.settled { opacity: 0.65; }
.memory.settled:hover, .memory.settled:focus-visible { opacity: 1; }
.memory:focus-visible { outline: 1px solid var(--gold-soft); outline-offset: 6px; border-radius: 4px; }
.memory.unweaving { opacity: 0; transition: opacity 1.1s ease; }

/* Enter 힌트 — 입력에 글자가 있을 때만 */
.enter-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 10px;
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold-dim);
  text-align: center;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.enter-hint.visible { opacity: 0.85; }

/* 기억 카운터 — 코어 곁의 작은 숫자와 단어. §3c BRAND1: 금(브랜드+기억 전용)으로 승격, 메달처럼 — 박스·아이콘 없음 */
.memory-counter {
  position: fixed;
  z-index: 8;
  opacity: 0;
  transition: opacity 0.6s ease; /* 등장 페이드 — 내부 텍스트의 8s 펄스와 분리 */
  pointer-events: none;
}
.memory-counter.visible { opacity: 1; }
.memory-counter-text {
  display: inline-block;
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 13px;                    /* §3c BRAND1: 11px → +2px */
  letter-spacing: 0.14em;
  color: #C9A35C;                     /* §3c BRAND1: 차분한 금 */
  text-shadow: 0 0 12px rgba(201, 163, 92, 0.3);
  animation: memory-counter-pulse 8s ease-in-out infinite; /* 코어의 8s 호흡과 동조 */
}
@keyframes memory-counter-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .memory-counter-text { animation: none; opacity: 1; }
}

/* 세션 정직성 안내 — 하단 중앙, 첫 직조 후에만. 로그아웃 상태에선 입장 지점이 된다 (§B) */
.honesty-notice {
  position: fixed;
  z-index: 8;
  left: 50%;
  bottom: clamp(14px, 2.6vh, 24px);
  transform: translateX(-50%);
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(232, 237, 244, 0.4);
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  white-space: nowrap;
}
.honesty-notice.visible { opacity: 1; pointer-events: auto; }
.honesty-notice .notice-action {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  color: var(--gold-dim);
  cursor: pointer;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.honesty-notice .notice-action:hover,
.honesty-notice .notice-action:focus-visible {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(238, 199, 134, 0.4);
  outline: none;
}

/* 입장 — 막이 갈라지는 수직 빛의 이음매 (0.8s) 뒤 이메일 하나 (§B) */
#entry-seam {
  position: fixed;
  z-index: 14;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 0;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, transparent, rgba(255, 240, 210, 0.85) 22%, rgba(255, 250, 236, 0.95) 50%, rgba(255, 240, 210, 0.85) 78%, transparent);
  box-shadow: 0 0 18px rgba(255, 226, 168, 0.55), 0 0 60px rgba(238, 199, 134, 0.3);
  opacity: 0;
  pointer-events: none;
}
#entry-seam.open {
  animation: seam-part 1.5s ease forwards;
}
@keyframes seam-part {
  0%   { height: 0; opacity: 0; }
  35%  { height: 62vh; opacity: 1; }
  70%  { height: 62vh; opacity: 1; }
  100% { height: 62vh; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #entry-seam.open { animation: none; opacity: 0; }
}

#entry {
  position: fixed;
  z-index: 15;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  width: min(360px, 84vw);
  text-align: center;
}
#entry .entry-promise {
  margin: 0 0 16px;
  font-family: "Cormorant Garamond", "Noto Serif KR", Georgia, serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(232, 237, 244, 0.75);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
  white-space: pre-line; /* §4 BRAND1: 로케일 사전의 \n 줄바꿈 지점 존중 (KO 2줄) */
}
html[lang="ko"] #entry .entry-promise { font-family: "Noto Serif KR", Georgia, serif; font-style: normal; }
#entry #entry-email {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  border-bottom: 1px solid rgba(238, 199, 134, 0.4);
  padding: 8px 4px 9px;
  text-align: center;
  color: #f2f5f9;
  caret-color: var(--gold);
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 14px;
  letter-spacing: 0.03em;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
#entry #entry-email:focus {
  border-color: rgba(238, 199, 134, 0.85);
  box-shadow: 0 8px 22px -14px rgba(238, 199, 134, 0.5);
}
#entry #entry-email::placeholder { color: rgba(210, 220, 234, 0.35); }
#entry .entry-status {
  margin-top: 12px;
  min-height: 16px;
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: rgba(238, 199, 134, 0.75);
}

/* 존재 표식 — 엠블럼+워드마크 블록 아래, 전체 폭 기준 수평 중앙 (§B4; §3a BRAND1: 좌측 쏠림 → 중앙 정렬)
   left는 magic.js centerPresence()가 워드마크 실측 폭으로 매 프레임 아닌 필요 시점에만 계산해 설정한다. */
.presence {
  position: fixed;
  z-index: 10;
  top: clamp(54px, 7vh, 66px);   /* 캡틴 지시: 살짝 위로 */
  left: clamp(18px, 3vw, 34px);  /* JS가 "WEAVRAIN"의 W 시작점으로 덮어씀 — 미실행 시 안전한 폴백 */
  appearance: none;
  border: 0;
  padding: 2px 0;
  background: transparent;
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 12.5px;                 /* §3a BRAND1: 11.5px → +1px */
  letter-spacing: 0.24em;            /* 캡틴 지시: 좌하단 각인(direction-mark)과 동일한 넓은 자간 */
  text-transform: uppercase;         /* 캡틴 지시: 좌하단 각인과 동일한 대문자 표기 (원문 데이터는 소문자 그대로 유지) */
  color: rgba(232, 237, 244, 0.72);  /* §3a BRAND1: 62% → 72% */
  cursor: pointer;
  transition: color 0.25s ease;
}
.presence:hover, .presence:focus-visible { color: rgba(232, 237, 244, 1); outline: none; } /* §2 DP2: hover 100% */
/* §B BRAND3: 로그아웃 상태 = "로그인" 어포던스. presence와 같은 타이포지만 금빛으로 명확히 인터랙티브 */
.presence.signed-out {
  color: var(--gold-dim);
}
.presence.signed-out:hover, .presence.signed-out:focus-visible {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(238, 199, 134, 0.45);
}
/* §B BRAND3: username in-place 전환 — 부드러운 페이드 */
.presence.identity-fade { animation: identity-fade 0.5s ease; }
@keyframes identity-fade {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .presence.identity-fade { animation: none; }
}
.presence-menu {
  position: fixed;
  z-index: 21;
  top: clamp(78px, 10vh, 90px);  /* presence 위치 조정에 맞춤 */
  left: clamp(18px, 3vw, 34px);   /* JS가 presence와 동일 시작점으로 덮어씀 */
  padding: 6px;
  background: rgba(6, 10, 20, 0.88);
  border: 1px solid rgba(238, 199, 134, 0.18);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}
.presence-menu button, .presence-menu a {
  appearance: none;
  border: 0;
  padding: 6px 14px;
  background: transparent;
  color: rgba(232, 237, 244, 0.75);
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: 5px;
  display: block;
  text-decoration: none;
}
.presence-menu button:hover, .presence-menu button:focus-visible,
.presence-menu a:hover, .presence-menu a:focus-visible { background: rgba(238, 199, 134, 0.1); color: var(--gold); outline: none; }

/* §B BRAND3: 재방문 로그인 표면 — 멤브레인 미학의 전체화면 오버레이 (팝업 아님, same-tab) */
.signin-panel[hidden] { display: none; }  /* 클래스 display가 hidden 속성을 덮지 않도록 명시 */
.signin-panel {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 42%, rgba(6, 12, 24, 0.72) 0%, rgba(3, 6, 14, 0.9) 70%);
  backdrop-filter: blur(6px);
  animation: signin-fade 0.4s ease;
}
@keyframes signin-fade { 0% { opacity: 0; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .signin-panel { animation: none; } }
.signin-card {
  width: min(340px, 86vw);
  padding: 34px 30px 22px;
  text-align: center;
  background: rgba(8, 13, 26, 0.82);
  border: 1px solid rgba(238, 199, 134, 0.16);
  border-radius: 14px;
  box-shadow: 0 26px 70px -30px rgba(0, 0, 0, 0.85), 0 0 40px -20px rgba(238, 199, 134, 0.25);
}
.signin-title {
  margin: 0 0 22px;
  font-family: "Cormorant Garamond", "Noto Serif KR", Georgia, serif;
  font-style: italic;
  font-size: 19px;
  color: rgba(238, 244, 252, 0.9);
}
html[lang="ko"] .signin-title { font-family: "Noto Serif KR", Georgia, serif; font-style: normal; }
.signin-providers { display: flex; flex-direction: column; gap: 10px; }
.signin-provider {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: rgba(232, 237, 244, 0.04);
  border: 1px solid rgba(238, 199, 134, 0.28);
  border-radius: 9px;
  color: rgba(238, 244, 252, 0.92);
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.signin-provider:hover, .signin-provider:focus-visible {
  border-color: rgba(238, 199, 134, 0.6);
  background: rgba(238, 199, 134, 0.08);
  box-shadow: 0 8px 24px -14px rgba(238, 199, 134, 0.5);
  outline: none;
}
.signin-provider-glyph {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #EED9A6, #C9A35C);
  color: #0a1020;
  font-weight: 600;
  font-size: 12px;
}
.signin-status {
  min-height: 15px;
  margin: 14px 0 0;
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: rgba(238, 199, 134, 0.78);
}
.signin-close {
  appearance: none;
  margin-top: 8px;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  color: rgba(232, 237, 244, 0.45);
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.25s ease;
}
.signin-close:hover, .signin-close:focus-visible { color: rgba(232, 237, 244, 0.85); outline: none; }

/* §P2-2 기억 서랍 — 우측에서 미끄러져 나오는 패널 (멤브레인 미학) */
.memory-drawer[hidden] { display: none; }
.memory-drawer {
  position: fixed;
  inset: 0;
  z-index: 32;
  display: flex;
  justify-content: flex-end;
  background: rgba(3, 6, 14, 0.5);
  backdrop-filter: blur(3px);
  animation: drawer-fade 0.3s ease;
}
@keyframes drawer-fade { 0% { opacity: 0; } 100% { opacity: 1; } }
.drawer-panel {
  width: var(--drawer-w, min(560px, 94vw));  /* §COMFORT A: 기본 폭 확대, B의 자유 리사이즈 변수 */
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(10, 16, 30, 0.96), rgba(6, 10, 20, 0.98));
  border-left: 1px solid rgba(238, 199, 134, 0.16);
  box-shadow: -30px 0 80px -30px rgba(0, 0, 0, 0.8);
  animation: drawer-slide 0.34s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes drawer-slide { 0% { transform: translateX(30px); opacity: 0.4; } 100% { transform: translateX(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .memory-drawer, .drawer-panel { animation: none; }
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.drawer-title {
  font-family: "Cormorant Garamond", "Noto Serif KR", Georgia, serif;
  font-style: italic; font-size: 21px; color: rgba(238, 244, 252, 0.92);
}
html[lang="ko"] .drawer-title { font-family: "Noto Serif KR", Georgia, serif; font-style: normal; }
.drawer-close {
  appearance: none; border: 0; background: transparent; color: rgba(232, 237, 244, 0.5);
  font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: color 0.2s, background 0.2s;
}
.drawer-close:hover, .drawer-close:focus-visible { color: var(--gold); background: rgba(238, 199, 134, 0.1); outline: none; }
/* §P2-2 폴리시: 서랍 목록은 자체 스크롤 컨테이너. 끝에서 페이지로 스크롤 체이닝 차단. */
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 18px 40px; }
.drawer-state { text-align: center; color: rgba(232, 237, 244, 0.5); padding: 44px 0; font-size: 13px; }
.mem-item {
  border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 11px;
  padding: 13px 15px; margin-bottom: 10px; background: rgba(14, 22, 40, 0.5);
  transition: border-color 0.2s;
}
.mem-item.open { border-color: rgba(238, 199, 134, 0.3); }
.mem-row { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; cursor: pointer; }
.mem-body { flex: 1; font-size: 14px; line-height: 1.5; color: rgba(238, 244, 252, 0.94); font-family: "Cormorant Garamond", "Noto Serif KR", Georgia, serif; }
html[lang="ko"] .mem-body { font-family: "Noto Serif KR", Georgia, serif; }
.mem-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.mem-badge { font-size: 10px; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 20px; border: 1px solid rgba(184, 147, 94, 0.4); color: #b8935e; }
.mem-badge.first { color: var(--gold); border-color: rgba(238, 199, 134, 0.45); }
.mem-edited { font-size: 10px; letter-spacing: 0.06em; color: rgba(232, 237, 244, 0.45); font-style: italic; }
.mem-time { font-size: 10.5px; color: rgba(232, 237, 244, 0.4); }
.mem-caret { flex: none; color: rgba(232, 237, 244, 0.35); font-size: 12px; transition: transform 0.2s; }
.mem-item.open .mem-caret { transform: rotate(90deg); }
.mem-detail { margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(255, 255, 255, 0.08); }
.mem-actions { display: flex; gap: 8px; margin-top: 4px; }
.mem-actions button {
  appearance: none; border: 1px solid rgba(238, 199, 134, 0.3); border-radius: 7px;
  background: transparent; color: rgba(238, 244, 252, 0.85); font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 11.5px; letter-spacing: 0.03em; padding: 6px 13px; cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.mem-actions button:hover, .mem-actions button:focus-visible { background: rgba(238, 199, 134, 0.1); border-color: rgba(238, 199, 134, 0.55); outline: none; }
.mem-actions .danger { border-color: rgba(217, 112, 112, 0.4); color: #e59a9a; }
.mem-actions .danger:hover, .mem-actions .danger:focus-visible { background: rgba(217, 112, 112, 0.12); border-color: rgba(217, 112, 112, 0.65); }
.mem-history { margin-top: 12px; }
.mem-history-row { padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.mem-history-row:first-child { border-top: 0; }
.mem-history-label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(238, 199, 134, 0.6); }
.mem-history-body { font-size: 13px; line-height: 1.45; color: rgba(232, 237, 244, 0.82); margin-top: 2px; }
.mem-history-time { font-size: 10px; color: rgba(232, 237, 244, 0.38); margin-top: 2px; }
.mem-edit-area { width: 100%; box-sizing: border-box; margin-top: 8px; min-height: 70px; resize: vertical;
  background: rgba(4, 8, 18, 0.6); border: 1px solid rgba(238, 199, 134, 0.35); border-radius: 8px;
  color: #f2f5f9; font-family: "Noto Serif KR", "Cormorant Garamond", Georgia, serif; font-size: 14px; line-height: 1.5; padding: 10px 12px; outline: none; }
.mem-edit-area:focus { border-color: rgba(238, 199, 134, 0.7); }
.mem-confirm { margin-top: 10px; padding: 11px 13px; border-radius: 9px; background: rgba(217, 112, 112, 0.08); border: 1px solid rgba(217, 112, 112, 0.3); }
.mem-confirm-text { font-size: 12px; line-height: 1.45; color: rgba(240, 210, 210, 0.92); margin-bottom: 9px; }

/* 귀환 인사 — 코어 곁 (§B4) */
.return-greeting {
  position: fixed;
  z-index: 8;
  left: 23%;
  top: calc(72% - 74px);
  transform: translateX(-50%);
  font-family: "Cormorant Garamond", "Noto Serif KR", Georgia, serif;
  font-style: italic;
  font-size: 15.5px;
  color: rgba(238, 210, 160, 0.85);
  text-shadow: 0 0 16px rgba(238, 199, 134, 0.35), 0 2px 12px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}
html[lang="ko"] .return-greeting { font-family: "Noto Serif KR", Georgia, serif; font-style: normal; }
.return-greeting.visible { opacity: 1; }

/* 기억 팝오버 — 모달이 아닌 조용한 인라인 */
.memory-popover {
  position: fixed;
  z-index: 20;
  max-width: 300px;
  padding: 14px 16px 12px;
  background: rgba(6, 10, 20, 0.88);
  border: 1px solid rgba(238, 199, 134, 0.18);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.memory-popover .popover-text {
  margin: 0 0 10px;
  font-family: "Cormorant Garamond", "Noto Serif KR", Georgia, serif;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(240, 244, 250, 0.95);
}
.memory-popover .popover-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.memory-popover .popover-time {
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: rgba(232, 237, 244, 0.45);
}
.memory-popover .popover-unweave {
  appearance: none;
  border: 1px solid rgba(238, 199, 134, 0.28);
  border-radius: 6px;
  padding: 5px 10px;
  background: transparent;
  color: var(--gold);
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.memory-popover .popover-unweave:hover,
.memory-popover .popover-unweave:focus-visible {
  border-color: rgba(238, 199, 134, 0.6);
  background: rgba(238, 199, 134, 0.08);
  outline: none;
}


/* §4 DISPLAY: 기억 본문 — 안정 상태 ≤2줄 + 페이드 마스크 (말줄임 없음) */
.memory-text {
  display: block;
  max-height: calc(1.5em * 2);    /* 2줄 × line-height 1.5 */
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 30%, transparent 100%);
  transition: max-height 0.3s ease, opacity 0.25s ease;
}
/* §4 시맨틱 줌: cam.z ≥1.4 + 중앙 40% → 전체 텍스트 노출 */
.memory.zoom-reveal .memory-text {
  max-height: 20em;
  mask-image: none;
  -webkit-mask-image: none;
}

/* §1 DP2: 거리 기반 tier — mote-tier: 텍스트 숨기고 amber dot; bloom: hover/focus 시 전체 노출 */
.memory.mote-tier .memory-text {
  opacity: 0;
  pointer-events: none;
}
.memory.mote-tier::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 220, 130, 0.98) 0%, rgba(238, 186, 110, 0.6) 55%, transparent 100%);
  box-shadow: 0 0 7px rgba(238, 186, 110, 0.8), 0 0 18px rgba(238, 186, 110, 0.35);
  pointer-events: none;
  transition: box-shadow 0.25s ease;
}
.memory.mote-tier.bloomed .memory-text {
  opacity: 1;
  max-height: 20em;
  mask-image: none;
  -webkit-mask-image: none;
}
.memory.mote-tier.bloomed::before {
  box-shadow: 0 0 12px rgba(238, 186, 110, 0.95), 0 0 28px rgba(238, 186, 110, 0.5);
}
@media (prefers-reduced-motion: reduce) {
  .memory.mote-tier .memory-text { transition: none; }
}

/* §2 발견 힌트 — 하단 중앙, 5s 자동 소멸, 최대 2회/브라우저 */
#discovery-hint {
  position: fixed;
  z-index: 11;
  left: 50%;
  bottom: clamp(52px, 8vh, 72px);
  transform: translateX(-50%);
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: rgba(232, 237, 244, 0.6);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
#discovery-hint.visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  #discovery-hint { transition: none; }
}

/* §3 컴파스 버튼 — 우하단 ≥44px 탭 영역 */
#compass-btn {
  position: fixed;
  z-index: 10;
  right: clamp(18px, 3vw, 34px);
  bottom: clamp(16px, 3vh, 28px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  appearance: none;
  border: 1px solid rgba(238, 199, 134, 0.28);
  background: transparent;
  color: var(--gold-dim);
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s ease, border-color 0.25s ease;
}
#compass-btn:hover, #compass-btn:focus-visible {
  color: var(--gold);
  border-color: rgba(238, 199, 134, 0.6);
  outline: none;
}

/* §3 컴파스 카드 — 인월드 어비스 스타일 */
#compass-card {
  position: fixed;
  z-index: 22;
  right: clamp(18px, 3vw, 34px);
  bottom: calc(clamp(16px, 3vh, 28px) + 52px);
  width: min(360px, 88vw);
  padding: 16px 18px 14px;
  background: rgba(6, 10, 20, 0.92);
  border: 1px solid rgba(238, 199, 134, 0.18);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.compass-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.compass-title {
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(232, 237, 244, 0.45);
}
#compass-close {
  appearance: none;
  border: 0;
  padding: 4px 8px;
  background: transparent;
  color: var(--gold-dim);
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.2s ease;
}
#compass-close:hover, #compass-close:focus-visible { color: var(--gold); outline: none; }
.compass-table {
  width: 100%;
  border-collapse: collapse;
}
.compass-table tr { border-bottom: 1px solid rgba(232, 237, 244, 0.07); }
.compass-table tr:last-child { border-bottom: 0; }
.compass-table th {
  padding: 7px 0;
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(238, 199, 134, 0.75);
  text-align: left;
  width: 38%;
}
.compass-table td {
  padding: 7px 0 7px 12px;
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 10.5px;
  color: rgba(232, 237, 244, 0.5);
  text-align: left;
}

/* PART A: 악수(The Handshake) — 이메일 제출 후 entry-status 안에 표시 */
.hs-word {
  display: block;
  font-size: 13px;
  color: rgba(240, 244, 250, 0.82);
  letter-spacing: 0.04em;
  line-height: 1.5;
}
.hs-spam {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0.07em;
  color: rgba(232, 237, 244, 0.28);
}

/* 이메일 악수: 기억 한 번 반짝임 */
@keyframes mem-shimmer {
  0%   { opacity: 0.65; }
  40%  { opacity: 1; }
  100% { opacity: 0.65; }
}
.memory.shimmer-once {
  animation: mem-shimmer 0.9s ease forwards;
}
@media (prefers-reduced-motion: reduce) {
  .memory.shimmer-once { animation: none; }
}

/* ==== §P2-3/§P3 파일·이미지 기억 ==== */
/* 입력 자체는 그대로(width:100%, 텍스트 중앙 정렬) — wrap은 "+"의 위치 기준일 뿐 */
.sentence-inputwrap { position: relative; }
/* 밑줄 프레임(.sentence-field::after, 좌우 14% 인셋)과 시각적으로 맞물리는 위치 — 뷰포트 절대좌표가 아니라
   입력 프레임 기준 상대 위치라 화면 크기와 무관하게 항상 입력 바로 옆에 보인다 (캡틴 발견성 제보 수정) */
.file-add-btn {
  position: absolute;
  right: 13%;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  appearance: none;
  border: 1px solid rgba(238, 199, 134, 0.32);
  background: rgba(4, 7, 13, 0.35);
  color: var(--gold-dim);
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.file-add-btn:hover, .file-add-btn:focus-visible { color: var(--gold); border-color: rgba(238, 199, 134, 0.65); background: rgba(238, 199, 134, 0.08); outline: none; }
@media (max-width: 640px) {
  .file-add-btn { right: 3%; width: 36px; height: 36px; font-size: 19px; }
}

/* §P3 폴리시: "+" 힌트 — 데스크톱 hover/focus로 노출(멤브레인 톤 말풍선). 모바일은 hover가 없으므로
   title/aria-label(동일 문구)로 대체 — 탭은 여전히 피커를 바로 연다(우회 없음). */
.file-add-hint {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  max-width: min(320px, 70vw);
  padding: 7px 12px;
  border-radius: 7px;
  border: 1px solid rgba(238, 199, 134, 0.3);
  background: rgba(6, 10, 20, 0.94);
  backdrop-filter: blur(8px);
  color: rgba(232, 237, 244, 0.85);
  font-family: Inter, "Noto Sans KR", sans-serif;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 5;
}
.file-add-btn:hover + .file-add-hint,
.file-add-btn:focus-visible + .file-add-hint {
  opacity: 1;
  visibility: visible;
}
@media (max-width: 640px) {
  .file-add-hint { display: none; } /* 모바일은 hover 없음 — title/aria-label로 동일 정보 제공 */
}

.file-ritual[hidden] { display: none; }
.file-ritual {
  position: fixed;
  z-index: 16;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 7, 13, 0.55);
  backdrop-filter: blur(2px);
}
.file-ritual-card {
  width: min(380px, 86vw);
  text-align: center;
  padding: 22px 26px 24px;
  border: 1px solid rgba(238, 199, 134, 0.22);
  border-radius: 14px;
  background: rgba(9, 14, 26, 0.92);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
}
.file-ritual-chip {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: Inter, "Noto Sans KR", sans-serif;
}
.file-ritual-name { font-size: 13px; color: rgba(238, 244, 252, 0.9); overflow-wrap: anywhere; }
.file-ritual-size { font-size: 11px; color: rgba(232, 237, 244, 0.45); white-space: nowrap; }
.file-ritual-prompt {
  margin: 0 0 14px;
  font-family: "Cormorant Garamond", "Noto Serif KR", Georgia, serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(232, 237, 244, 0.8);
}
html[lang="ko"] .file-ritual-prompt { font-family: "Noto Serif KR", Georgia, serif; font-style: normal; }
.file-ritual-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  border-bottom: 1px solid rgba(238, 199, 134, 0.4);
  padding: 8px 4px 9px;
  text-align: center;
  color: #f2f5f9;
  caret-color: var(--gold);
  font-family: "Cormorant Garamond", "Noto Serif KR", Georgia, serif;
  font-size: 15px;
}
html[lang="ko"] .file-ritual-input { font-family: "Noto Serif KR", Georgia, serif; }
.file-ritual-input:focus { border-color: rgba(238, 199, 134, 0.85); }
.file-ritual-status { margin-top: 10px; min-height: 14px; font-size: 11px; letter-spacing: 0.03em; color: rgba(238, 199, 134, 0.75); }
/* §DIAG: 실패 시에만 나타나는 진단 코드 — 캡틴이 그대로 읽어 전달할 수 있는 한 줄 */
.file-ritual-diag { margin-top: 6px; font-size: 10px; letter-spacing: 0.02em; color: rgba(199, 205, 224, 0.45); word-break: break-all; user-select: text; }
.file-ritual-diag[hidden] { display: none; }

/* §DRAWER-UX 3: 파일 기억 = 별 곁의 동반 점 + 가는 연결선 (골드 계열 저투명).
   CSS 의사요소 전용 — 프레임당 JS 0, 캔버스 무접촉, 숨김 탭에서 브라우저가 자동 스로틀.
   50+ 기억에서도 가독 유지: 초저투명 + 초소형. */
.memory.has-file::before {              /* 연결선 — 별 우상단으로 뻗는 1px */
  content: "";
  position: absolute;
  top: 4px;
  right: -16px;
  width: 18px;
  height: 1px;
  background: linear-gradient(90deg, rgba(238, 199, 134, 0.05), rgba(238, 199, 134, 0.35));
  transform: rotate(-28deg);
  transform-origin: left center;
  pointer-events: none;
}
.memory.has-file::after {               /* 동반 점 */
  content: "";
  position: absolute;
  top: -7px;
  right: -20px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(238, 199, 134, 0.55);
  opacity: 0.75;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .memory.has-file::after { animation: file-dot-twinkle 3.2s ease-in-out infinite; }
}
@keyframes file-dot-twinkle {           /* opacity 전용 느린 트윙클 */
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.95; }
}

/* 서랍 — 파일 칩 + 인라인 미리보기 */
.mem-file-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(238, 199, 134, 0.2);
  border-radius: 8px;
  font-size: 11.5px;
  color: rgba(232, 237, 244, 0.7);
}
.mem-file-chip .mem-file-type {
  flex: none;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid rgba(184, 147, 94, 0.4);
  color: #b8935e;
}
.mem-file-chip .mem-file-name { flex: 1; overflow-wrap: anywhere; }
.mem-file-preview { margin-top: 10px; }
.mem-file-preview img { max-width: 100%; max-height: 220px; border-radius: 8px; display: block; }
.mem-file-preview a {
  display: inline-block;
  font-size: 12px;
  color: var(--gold-dim);
  border: 1px solid rgba(238, 199, 134, 0.3);
  border-radius: 6px;
  padding: 6px 12px;
  text-decoration: none;
}
.mem-file-preview a:hover, .mem-file-preview a:focus-visible { color: var(--gold); border-color: rgba(238, 199, 134, 0.6); }

/* §P3-1: AI 해석 — 유저 문장과 절대 섞이지 않는, 명확히 분리된 구역 */
.mem-interpret-ask {
  margin-top: 12px;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--gold-dim);
  background: transparent;
  border: 1px dashed rgba(238, 199, 134, 0.35);
  border-radius: 7px;
  padding: 7px 12px;
  cursor: pointer;
  font-family: Inter, "Noto Sans KR", sans-serif;
}
.mem-interpret-ask:hover, .mem-interpret-ask:focus-visible { color: var(--gold); border-color: rgba(238, 199, 134, 0.6); outline: none; }
.mem-interpret-ask:disabled { opacity: 0.5; cursor: default; }
.mem-interpret-zone {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(107, 163, 214, 0.28);
  border-radius: 8px;
  background: rgba(107, 163, 214, 0.06);
}
.mem-interpret-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.mem-interpret-badge {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(107, 163, 214, 0.55);
  color: #8fb8dd;
}
.mem-interpret-model { font-size: 10px; color: rgba(232, 237, 244, 0.45); font-family: Inter, "Noto Sans KR", sans-serif; }
.mem-interpret-time { font-size: 10px; color: rgba(232, 237, 244, 0.38); font-family: Inter, "Noto Sans KR", sans-serif; margin-left: auto; }
.mem-interpret-body { font-size: 13px; line-height: 1.5; color: rgba(232, 237, 244, 0.86); white-space: pre-wrap; }
.mem-interpret-actions { display: flex; gap: 8px; margin-top: 8px; }
.mem-interpret-actions button {
  appearance: none; background: transparent; border: 1px solid rgba(107, 163, 214, 0.35);
  color: #8fb8dd; border-radius: 6px; padding: 4px 10px; font-size: 11px; cursor: pointer;
  font-family: Inter, "Noto Sans KR", sans-serif;
}
.mem-interpret-actions button:hover, .mem-interpret-actions button:focus-visible { border-color: rgba(107, 163, 214, 0.65); outline: none; }
.mem-interpret-status { margin-top: 8px; font-size: 11px; color: rgba(217, 112, 112, 0.85); }

/* ---- 모바일 ---- */
@media (max-width: 480px) {
  .core-sentence { font-size: clamp(24px, 7.2vw, 30px); }
  .sentence-input { font-size: 17px; }
  .lang-toggle { font-size: 10px; }
}

/* ---- 모션 감소 존중 ---- */
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .lang-toggle button, .lang-toggle button::after, .sentence-field::after { transition: none; }
  .fragment { transition: none; }
  .fragment.settled { animation: none; opacity: 0.82; }
}

/* ==== §DISCERN-P1 분별 구역 — 5타입 시각 구분 (spec §1.6) ==== */
/* §DISCERN-UX A: 샴페인-골드 경계 — 브랜드 골드(#EED9A6→#C9A35C, wordmark와 동일 계열)로
   구역의 시작·끝을 명확히. 금은 브랜드+기억 전용 규칙 내 사용(분별은 기억에 속한다). */
.du-zone {
  position: relative;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(201, 163, 92, 0.6);           /* #C9A35C */
  border-radius: 8px;
  background: rgba(238, 217, 166, 0.045);              /* #EED9A6 저강도 */
  box-shadow: 0 0 10px rgba(238, 199, 134, 0.1);       /* --gold-soft 저강도 글로우 */
}
.du-zone::after {                                       /* 은은한 반짝임 — opacity 전용 */
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 8px;
  border: 1px solid rgba(238, 217, 166, 0.75);          /* #EED9A6 */
  opacity: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .du-zone::after { animation: du-shimmer 2s ease-in-out infinite; }
}
@keyframes du-shimmer { 0%, 100% { opacity: 0; } 50% { opacity: 0.45; } }
.du-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.du-title { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(232, 237, 244, 0.5); }
.du-ask { appearance: none; margin-left: auto; background: transparent; border: 1px solid rgba(184, 147, 94, 0.35); border-radius: 16px; color: #b8935e; font-size: 11px; padding: 3px 12px; cursor: pointer; font-family: Inter, "Noto Sans KR", sans-serif; }
.du-ask:hover { border-color: rgba(238, 199, 134, 0.6); color: var(--gold); }
.du-row { padding: 8px 0 6px; border-top: 1px solid rgba(232, 237, 244, 0.06); }
.du-row-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.du-badge { font-size: 9.5px; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 20px; border: 1px solid; }
.du-badge-fact { color: #9ecf9e; border-color: rgba(158, 207, 158, 0.6); border-style: solid; }
.du-badge-inference { color: #8fb8dd; border-color: rgba(143, 184, 221, 0.6); border-style: dashed; }
.du-badge-suggestion { color: #d9b06a; border-color: rgba(217, 176, 106, 0.55); border-style: solid; }
.du-badge-uncertainty { color: rgba(232, 237, 244, 0.5); border-color: rgba(232, 237, 244, 0.25); border-style: dotted; }
.du-badge-contradiction { color: #d98a8a; border-color: rgba(217, 138, 138, 0.55); border-style: double; }
.du-unconfirmed { font-size: 9.5px; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 20px; border: 1px dashed rgba(232, 237, 244, 0.3); color: rgba(232, 237, 244, 0.55); }
.du-claim { font-size: 13px; line-height: 1.5; color: rgba(232, 237, 244, 0.86); }
.du-uncertainty .du-claim { color: rgba(232, 237, 244, 0.55); }
.du-basis { font-size: 11.5px; line-height: 1.5; color: rgba(232, 237, 244, 0.5); margin-top: 3px; cursor: pointer; }
.du-basis:hover { color: rgba(238, 199, 134, 0.8); }
.du-ref { cursor: pointer; color: #8fb8dd; }
.du-contra { display: flex; gap: 8px; margin-top: 4px; }
.du-contra-side { flex: 1; font-size: 11.5px; line-height: 1.5; padding: 6px 8px; border: 1px solid rgba(217, 138, 138, 0.25); border-radius: 6px; color: rgba(232, 237, 244, 0.62); cursor: pointer; }
.du-contra-side:hover { border-color: rgba(217, 138, 138, 0.5); }
.du-actions { display: flex; gap: 8px; margin-top: 6px; }
.du-actions button { appearance: none; background: transparent; border: 1px solid rgba(232, 237, 244, 0.2); border-radius: 16px; color: rgba(232, 237, 244, 0.7); font-size: 11px; padding: 3px 12px; cursor: pointer; font-family: Inter, "Noto Sans KR", sans-serif; }
.du-actions button:hover { border-color: rgba(238, 199, 134, 0.55); color: var(--gold); }
.du-hidden-toggle { appearance: none; background: transparent; border: none; color: rgba(232, 237, 244, 0.35); font-size: 10.5px; padding: 6px 0 0; cursor: pointer; font-family: Inter, "Noto Sans KR", sans-serif; }
.du-hidden-toggle:hover { color: rgba(232, 237, 244, 0.6); }
.du-dim { opacity: 0.5; }
.du-status-note { font-size: 10px; color: rgba(232, 237, 244, 0.4); }

/* §DISCERN-UX B: 확인/기각 즉시 피드백 — 골드 플래시 (opacity 전용, 1회) */
.du-flash { position: relative; }
.du-flash::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: rgba(238, 217, 166, 0.22);
  opacity: 0;
  pointer-events: none;
  animation: du-flash-once 0.5s ease-out 1;
}
@keyframes du-flash-once { 0% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .du-flash::before { animation: none; opacity: 0.5; }
}
.du-actions button:disabled { opacity: 0.45; cursor: default; }

/* §DRAWER-UX 2: 이미지 라이트박스 — 어두운 스크림, X/바깥클릭/Esc 닫기 */
.lightbox[hidden] { display: none; } /* 버그픽스: .lightbox의 display:flex가 [hidden] UA 규칙을 덮어써
   닫은 뒤에도 투명 스크림이 전 화면 클릭을 삼키던 문제 — hidden 시 확실히 제거 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 4, 10, 0.92);
}
.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 6px;
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.8), 0 0 24px rgba(238, 199, 134, 0.08);
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  appearance: none;
  background: transparent;
  border: 0;
  color: rgba(232, 237, 244, 0.75);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
}
.lightbox-close:hover { color: var(--gold); }
.mem-file-preview img { cursor: zoom-in; }

/* ==== §P4 결정 존 — 뉴트럴 톤 (금은 브랜드·기억·분별 전용 규칙 준수) ==== */
.decision-zone { border-bottom: 1px solid rgba(232, 237, 244, 0.08); }
.dz-toggle {
  appearance: none; width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: transparent; border: 0; padding: 10px 18px; cursor: pointer;
  color: rgba(232, 237, 244, 0.6); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  font-family: Inter, "Noto Sans KR", sans-serif;
}
.dz-toggle:hover { color: rgba(232, 237, 244, 0.85); }
.dz-caret { transition: transform 0.2s ease; }
.dz-toggle.open .dz-caret { transform: rotate(90deg); }
.dz-body { padding: 0 18px 12px; max-height: 46vh; overflow-y: auto; }
.dz-create { display: flex; gap: 8px; margin-bottom: 8px; }
.dz-create input, .dz-reason-input, .dz-tags-input, .dz-outcome-actual, .dz-outcome-lesson {
  flex: 1; width: 100%; background: rgba(232, 237, 244, 0.05); border: 1px solid rgba(232, 237, 244, 0.14);
  border-radius: 8px; color: var(--bone); font-size: 12.5px; padding: 7px 10px;
  font-family: Inter, "Noto Sans KR", sans-serif; outline: none;
}
.dz-create input:focus, .dz-reason-input:focus, .dz-tags-input:focus,
.dz-outcome-actual:focus, .dz-outcome-lesson:focus { border-color: rgba(232, 237, 244, 0.35); }
.dz-body button {
  appearance: none; background: transparent; border: 1px solid rgba(232, 237, 244, 0.2);
  border-radius: 16px; color: rgba(232, 237, 244, 0.75); font-size: 11px; padding: 4px 12px;
  cursor: pointer; font-family: Inter, "Noto Sans KR", sans-serif; white-space: nowrap;
}
.dz-body button:hover { border-color: rgba(232, 237, 244, 0.45); color: var(--bone); }
.dz-item { border-top: 1px solid rgba(232, 237, 244, 0.06); }
.dz-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 2px; cursor: pointer; }
.dz-item-title { font-size: 13px; color: rgba(232, 237, 244, 0.88); }
.dz-status { font-size: 9.5px; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 20px; border: 1px solid rgba(232, 237, 244, 0.25); color: rgba(232, 237, 244, 0.55); white-space: nowrap; }
.dz-status-decided { color: #9ecf9e; border-color: rgba(158, 207, 158, 0.5); }
.dz-status-reversed, .dz-status-superseded { opacity: 0.6; }
.dz-detail { padding: 2px 2px 12px; }
.dz-reason { font-size: 12.5px; color: rgba(232, 237, 244, 0.75); padding: 4px 0 8px; }
.dz-decide, .dz-tags-edit, .dz-outcome-edit { display: flex; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.dz-outcome-edit input { min-width: 140px; }
.dz-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.dz-tag { font-size: 10px; padding: 2px 8px; border-radius: 20px; background: rgba(232, 237, 244, 0.08); color: rgba(232, 237, 244, 0.65); }
.dz-alts { margin: 6px 0; }
.dz-alt { padding: 6px 8px; border: 1px solid rgba(232, 237, 244, 0.1); border-radius: 8px; margin-bottom: 6px; font-size: 12px; color: rgba(232, 237, 244, 0.8); }
.dz-alt-ai { font-size: 9px; letter-spacing: 0.08em; margin-left: 6px; padding: 1px 6px; border-radius: 12px; border: 1px dashed rgba(232, 237, 244, 0.3); color: rgba(232, 237, 244, 0.5); }
.dz-alt-rationale { font-size: 11px; color: rgba(232, 237, 244, 0.5); margin-top: 2px; }
.dz-alt-draft button { margin-top: 4px; }
.dz-draft-wrap { margin: 8px 0; }
.dz-blank-note { display: block; font-size: 10.5px; color: rgba(232, 237, 244, 0.42); margin-top: 4px; }
.dz-draft-notice { font-size: 10.5px; color: rgba(232, 237, 244, 0.55); border-left: 2px solid rgba(232, 237, 244, 0.25); padding-left: 8px; margin: 8px 0 6px; }
.dz-draft-out { margin-top: 6px; }
.dz-outcomes { margin: 6px 0; }
.dz-outcome { font-size: 12px; color: rgba(232, 237, 244, 0.7); padding: 4px 0; }
.dz-lesson { font-style: italic; color: rgba(232, 237, 244, 0.85); }
.dz-lessons { margin-top: 10px; border-top: 1px solid rgba(232, 237, 244, 0.08); padding-top: 8px; }
.dz-lessons-title { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(232, 237, 244, 0.45); margin-bottom: 6px; }
.dz-surfaced { margin-bottom: 8px; }
.dz-surfaced-meta { font-size: 10.5px; color: rgba(232, 237, 244, 0.45); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }

/* ==== §DRAWER-COMFORT A: 기본 가독 — 본문·입력 한 단계 업 (한국어 word-break 규칙은 body 전역 유지) ==== */
.drawer-body { font-size: 14px; }
.mem-body { font-size: 14.5px; line-height: 1.55; }
.mem-history-body { font-size: 13.5px; line-height: 1.55; }
.du-claim { font-size: 14px; }
.du-basis { font-size: 12.5px; }
.dz-item-title { font-size: 14.5px; }
.dz-reason { font-size: 13.5px; }
.dz-alt { font-size: 13px; }
.dz-outcome { font-size: 13px; }
.mem-interpret-body { font-size: 14px; }
.dz-create input, .dz-reason-input, .dz-tags-input, .dz-outcome-actual, .dz-outcome-lesson {
  font-size: 14px; padding: 9px 12px;
}
.mem-edit-area { font-size: 14px; }
.dz-body button, .du-actions button { font-size: 12px; padding: 5px 14px; }
.du-ask, .mem-interpret-ask { font-size: 12px; }

/* §DRAWER-COMFORT B: 리사이즈 핸들 — 패널 안쪽(왼쪽) 가장자리 */
.drawer-panel { position: relative; }
.drawer-resize {
  position: absolute;
  left: -4px;
  top: 0;
  bottom: 0;
  width: 10px;
  cursor: ew-resize;
  z-index: 2;
  touch-action: none;
}
.drawer-resize::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 44px;
  border-radius: 2px;
  background: rgba(232, 237, 244, 0.18);
  transition: background 0.2s ease;
}
.drawer-resize:hover::after { background: rgba(232, 237, 244, 0.45); }
.drawer-head-actions { display: flex; align-items: center; gap: 4px; }

/* §DRAWER-COMFORT C: 확장(컴포트) 모드 */
@media (prefers-reduced-motion: no-preference) {
  .drawer-panel { transition: width 0.25s ease; }
  .drawer-panel.resizing { transition: none; }
}
.drawer-panel.expanded { width: min(70vw, 960px); }
.memory-drawer.expanded { backdrop-filter: blur(1.5px); }  /* 캔버스가 존재감을 유지하도록 블러 완화 */
.drawer-panel.expanded .drawer-resize { display: none; }   /* 확장 모드에선 고정 폭 */
.drawer-expand {
  appearance: none; border: 0; background: transparent; color: rgba(232, 237, 244, 0.5);
  font-size: 15px; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: color 0.2s, background 0.2s;
}
.drawer-expand:hover, .drawer-expand:focus-visible { color: var(--gold); background: rgba(238, 199, 134, 0.1); outline: none; }
@media (max-width: 640px) {
  /* 모바일: 확장 = 풀스크린 시트 (닫기 버튼은 헤더에 상존) */
  .drawer-panel.expanded { width: 100vw; }
  .drawer-resize { display: none; }  /* 좁은 화면에선 드래그 리사이즈 비활성 */
}

/* §VIDEO-MEM: 업로드 진행 바 + 취소 */
.file-ritual-progress { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.file-ritual-bar { flex: 1; height: 4px; border-radius: 4px; background: rgba(232, 237, 244, 0.1); overflow: hidden; }
.file-ritual-bar-fill { height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, rgba(238, 217, 166, 0.7), #C9A35C); transition: width 0.2s ease; }
.file-ritual-cancel { appearance: none; background: transparent; border: 1px solid rgba(232, 237, 244, 0.25); border-radius: 14px; color: rgba(232, 237, 244, 0.65); font-size: 11px; padding: 3px 12px; cursor: pointer; font-family: Inter, "Noto Sans KR", sans-serif; }
.file-ritual-cancel:hover { border-color: rgba(232, 237, 244, 0.5); color: var(--bone); }
.file-ritual-close { margin-top: 10px; }
.file-ritual-close[hidden] { display: none; }

/* §VIDEO-MEM: 서랍 플레이어 */
.mem-file-preview video, .mem-file-preview audio { max-width: 100%; border-radius: 8px; display: block; }
.mem-file-preview audio { width: 100%; }
.mem-hash-chip { font-size: 9.5px; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 20px; border: 1px solid rgba(232, 237, 244, 0.2); color: rgba(232, 237, 244, 0.5); }
.mem-hash-chip.verified { color: #9ecf9e; border-color: rgba(158, 207, 158, 0.45); }
.mem-hash-chip.mismatch { color: #d98a8a; border-color: rgba(217, 138, 138, 0.5); }

/* §CIRCLE_P1 C: circle 첫 방문 1회 안내 — 조용한 카드, 닫기 전까지 하단 중앙 */
.circle-note {
  position: fixed;
  left: 50%;
  bottom: clamp(90px, 14vh, 140px);
  transform: translateX(-50%);
  z-index: 20;
  max-width: min(420px, 88vw);
  padding: 16px 20px;
  border: 1px solid rgba(232, 237, 244, 0.16);
  border-radius: 12px;
  background: rgba(8, 14, 26, 0.92);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  text-align: center;
  font-family: Inter, "Noto Sans KR", sans-serif;
}
.circle-note-title { font-size: 14px; color: rgba(238, 244, 252, 0.92); margin-bottom: 6px; }
.circle-note-body { font-size: 12px; line-height: 1.6; color: rgba(232, 237, 244, 0.6); margin-bottom: 12px; }
.circle-note-dismiss {
  appearance: none; background: transparent; border: 1px solid rgba(232, 237, 244, 0.25);
  border-radius: 16px; color: rgba(232, 237, 244, 0.75); font-size: 11px; padding: 4px 16px;
  cursor: pointer; font-family: inherit;
}
.circle-note-dismiss:hover { border-color: rgba(232, 237, 244, 0.5); color: var(--bone); }

/* §ADMIN_PLAN_P1: 만료 임박 안내 — 인월드 저자극 토스트 */
.tier-expiry-notice { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); background: rgba(14,18,32,.92); border: 1px solid rgba(238,199,134,.4); color: rgba(238,199,134,.9); border-radius: 14px; padding: 9px 18px; font-size: 12px; z-index: 300; transition: opacity .8s; }
.tier-expiry-notice.gone { opacity: 0; }
#admin-menu-link[hidden] { display: none; }

/* §MEMORY_WEB_P1: 즉시 검색 + 재현 제안 + 연결 존 */
.search-btn { position: fixed; top: 16px; right: 104px; z-index: 40; background: transparent; border: 1px solid rgba(232,237,244,.22); color: rgba(232,237,244,.6); border-radius: 50%; width: 30px; height: 30px; font-size: 15px; cursor: pointer; line-height: 1; }
.search-btn:hover { border-color: rgba(238,199,134,.55); color: rgba(238,199,134,.9); }
.search-veil { position: fixed; inset: 0; background: rgba(4,6,12,.62); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh; }
.search-veil[hidden] { display: none; }
.search-card { width: min(560px, 88vw); background: rgba(14,18,32,.96); border: 1px solid rgba(238,199,134,.28); border-radius: 18px; padding: 14px 16px; }
.search-card input { width: 100%; background: transparent; border: none; outline: none; color: #e8edf4; font-size: 15px; font-family: inherit; padding: 4px 2px 10px; border-bottom: 1px solid rgba(232,237,244,.14); }
.search-results { max-height: 46vh; overflow-y: auto; margin-top: 8px; }
.search-row { padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.search-row:hover, .search-row.sel { background: rgba(238,199,134,.09); }
.search-row-text { font-size: 13px; color: #e8edf4; }
.search-row-snip { font-size: 11px; color: rgba(154,163,181,.8); margin-top: 2px; }
.search-empty { padding: 14px 10px; font-size: 12px; color: rgba(154,163,181,.75); }
.memory.search-glow .memory-text { text-shadow: 0 0 18px rgba(238,199,134,.95), 0 0 42px rgba(238,199,134,.5); transition: text-shadow .6s; }
.recall-card { position: fixed; right: 26px; z-index: 70; width: min(360px, 86vw); background: rgba(14,18,32,.95); border: 1px solid rgba(238,199,134,.4); border-radius: 16px; padding: 13px 16px; font-size: 12.5px; line-height: 1.65; }
.recall-msg { color: rgba(238,199,134,.92); }
.recall-grounds { color: rgba(199,205,224,.75); font-size: 11.5px; margin-top: 6px; }
.recall-btns { margin-top: 10px; text-align: right; }
.recall-btns button { background: transparent; border: 1px solid rgba(232,237,244,.25); color: #e8edf4; border-radius: 10px; padding: 3px 14px; font-size: 11px; cursor: pointer; margin-left: 8px; font-family: inherit; }
.recall-btns button:hover { border-color: rgba(238,199,134,.6); }
.mem-links-zone { margin-top: 12px; border-top: 1px solid rgba(232,237,244,.08); padding-top: 10px; }
.mem-links-title { font-size: 11px; color: rgba(238,199,134,.7); letter-spacing: .04em; margin-bottom: 6px; }
.mem-link-row { margin: 5px 0; }
.mem-link-row a { color: #e8edf4; font-size: 12px; text-decoration: none; border-bottom: 1px dotted rgba(238,199,134,.5); }
.mem-link-grounds { font-size: 11px; color: rgba(154,163,181,.8); margin-top: 2px; }
.mem-link-proposal { margin: 8px 0; padding: 8px 10px; border: 1px dashed rgba(238,199,134,.35); border-radius: 12px; font-size: 12px; color: rgba(238,199,134,.9); }
.mem-recall-find { margin-top: 8px; background: transparent; border: 1px dashed rgba(232,237,244,.3); color: rgba(199,205,224,.85); border-radius: 12px; padding: 4px 12px; font-size: 11px; cursor: pointer; font-family: inherit; }
.mem-recall-find:hover { border-color: rgba(238,199,134,.55); }

/* §FIX_AND_POLISH_P1 H: 오너 전용 로드맵 입구 — 워드마크 아래, 조용한 존재감 */
.roadmap-link {
  position: fixed;
  top: calc(clamp(16px, 2.6vh, 26px) + 44px);
  left: clamp(18px, 3vw, 34px);
  z-index: 10;
  font-family: "Inter", "Noto Sans KR", sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(232, 237, 244, 0.55);
  text-decoration: none;
  padding: 3px 10px;
  border: 1px solid rgba(232, 237, 244, 0.14);
  border-radius: 11px;
  background: rgba(10, 14, 26, 0.35);
  backdrop-filter: blur(4px);
  transition: color .25s, border-color .25s;
}
.roadmap-link:hover, .roadmap-link:focus-visible {
  color: rgba(238, 199, 134, 0.95);
  border-color: rgba(238, 199, 134, 0.5);
  outline: none;
}

/* §FIX_AND_POLISH_P1 §7: 서랍 분류 필터바 — 자동 축, 다크 일관, 칩은 버튼(키보드 조작 가능) */
.mem-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 2px 2px 12px;
  border-bottom: 1px solid rgba(232, 237, 244, 0.08);
  margin-bottom: 10px;
}
.mem-filter-group { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.mem-filter-group + .mem-filter-group { padding-left: 12px; border-left: 1px solid rgba(232, 237, 244, 0.08); }
.mem-filter-chip {
  background: rgba(16, 22, 42, 0.6);
  border: 1px solid rgba(232, 237, 244, 0.14);
  color: rgba(232, 237, 244, 0.62);
  border-radius: 11px;
  font-size: 11px;
  line-height: 1;
  padding: 5px 9px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.mem-filter-chip:hover, .mem-filter-chip:focus-visible { border-color: rgba(238, 199, 134, 0.45); color: rgba(232, 237, 244, 0.9); outline: none; }
.mem-filter-chip.on { border-color: rgba(238, 199, 134, 0.6); color: rgba(238, 199, 134, 0.95); }
.mem-filter-n { opacity: 0.6; font-size: 10px; margin-left: 2px; }
#drawer-search-seam { flex-basis: 100%; height: 0; } /* §MEMORY_WEB 검색 박스 자리 — 좌석만 예약 */

/* §MEMORY_WEB_P2 A: 서랍 심 검색 — 필터바 위 한 줄, 다크 일관 */
#drawer-search-seam { flex-basis: 100%; height: auto; margin-bottom: 8px; }
.drawer-search-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(16, 22, 42, 0.6);
  border: 1px solid rgba(232, 237, 244, 0.14);
  color: rgba(232, 237, 244, 0.9);
  border-radius: 11px;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  font-family: inherit;
}
.drawer-search-input:focus { border-color: rgba(238, 199, 134, 0.5); }
.drawer-search-input::placeholder { color: rgba(232, 237, 244, 0.35); }
.drawer-search-results { margin-top: 4px; }
.drawer-search-results .search-row { padding: 7px 10px; border-radius: 9px; cursor: pointer; }
.drawer-search-results .search-row.sel, .drawer-search-results .search-row:hover { background: rgba(238, 199, 134, 0.08); }
.drawer-search-results .search-row-text { font-size: 12px; color: rgba(232, 237, 244, 0.9); }
.drawer-search-results .search-row-snip { font-size: 11px; color: rgba(232, 237, 244, 0.45); }
.drawer-search-results .search-empty { font-size: 11px; color: rgba(232, 237, 244, 0.4); padding: 6px 10px; }

/* §MEMORY_WEB_P2 C: 주권 존 — 내보내기 + 삭제 범위 평문. 조용하지만 항상 보인다 */
.drawer-sovereign {
  border-top: 1px solid rgba(232, 237, 244, 0.08);
  padding: 12px 16px 16px;
  flex-shrink: 0;
}
.export-btn {
  display: inline-block;
  font-size: 12px;
  color: rgba(238, 199, 134, 0.9);
  text-decoration: none;
  border: 1px solid rgba(238, 199, 134, 0.4);
  border-radius: 11px;
  padding: 6px 14px;
  transition: border-color .2s;
}
.export-btn:hover, .export-btn:focus-visible { border-color: rgba(238, 199, 134, 0.8); outline: none; }
.deletion-scope { margin-top: 10px; font-size: 10.5px; line-height: 1.65; color: rgba(232, 237, 244, 0.42); }
.deletion-scope div + div { margin-top: 4px; }

/* §SITE_NOTICE_BANNER_P1: 알림 띠가 떠 있는 동안 상단 고정 요소만 띠 높이만큼 비켜난다.
   캔버스·히어로는 손대지 않는다 — 레이아웃 시프트 없이 첫 문장 경험 유지. */
html.wv-notice-on .wordmark { top: calc(clamp(16px, 2.6vh, 26px) + var(--wv-notice-h, 40px)); }
html.wv-notice-on .roadmap-link { top: calc(clamp(16px, 2.6vh, 26px) + 44px + var(--wv-notice-h, 40px)); }
html.wv-notice-on .lang-toggle { top: calc(clamp(18px, 3vh, 30px) + var(--wv-notice-h, 40px)); }
html.wv-notice-on .search-btn { top: calc(16px + var(--wv-notice-h, 40px)); }
