/* =========================================================================
   LNP Workbench — palette follows SmartBench FE tokens.
   Brand: lnp-green (main #90B821). Gray: Untitled UI 25–900.
   Restraint first: accent is used only for primary CTAs, links, and focus.
   ========================================================================= */

@font-face {
  font-family: "Pretendard";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/Pretendard-Regular.otf") format("opentype");
}
@font-face {
  font-family: "Pretendard";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/Pretendard-Medium.otf") format("opentype");
}
@font-face {
  font-family: "Pretendard";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/Pretendard-SemiBold.otf") format("opentype");
}
@font-face {
  font-family: "Pretendard";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/Pretendard-Bold.otf") format("opentype");
}

:root {
  /* ---- brand: lnpGreen ---- */
  --color-lnp-green-100: #edf4de;
  --color-lnp-green-200: #e3f4c1;
  --color-lnp-green-300: #c3de83;
  --color-lnp-green-400: #90B821; /* main */
  --color-lnp-green-500: #729019;
  --color-lnp-green-600: #536811;
  --color-lnp-green-700: #44530C;
  --color-lnp-green-800: #343F08;
  --color-lnp-green-900: #252B04;

  /* ---- gray (Untitled UI) ---- */
  --color-gray-25:  #fdfdfd;
  --color-gray-50:  #fafafa;
  --color-gray-100: #f5f5f5;
  --color-gray-200: #e9eaeb;
  --color-gray-300: #d5d7da;
  --color-gray-400: #a4a7ae;
  --color-gray-500: #717680;
  --color-gray-600: #535862;
  --color-gray-700: #414651;
  --color-gray-800: #252b37;
  --color-gray-900: #101828;

  /* ---- semantic ---- */
  --color-red-500:    #f04438;
  --color-red-600:    #d92d20;
  --color-yellow-500: #f79009;
  --color-yellow-600: #dc6803;
  --color-green-500:  #12b76a;
  --color-green-600:  #039855;
  --color-blue-500:   #2e90fa;
  --color-blue-600:   #1570ef;

  /* ---- role aliases (used across components) ---- */
  --bg:         var(--color-gray-50);
  --surface:    #ffffff;
  --surface-2:  var(--color-gray-100);
  --ink:        var(--color-gray-900);
  --ink-2:      var(--color-gray-800);
  --mute:       var(--color-gray-600);
  --mute-2:     var(--color-gray-500);
  --rule:       var(--color-gray-200);
  --rule-2:     var(--color-gray-300);

  --accent:     var(--color-lnp-green-400);
  --accent-h:   var(--color-lnp-green-500);
  --accent-ink: var(--color-lnp-green-700); /* used for text/links so it stays legible on white */
  --accent-bg:  var(--color-lnp-green-100);

  --ok:   var(--color-green-500);
  --warn: var(--color-yellow-500);
  --bad:  var(--color-red-500);

  --radius: 8px;
  --shadow-sm: 0 1px 0 rgba(16,24,40,.04);

  --font: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --measure: 960px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { min-height: 100vh; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--accent-bg); color: var(--ink); }

.container { max-width: var(--measure); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* -------------------- sidebar -------------------- */
:root { --sidebar-w: 220px; }

body:has(.sidebar) { padding-left: var(--sidebar-w); }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  border-right: 1px solid var(--rule);
  background: var(--bg);
  z-index: 20;
  overflow-y: auto;
}
.sidebar__inner {
  display: flex; flex-direction: column;
  height: 100%;
  padding: 20px 16px;
  gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: -0.005em;
  padding: 0 6px;
  min-width: 0;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand .brand__logo {
  display: block;
  height: 20px;
  width: auto;
  max-width: none;
  flex: 0 0 auto;
}
.brand .brand__wordmark {
  padding-left: 10px;
  border-left: 1px solid var(--rule);
  color: var(--mute);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}
.nav { display: flex; flex-direction: column; gap: 20px; flex: 1; min-height: 0; }
.nav__group { display: flex; flex-direction: column; gap: 1px; }
.nav__label {
  padding: 0 10px 6px;
  color: var(--mute-2);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav a {
  padding: 7px 10px;
  color: var(--mute);
  font-size: 13.5px;
  border-radius: 6px;
  display: block;
}
.nav a:hover {
  color: var(--ink); text-decoration: none;
  background: var(--surface);
}
.nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--surface);
  font-weight: 500;
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav__spacer { flex: 1; min-height: 8px; }

/* Tools·Community 하위 — 클릭하면 아래로 접었다 폈다(네이티브 <details>). 요약(summary)은
   대메뉴 링크와 같은 모양 + 오른쪽 셰브론이 열리면 회전. 인라인이라 사이드바 흐름 안에서 늘어난다. */
.nav__acc { display: flex; flex-direction: column; }
.nav__acc > summary { list-style: none; }
.nav__acc > summary::-webkit-details-marker { display: none; }
.nav__acc-sum {
  display: flex; align-items: center; cursor: pointer;
  padding: 7px 10px; border-radius: 6px;
  color: var(--mute); font-size: 13.5px;
}
.nav__acc-sum:hover { color: var(--ink); background: var(--surface); }
.nav__acc-sum[aria-current="page"] {
  color: var(--ink); background: var(--surface); font-weight: 500; box-shadow: inset 2px 0 0 var(--accent);
}
.nav__acc-chev {
  margin-left: auto; width: 6px; height: 6px;
  border-right: 1.25px solid currentColor; border-bottom: 1.25px solid currentColor;
  transform: rotate(-45deg); opacity: .55; transition: transform 120ms ease;
}
.nav__acc[open] > summary .nav__acc-chev { transform: rotate(45deg); opacity: .8; }
.nav__acc-body { display: flex; flex-direction: column; gap: 1px; padding-bottom: 2px; }
.nav a.nav__sub-link { padding: 6px 10px 6px 22px; color: var(--mute-2); font-size: 12.5px; }
.nav a.nav__sub-link:hover { color: var(--ink); background: var(--surface); }
.nav a.nav__sub-link[aria-current="page"] {
  color: var(--ink); background: var(--surface); font-weight: 500; box-shadow: inset 2px 0 0 var(--accent);
}

/* -------------------- desktop sidebar collapse -------------------- */
/* 데스크톱에서 사이드바를 완전히 숨기고(본문 풀폭), 좌상단 ☰ 로 다시 연다.
   모바일에선 햄버거(.nav-toggle)가 담당하므로 이 컨트롤은 감춘다. */
.sidebar { transition: transform .2s ease; }
.sb-collapse {
  position: absolute; top: 16px; right: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--rule); border-radius: 7px;
  background: var(--bg); color: var(--mute); cursor: pointer;
  transition: background .15s, color .15s; z-index: 2;
}
.sb-collapse:hover { background: var(--surface); color: var(--ink); }
.sb-collapse svg { width: 13px; height: 13px; display: block; }

.sb-reopen {
  position: fixed; top: 14px; left: 14px; z-index: 40;
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--rule); border-radius: 10px;
  background: var(--bg); color: var(--ink); cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 24, 40, .08);
}
.sb-reopen:hover { background: var(--surface); }
.sb-reopen svg { width: 18px; height: 18px; display: block; }

@media (min-width: 901px) {
  body.sb-collapsed { padding-left: 0; }
  body.sb-collapsed .sidebar { transform: translateX(-100%); }
  body.sb-collapsed .sb-reopen { display: inline-flex; }
}
@media (max-width: 900px) {
  .sb-collapse { display: none; }
  .sb-reopen { display: none !important; }
}

/* -------------------- back to Tools -------------------- */
.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin-bottom: 16px;
  padding: 5px 12px 5px 9px;
  border: 1px solid var(--rule); border-radius: 999px;
  background: var(--bg); color: var(--mute);
  font-size: 12.5px; font-weight: 500; line-height: 1;
  transition: background .15s, color .15s, border-color .15s;
}
.back-btn:hover {
  background: var(--surface); color: var(--ink);
  border-color: color-mix(in oklab, var(--accent) 40%, var(--rule));
  text-decoration: none;
}
.back-btn__chevron { font-size: 16px; line-height: 1; margin-top: -1px; }

/* Collapsible nav groups (Tools, Results). Uses either a <details>/<summary>
   pair (static HTML) or a <button class="nav__toggle"> (React). Both share the
   same visual language: uppercase eyebrow label + chevron. */
.nav__group--collapsible > summary { list-style: none; }
.nav__group--collapsible > summary::-webkit-details-marker { display: none; }
.nav__toggle,
.nav__group--collapsible > summary {
  all: unset;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px 6px;
  color: var(--mute-2);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  user-select: none;
}
.nav__toggle:hover,
.nav__group--collapsible > summary:hover { color: var(--mute); }
.nav__toggle:focus-visible,
.nav__group--collapsible > summary:focus-visible {
  outline: 1px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
.nav__chevron,
.nav__group--collapsible > summary::after {
  content: '';
  margin-left: auto;
  width: 6px; height: 6px;
  border-right: 1.25px solid currentColor;
  border-bottom: 1.25px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.6;
  transition: transform 120ms ease;
}
.nav__group--collapsible.is-open > .nav__toggle > .nav__chevron,
.nav__group--collapsible[open] > summary::after {
  transform: rotate(45deg);
}
.nav__body { display: flex; flex-direction: column; gap: 1px; }

/* Results panel — recent items per tool. Lives inside a collapsible section. */
.results { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 6px; }
.results__tool { display: flex; flex-direction: column; gap: 1px; }
.results__tool-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 4px 10px 2px;
  color: var(--mute);
  font-size: 11.5px;
  font-weight: 500;
}
.results__count {
  color: var(--mute-2);
  font-family: var(--mono);
  font-size: 10.5px;
}
.results__item {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px;
  padding: 4px 10px;
  color: var(--mute);
  font-size: 12px;
  border-radius: 5px;
  min-width: 0;
}
.results__item:hover {
  background: var(--surface); color: var(--ink); text-decoration: none;
}
.results__item--bad { color: color-mix(in oklab, var(--bad) 60%, var(--mute)); }
.results__item-name {
  min-width: 0; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.results__item-time {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute-2);
}
.results__empty {
  padding: 4px 10px 6px;
  color: var(--mute-2);
  font-size: 11.5px;
}

.status-chip {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--mute);
  font-size: 12px;
  padding: 6px 10px;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--mute-2);
}
.status-dot.ok  { background: var(--ok); }
.status-dot.bad { background: var(--bad); }

.user-chip {
  color: var(--mute);
  font-size: 12px;
  padding: 4px 10px 8px;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* -------------------- identity chip (sidebar profile module) --------------
   사이드바 하단의 아이덴티티. 프로필 카드처럼 아바타 + 이름 + 큰 칭호를 담고,
   전체가 /mypage/ 로 가는 링크가 된다. 아이덴티티가 사이드바의 감정 무게중심. */
.identity-chip[hidden] { display: none; }
.identity-chip {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 10px;
  margin: 12px -2px 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fafcf0 0%, var(--surface) 100%);
  border: 1px solid var(--color-lnp-200);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease, transform .1s ease, box-shadow .15s ease;
  min-width: 0;
}
.identity-chip:hover {
  border-color: var(--color-lnp-300);
  box-shadow: 0 4px 14px -6px rgba(84, 104, 17, 0.2);
  transform: translateY(-1px);
}
.identity-chip__avatar {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-lnp-200), var(--color-lnp-100));
  border: 1px solid var(--color-lnp-300);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.identity-chip__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.identity-chip__initial {
  font-size: 15px; font-weight: 700;
  color: var(--color-lnp-700);
  letter-spacing: -0.02em;
}
.identity-chip__body {
  min-width: 0;
  display: flex; flex-direction: column;
  gap: 2px;
}
.identity-chip__name {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.identity-chip__nick {
  font-size: 13px;
  line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.identity-chip__nick--empty {
  color: var(--mute-2);
  font-size: 11px;
  font-style: italic;
}
.identity-chip__aff {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.identity-chip__role {
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--mute);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.identity-chip__email {
  color: var(--mute-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.01em;
  line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Sign out: 워크벤치는 자체 세션이 없고 space NextAuth 세션에 의존한다.
   그래서 로그아웃은 space 로 던지고, 끝나면 워크벤치 그리팅으로 돌아온다. */
.nav a.nav__logout {
  color: var(--mute);
  font-size: 13px;
}
.nav a.nav__logout:hover { color: var(--ink); background: var(--surface); }

/* LNPspace 바로가기 — 워크벤치를 벗어나 상위 플랫폼(space)으로. 사선 화살표로 외부 이동 표시. */
.nav a.nav__ext {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  margin-bottom: -12px;   /* 아래 접속중 '---' 선에 바싹 붙인다 (.nav 의 20px gap 상쇄) */
}
.nav__ext-logo { height: 20px; width: auto; display: block; flex: none; }
/* GitHub 옥토캣 (인라인 SVG, currentColor 로 색 상속) */
.nav__ext-gh { width: 19px; height: 19px; display: block; flex: none; color: var(--ink); }
.nav__ext--gh:hover .nav__ext-gh { color: var(--accent); }
.nav__ext-label { letter-spacing: -0.01em; }
.nav__ext-arw {
  color: var(--mute-2); font-size: 11px; line-height: 1;
  transition: transform .15s ease, color .15s ease;
}
.nav a.nav__ext:hover .nav__ext-arw { color: var(--accent); transform: translate(1px, -1px); }

/* -------------------- 접속중(presence) — 사이드바 하단 -------------------- */
.nav__presence { margin-top: 0; margin-bottom: 10px; padding-top: 12px; border-top: 1px solid var(--rule); }
.nav__presence-head { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--mute); white-space: nowrap; }
.nav__presence-dot { flex: none; }
.nav__presence-head b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.nav__presence-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #12b76a;
  box-shadow: 0 0 0 3px rgba(18,183,106,.16);
  animation: presence-pulse 2.4s ease-in-out infinite;
}
@keyframes presence-pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.nav__presence-list { list-style: none; margin: 9px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.nav__presence-item { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; }
.nav__presence-item .tier { font-size: 12px; }
.nav__presence-anon { color: var(--mute-2); font-style: italic; }
.nav__presence-me { font-size: 9.5px; color: var(--accent-ink); font-weight: 600; }
.nav__presence-more { font-size: 11px; color: var(--mute-2); }
.nav__presence-toggle {
  appearance: none; background: none; border: 0; padding: 2px 0; margin: 0;
  font: inherit; font-size: 11px; color: var(--mute-2); cursor: pointer;
}
.nav__presence-toggle:hover { color: var(--ink); text-decoration: underline; }

/* 접속현황 항목을 눌러 채팅 열기 */
.nav__presence-btn {
  appearance: none; background: none; border: 0; margin: 0; padding: 2px 4px 2px 2px;
  font: inherit; text-align: left; cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; gap: 6px; min-width: 0; width: 100%;
  color: inherit; position: relative;
}
.nav__presence-btn:hover { background: var(--accent-bg); }
.nav__presence-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav__presence-unread {
  flex: none; margin-left: auto; width: 7px; height: 7px; border-radius: 50%;
  background: var(--bad); box-shadow: 0 0 0 3px rgba(240,68,56,.14);
}

/* ── 1:1 채팅 팝업(드래그 이동) ─────────────────────────── */
.chatdock {
  z-index: 80; min-width: 280px; min-height: 300px;
  font-family: var(--font);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--rule-2);
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(16,24,40,.20), 0 3px 10px rgba(16,24,40,.08);
  animation: chatdock-in .18s cubic-bezier(.2,.9,.3,1);
}
.chatdock--min { min-height: 0; }
/* signature: 상단 초록 헤어라인 */
.chatdock::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--color-lnp-green-300));
  z-index: 1; pointer-events: none;
}
@keyframes chatdock-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

.chatdock__bar {
  flex: none; display: flex; align-items: center; gap: 9px;
  padding: 11px 10px 11px 13px; cursor: grab; touch-action: none;
  background: var(--surface); border-bottom: 1px solid var(--rule);
}
.chatdock__bar:active { cursor: grabbing; }
.chatdock__who { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.chatdock__ava { position: relative; flex: none; width: 30px; height: 30px; }
.chatdock__pic { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: block; }
.chatdock__pic--init {
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  color: #fff; background: var(--accent-h);
}
/* 접속중 초록 뱃지 */
.chatdock__online {
  position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%;
  background: #12b76a; border: 2px solid var(--surface);
}
.chatdock__name { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; gap: 1px; }
.chatdock__status { font-size: 10px; color: #12b76a; font-weight: 600; }
.chatdock__anon { color: var(--mute-2); font-style: italic; font-size: 13px; }
.chatdock__ico {
  appearance: none; border: 0; background: none; cursor: pointer; flex: none;
  font-size: 13px; color: var(--mute); padding: 6px 7px; border-radius: 7px; line-height: 1;
}
.chatdock__ico:hover { background: rgba(16,24,40,.06); color: var(--ink); }

.chatdock__list {
  flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px;
  background: var(--color-lnp-green-100);
}
.chatdock__empty { margin: auto; color: var(--mute-2); font-size: 12.5px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.chatdock__empty-mark {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); color: var(--accent-h); font-size: 20px; box-shadow: var(--shadow-sm);
}

.chatday {
  align-self: center; margin: 10px 0 4px; padding: 2px 10px;
  font-size: 11px; color: var(--mute-2); background: var(--surface);
  border-radius: 10px; box-shadow: var(--shadow-sm);
}
.chatmsg {
  max-width: 80%; align-self: flex-start;
  display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap;
  padding: 8px 11px; margin-top: 2px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--rule);
  font-family: var(--font); font-size: 13px; line-height: 1.45; word-break: break-word; white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}
.chatmsg--mine {
  align-self: flex-end; background: var(--accent); border-color: transparent;
  color: var(--color-lnp-green-900);
}
/* 같은 사람 연속 묶음 — 안쪽 모서리를 각지게, 그룹 사이만 간격 */
.chatmsg--first { margin-top: 9px; }
.chatmsg:not(.chatmsg--mine):not(.chatmsg--last) { border-bottom-left-radius: 5px; }
.chatmsg:not(.chatmsg--mine).chatmsg--last { border-bottom-left-radius: 5px; }
.chatmsg:not(.chatmsg--mine):not(.chatmsg--first) { border-top-left-radius: 5px; }
.chatmsg--mine:not(.chatmsg--last) { border-bottom-right-radius: 5px; }
.chatmsg--mine.chatmsg--last { border-bottom-right-radius: 5px; }
.chatmsg--mine:not(.chatmsg--first) { border-top-right-radius: 5px; }
.chatmsg__body { min-width: 0; }
.chatmsg__time { flex: none; font-size: 9.5px; color: var(--mute-2); font-variant-numeric: tabular-nums; }
.chatmsg--mine .chatmsg__time { color: var(--color-lnp-green-700); }

.chatdock__compose {
  flex: none; display: flex; gap: 7px; align-items: flex-end;
  padding: 10px; border-top: 1px solid var(--rule); background: var(--surface);
}
.chatdock__input {
  flex: 1; resize: none; max-height: 96px; min-height: 38px; height: 38px;
  font-family: var(--font); font-size: 13px; line-height: 1.45;
  padding: 9px 12px; border: 1px solid var(--rule-2); border-radius: 20px; background: var(--bg);
  color: var(--ink);
  scrollbar-width: none;  /* 자동 높이는 유지하되 스크롤바는 숨김 */
}
.chatdock__input::-webkit-scrollbar { display: none; }
.chatdock__input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.chatdock__send {
  flex: none; appearance: none; border: 0; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff;  /* 화살표 흰색 */
  transition: background .12s, transform .12s;
}
.chatdock__send:hover:not(:disabled) { background: var(--accent-h); transform: scale(1.05); }
.chatdock__send:disabled { opacity: .45; cursor: default; }

/* 크기조절 핸들 — 우하단(그립 표시) · 좌상단(커서만) */
.chatdock__resize {
  position: absolute; width: 18px; height: 18px;
  cursor: nwse-resize; touch-action: none; z-index: 3;
}
.chatdock__resize--br {
  right: 0; bottom: 0;
  background:
    linear-gradient(135deg, transparent 0 55%, var(--rule-2) 55% 62%, transparent 62% 74%, var(--rule-2) 74% 81%, transparent 81%);
}
.chatdock__resize--tl { left: 0; top: 0; }

/* 떠다니는 마스코트(벤치메이트) — 이제 button(클릭 시 챗). 버튼 크롬 제거. */
.pc-walker {
  appearance: none; border: 0; background: none; padding: 0; margin: 0;
  line-height: 0; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent;
}
.pc-walker:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 14px; }
/* 마스코트 모션 — React index.css 와 동일. 정적 페이지 벤치메이트 아일랜드가 쓴다. */
.pc-walker--held { z-index: 3; filter: drop-shadow(0 8px 8px rgba(16,24,40,0.28)); cursor: grabbing; }
@keyframes pc-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.pc-bob { animation: pc-bob 2.4s ease-in-out infinite; }
@keyframes pc-mascot-wiggle { 0%, 100% { transform: rotate(-11deg); } 50% { transform: rotate(11deg); } }
.pc-mascot-wiggle { animation: pc-mascot-wiggle 0.35s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .pc-bob, .pc-mascot-wiggle { animation: none !important; } }

/* 벤치메이트 챗 전용 손질 (.chatdock 재사용 위에 얹음) */
.matechat__ava .mascot, .matechat__ava > * { border-radius: 50%; }
.matechat__greet { background: var(--accent-bg); border-color: var(--green-300, #c3de83); align-self: stretch; max-width: 100%; }
.matechat__caret {
  display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px;
  background: currentColor; opacity: .55; animation: mate-blink 1s steps(2) infinite;
}
@keyframes mate-blink { 0%,50% { opacity: .55 } 50.01%,100% { opacity: 0 } }
.matechat__stop { background: var(--color-gray-500, #717680); }
.matechat__stop:hover:not(:disabled) { background: var(--color-gray-600, #535862); }
@media (prefers-reduced-motion: reduce) { .matechat__caret { animation: none; } }

/* LLM 답변 마크다운(renderMarkdown) — 볼드/목록/코드 등 */
.chatmsg__body .md > :first-child { margin-top: 0; }
.chatmsg__body .md > :last-child { margin-bottom: 0; }
.chatmsg__body .md-p { margin: .4em 0; }
.chatmsg__body .md-h { font-weight: 700; margin: .6em 0 .3em; }
.chatmsg__body .md-h1 { font-size: 1.15em; }
.chatmsg__body .md-h2 { font-size: 1.08em; }
.chatmsg__body .md-ul, .chatmsg__body .md-ol { margin: .4em 0; padding-left: 1.3em; }
.chatmsg__body .md-ul li, .chatmsg__body .md-ol li { margin: .15em 0; }
.chatmsg__body .md-code { background: var(--color-gray-100, #f2f4f7); border-radius: 4px; padding: .05em .35em; font-size: .92em; }
.chatmsg__body .md-pre { background: var(--color-gray-100, #f2f4f7); border-radius: 6px; padding: .6em .8em; margin: .5em 0; overflow-x: auto; }
.chatmsg__body .md-pre code { background: none; padding: 0; font-size: .9em; white-space: pre; }

/* LLM 답변 안의 표. 좁은 챗독에서도 읽히게 가로 스크롤만 허용하고, 숫자는 우측정렬 없이
   tabular-nums 로 자릿수만 맞춘다(단위가 섞여 있어 정렬은 오히려 헷갈린다). */
.chatmsg__body .md-tablewrap { margin: .5em 0; overflow-x: auto; }
.chatmsg__body .md-table { border-collapse: collapse; width: 100%; font-size: .92em; }
.chatmsg__body .md-table th,
.chatmsg__body .md-table td { padding: .35em .6em; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.chatmsg__body .md-table th { font-weight: 600; color: var(--mute); background: var(--surface-2); border-bottom-color: var(--rule-2); }
.chatmsg__body .md-table td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chatmsg__body .md-table tr:last-child td { border-bottom: none; }

/* LLM 답변 안의 인라인 SVG 차트(lib/chart.tsx). 한 계열만 그리므로 범례는 없고
   제목이 계열 이름을 맡는다. 값 텍스트는 계열색이 아니라 ink 토큰을 쓴다. */
.chatmsg__body .mdchart { margin: .6em 0; padding: 0; overflow-x: auto; }
.chatmsg__body .mdchart__cap { font-size: .85em; font-weight: 600; color: var(--ink-2); margin-bottom: .35em; }
.chatmsg__body .mdchart__svg { display: block; min-width: 320px; }
.mdchart__lab  { font-size: 11px; fill: var(--mute); }
.mdchart__val  { font-size: 11px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.mdchart__tick { font-size: 10px; fill: var(--mute-2); font-variant-numeric: tabular-nums; }
.mdchart__axis { font-size: 10px; fill: var(--mute); }

/* 대화 목록 패널 — 메시지 영역 위에 덮이는 오버레이 */
.matechat__panel {
  position: absolute; left: 0; right: 0; top: 53px; bottom: 60px; z-index: 4;
  background: var(--surface); border-bottom: 1px solid var(--rule);
  display: flex; flex-direction: column; padding: 10px; gap: 8px;
  animation: chatdock-in .14s ease-out;
}
.matechat__new {
  flex: none; appearance: none; border: 1px dashed var(--accent); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-bg); padding: 9px; border-radius: 10px;
}
.matechat__new:hover { background: var(--color-lnp-green-200, #e3f4c1); }
.matechat__sess-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.matechat__sess-empty { margin: auto; text-align: center; color: var(--mute-2); font-size: 12px; line-height: 1.6; }
.matechat__sess {
  appearance: none; border: 1px solid transparent; cursor: pointer; font: inherit; text-align: left;
  background: none; padding: 8px 30px 8px 10px; border-radius: 9px; position: relative;
  display: flex; flex-direction: column; gap: 2px; width: 100%;
}
.matechat__sess:hover { background: var(--surface-2); }
.matechat__sess--on { background: var(--accent-bg); border-color: var(--accent); }
.matechat__sess-title { font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matechat__sess-meta { font-size: 10.5px; color: var(--mute-2); font-variant-numeric: tabular-nums; }
.matechat__sess-del {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px;
  color: var(--mute-2); font-size: 11px;
}
.matechat__sess-del:hover { background: rgba(240,68,56,.10); color: var(--bad); }

/* 우클릭 컨텍스트 메뉴(내 메시지 삭제) */
.chatmenu {
  z-index: 90; min-width: 112px; padding: 4px;
  background: var(--surface); border: 1px solid var(--rule-2); border-radius: 10px;
  box-shadow: 0 10px 26px rgba(16,24,40,.18), 0 2px 6px rgba(16,24,40,.08);
}
.chatmenu__item {
  appearance: none; border: 0; background: none; cursor: pointer; width: 100%;
  text-align: left; font: inherit; font-size: 12.5px; padding: 8px 10px; border-radius: 7px; color: var(--ink);
}
.chatmenu__item:hover { background: var(--surface-2); }
.chatmenu__item--danger { color: var(--bad); }
.chatmenu__item--danger:hover { background: rgba(240,68,56,.08); }

@media (max-width: 480px) {
  .chatdock { width: calc(100vw - 16px); height: min(70vh, 460px); }
}
@media (prefers-reduced-motion: reduce) {
  .chatdock, .chatdock__send { animation: none; transition: none; }
}

/* -------------------- overview page --------------------
   The overview is a lab-notebook cover page. The greeting is the hero —
   large Korean sentence + user's name — and everything below it (Launch,
   Recent) is small monospace log grammar. Chromatic identity: near-pure
   grayscale, with LNP green appearing in only three places:
     1. the "today" dot next to the date
     2. the CHAT tag in feed rows
     3. hover state on links / rows
   Nothing else uses color. Restraint is the point. */
.overview { max-width: 720px; padding-top: 8px; }
.overview-page .container { max-width: 640px; padding-top: 16px; }

/* --- header block ------------------------------------------------------ */
.overview__head { margin: 8px 0 56px; }
.overview__date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--mute-2);
  text-transform: uppercase;
  margin-bottom: 18px;
}
/* The single tiny green dot on the whole page: an ambient "you are here"
   mark for today. This is the smallest possible way to keep the brand color
   present without spending it on a big surface. */
.overview__date::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.overview__hello {
  color: var(--ink);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}
.overview-page .overview__hello { margin: 0; }
.overview__hello-who {
  display: block;
  margin-top: 6px;
  color: var(--mute);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  font-family: var(--mono);
}

/* 인사말 아래 — 칭호가 있으면 이 한 줄이 하루의 무드 브랜드가 된다 */
.overview__title {
  margin: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  color: var(--mute-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.overview__title-eyebrow { flex-shrink: 0; }
.overview__title-nick {
  font-family: var(--font);
  font-size: 22px;
  letter-spacing: -0.01em;
  text-transform: none;
}

/* --- section header ---------------------------------------------------- */
/* Mono uppercase eyebrow with a rule that stretches to fill the row. Reads
   like a chapter break in a notebook. */
.section-h {
  display: flex; align-items: center; gap: 12px;
  color: var(--mute-2);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 14px;
}
.section-h::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* --- launch: two tools, quiet rows ------------------------------------- */
/* Rejecting the tile format. Every day the user opens this page — a big
   pretty card is louder than useful. A named row with a monospace hint
   at right (Open ↗) is what actually gets clicked. */
.tools { margin: 0 0 52px; }
.tools__actions {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}
.tool-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 24px;
  padding: 16px 4px 15px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  transition: color 120ms ease;
}
.tool-card:hover { text-decoration: none; }
.tool-card:hover .tool-card__label { color: var(--accent-ink); }
.tool-card:hover .tool-card__arrow { color: var(--ink); transform: translateX(2px); }
.tool-card__main { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.tool-card__label {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  transition: color 120ms ease;
  white-space: nowrap;
}
.tool-card__sub {
  color: var(--mute);
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-card__arrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--mute-2);
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 120ms ease, transform 120ms ease;
}
/* --accent removed: no filled color surfaces on this page. Ordering alone
   carries "the most recent tool" — the row on top IS the answer. */

/* --- recent activity --------------------------------------------------- */
.activity { margin: 0; }
.activity__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}
/* Override the section-h rule inside activity__head so the "All →" link
   sits where the rule would otherwise stretch. */
.activity__head .section-h { margin: 0; flex: 1; }
.activity__head .section-h::after { display: block; }
.link-muted {
  color: var(--mute);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.link-muted:hover { color: var(--accent-ink); text-decoration: none; }

.activity__feed {
  border-top: 1px solid var(--rule);
}
.feed-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  padding: 11px 4px 11px 0;
  border-bottom: 1px solid var(--rule);
}
.feed-row__tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--mute-2);
  text-transform: uppercase;
}
/* CHAT gets the accent — the second (and last) chromatic touch on the page,
   after the "today" dot. FILE stays grayscale on purpose. */
.feed-row--chat .feed-row__tag { color: var(--accent-ink); }
.feed-row__title {
  color: var(--ink);
  font-size: 14px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-row__title[data-failed] {
  color: var(--mute-2);
  text-decoration: line-through;
  text-decoration-color: var(--rule-2);
}
.feed-row__meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute-2);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
a.feed-row { color: inherit; }
a.feed-row:hover { text-decoration: none; }
a.feed-row:hover .feed-row__title { color: var(--accent-ink); }
.feed-row--btn {
  all: unset;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  padding: 11px 4px 11px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.feed-row--btn:hover .feed-row__title { color: var(--accent-ink); }
.feed-row--btn:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }

/* Skeleton — brief placeholder while /api/mypage resolves */
.activity__skeleton {
  border-top: 1px solid var(--rule);
}
.skel-row {
  height: 42px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(90deg, transparent 0, rgba(0,0,0,0.03) 40%, transparent 80%);
  background-size: 200% 100%;
  animation: skel-shine 1.2s linear infinite;
}
@keyframes skel-shine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state — plain typography, no box. Matches the notebook tone. */
.activity__empty {
  padding: 20px 0 4px;
  border-top: 1px solid var(--rule);
}
.activity__empty-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 4px;
}
.activity__empty-body {
  color: var(--mute);
  font-size: 13px;
  margin: 0;
  line-height: 1.55;
}
.activity__empty b {
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 560px) {
  .start__actions { grid-template-columns: 1fr; }
  .feed-row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; }
}

/* -------------------- page shell -------------------- */
.page { padding: 40px 0 64px; }
.page__title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  color: var(--ink);
}
.page__desc {
  color: var(--mute);
  font-size: 14px;
  margin: 0 0 28px;
  max-width: 60ch;
}
.section { margin-top: 40px; }
.section__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--mute);
  margin: 0 0 12px;
}

/* -------------------- toolkit list -------------------- */
.toolkit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tool {
  display: flex; flex-direction: column;
  padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.tool.is-active:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 15%, transparent);
  text-decoration: none;
}
.tool.is-active:hover .tool__cta { color: var(--accent-ink); }
.tool.is-inactive {
  background: transparent;
  color: var(--mute);
  cursor: default;
}
.tool__name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.tool.is-inactive .tool__name { color: var(--mute); font-weight: 500; }
.tool__desc {
  margin: 4px 0 0;
  color: var(--mute);
  font-size: 13.5px;
}
.tool__cta {
  margin-top: 14px;
  color: var(--mute);
  font-size: 12.5px;
  transition: color .12s ease;
}
.tool__cta::after { content: " →"; }

/* -------------------- cards / forms -------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px;
}
.card + .card { margin-top: 14px; }
.card__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.card__help {
  color: var(--mute);
  font-size: 13px;
  margin: 0 0 14px;
}

/* -------------------- buttons -------------------- */
.btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--surface);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 6px;
  transition: background .12s ease, border-color .12s ease, transform .1s ease, color .12s ease;
}
.btn:not(:disabled):hover { background: var(--color-gray-800); border-color: var(--color-gray-800); }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn:disabled {
  cursor: not-allowed;
  background: var(--color-gray-100);
  border-color: var(--rule);
  color: var(--mute-2);
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--color-lnp-green-900);
}
.btn--primary:not(:disabled):hover {
  background: var(--accent-h);
  border-color: var(--accent-h);
  color: #fff;
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-2);
}
.btn--ghost:not(:disabled):hover {
  background: var(--color-gray-100);
  border-color: var(--color-gray-400);
}
.btn--sm { padding: 5px 10px; font-size: 12.5px; }

/* -------------------- my page: identity + profile form -------------------- */

/* 아이덴티티 카드 — 이 페이지의 하나뿐인 강조. 은은한 배경 그라데이션 + 큰 아바타.
   ::before 로 오른쪽 위 브랜드 발광 원을 겹쳐서 워크벤치의 lnp-green 을 정체성으로 삼는다. */
.identity {
  position: relative;
  overflow: hidden;
  padding: 28px 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(144, 184, 33, 0.12), transparent 55%),
    linear-gradient(180deg, #fafcf0 0%, var(--surface) 100%);
  border-color: var(--color-lnp-green-300);
}
.identity::before {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(195, 222, 131, 0.22), transparent 70%);
  pointer-events: none;
}
.identity__photo {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  position: relative;
  z-index: 1;
}
.identity__photo-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.identity__photo-hint { color: var(--mute-2); font-size: 11px; margin: 0; text-align: center; }
.identity__meta { min-width: 0; position: relative; z-index: 1; }
.identity__name {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  word-break: keep-all;
  line-height: 1.15;
}
.identity__nickname {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.2;
}
.identity__nickname[hidden] { display: none; }
.identity__role {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 12px 0 0;
  padding: 4px 10px 4px 4px;
  color: var(--mute);
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.identity__role-dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.identity__email {
  margin: 12px 0 0;
  color: var(--mute-2);
}

/* 아바타 (사진 or 이니셜) — 아이덴티티 카드의 시선 무게중심 */
.avatar {
  position: relative;
  width: 112px; height: 112px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-lnp-green-200), var(--color-lnp-green-100));
  border: 3px solid var(--surface);
  box-shadow:
    0 0 0 1px var(--color-lnp-green-300),
    0 8px 24px -8px rgba(84, 104, 17, 0.25);
  display: flex; align-items: center; justify-content: center;
}
.avatar__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar__initial {
  font-size: 40px;
  font-weight: 700;
  color: var(--color-lnp-green-700);
  letter-spacing: -0.02em;
}

.btn--danger { color: var(--color-red-600); }
.btn--danger:hover { color: var(--color-red-600); background: #fef3f2; border-color: #fecdca; }

/* 상태 배너 (저장/오류) */
.profile-status {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  background: var(--color-gray-100);
  color: var(--ink-2);
  border: 1px solid var(--rule);
}
.profile-status[data-tone="ok"] {
  background: var(--accent-bg);
  color: var(--color-lnp-green-700);
  border-color: var(--color-lnp-green-300);
}
.profile-status[data-tone="err"] {
  background: #fef3f2;
  color: var(--color-red-600);
  border-color: #fecdca;
}

/* 프로필 폼 그룹 카드 */
.profile-form { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.form-group__head {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.form-group__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.form-group__hint {
  margin: 4px 0 0;
  color: var(--mute);
  font-size: 12.5px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--span2 { grid-column: 1 / -1; }
.field__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--mute);
}
.field__label em {
  font-style: normal;
  color: var(--color-red-500);
  margin-left: 2px;
}
.field__input {
  padding: 9px 11px;
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
  width: 100%;
}
.field__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(144, 184, 33, 0.15);
}
.field__input--mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; }
.field__input--area { resize: vertical; min-height: 68px; line-height: 1.5; }
.field__hint {
  color: var(--mute-2);
  font-size: 11.5px;
}
.field__hint--right { text-align: right; }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}
.form-actions__dirty {
  margin-right: auto;
  font-size: 12.5px;
  color: var(--accent-ink);
}

/* narrow: 카드가 세로로 쌓이고 폼도 1열 */
@media (max-width: 640px) {
  .identity {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .identity__meta { text-align: center; }
  .identity__role { align-self: center; }
  .form-grid { grid-template-columns: 1fr; }
  .form-actions { flex-wrap: wrap; }
  .form-actions__dirty { width: 100%; text-align: right; margin-right: 0; }
  .tier-grid { grid-template-columns: 1fr; }
}

/* -------------------- nickname tier effects (lnpspace 포팅) --------------------
   워크벤치는 근속 잠금을 쓰지 않는다. 등급은 6개 전부 오픈. */
@keyframes lnp-shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes lnp-floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes lnp-spin {
  100% { transform: rotate(360deg); }
}
@keyframes lnp-twinkle {
  0%, 100% { opacity: .15; transform: scale(.6); }
  50% { opacity: 1; transform: scale(1); }
}

.tier {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;   /* 긴 별명이 두 줄로 접히지 않게 — 넘치면 .nick-scroll 이 가로 스크롤 */
}
.tier-grad {
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: lnp-shimmer 4s linear infinite;
}
.tier-star { position: absolute; pointer-events: none; }
.tier-spin { display: inline-block; animation: lnp-spin 6s linear infinite; font-size: 0.75em; }
.tier-float { display: inline-block; animation: lnp-floaty 3s ease-in-out infinite; }

.tier-normal { color: #78716c; }
.tier-hero { background-image: linear-gradient(90deg, #6d28d9, #be185d, #6d28d9); animation-duration: 3s; }
.tier-legend { background-image: linear-gradient(90deg, #b45309, #f59e0b, #fbbf24, #f59e0b, #b45309); animation-duration: 2.5s; }
.tier-myth {
  background-image: linear-gradient(90deg, #b45309, #be185d, #6d28d9, #0d9488, #b45309);
  background-size: 300% auto;
  animation-duration: 3s;
}

/* 반짝이 별 (전설·신화) */
.tier-legend-wrap { position: relative; display: inline-block; }
.tier-legend-wrap .tier-star.left {
  left: -10px; top: -6px;
  color: #f59e0b;
  animation: lnp-twinkle 1.6s infinite;
}
.tier-legend-wrap .tier-star.right {
  right: -8px; top: -4px;
  color: var(--accent);
  animation: lnp-twinkle 1.9s infinite .9s;
}

/* ── 해금 전용 디자인 (신화 위, 누적 사용량으로 열림) ── */
@keyframes lnp-holo-hue {
  0%, 100% { filter: hue-rotate(0deg) brightness(1); }
  50%      { filter: hue-rotate(40deg) brightness(1.18); }
}
@keyframes lnp-flame-rise {
  0%   { background-position: center 0%; }
  100% { background-position: center 200%; }
}
@keyframes lnp-flame-flick {
  0%, 100% { transform: scaleY(1);    filter: brightness(1); }
  45%      { transform: scaleY(1.06); filter: brightness(1.14); }
  70%      { transform: scaleY(.97);  filter: brightness(.95); }
}

/* 오로라 — 초록·청록·보라가 흐른다 */
.tier-aurora {
  background-image: linear-gradient(90deg, #34d399, #22d3ee, #60a5fa, #a78bfa, #34d399);
  background-size: 300% auto;
  animation-duration: 6s;
  filter: drop-shadow(0 0 6px rgba(45, 212, 191, .25));
}

/* 홀로그램 — 무지갯빛이 어른거린다(색조 흔들림) */
.tier-holo-wrap { display: inline-flex; }
.tier-holo {
  background-image: linear-gradient(90deg, #22d3ee, #a78bfa, #f472b6, #38bdf8, #22d3ee);
  background-size: 250% auto;
  animation: lnp-shimmer 3s linear infinite, lnp-holo-hue 4s ease-in-out infinite;
}

/* 은하수 — 짙은 남보라·자홍, 양옆 별 반짝임 */
.tier-galaxy {
  background-image: linear-gradient(90deg, #4338ca, #7c3aed, #db2777, #6366f1, #4338ca);
  background-size: 260% auto;
  animation-duration: 5s;
  filter: drop-shadow(0 0 6px rgba(124, 58, 237, .28));
}
.tier-galaxy-wrap { position: relative; display: inline-block; }
.tier-galaxy-wrap .tier-star.left {
  left: -11px; top: -6px; color: #c4b5fd;
  animation: lnp-twinkle 1.5s infinite;
}
.tier-galaxy-wrap .tier-star.right {
  right: -10px; top: -4px; color: #f9a8d4;
  animation: lnp-twinkle 1.8s infinite .7s;
}

/* 화염 — 불꽃이 위로 일렁인다 */
.tier-flame {
  background-image: linear-gradient(0deg, #f59e0b 0%, #ef4444 35%, #fb923c 60%, #fbbf24 100%);
  background-size: auto 250%;
  animation: lnp-flame-rise 2.4s linear infinite;
  filter: drop-shadow(0 0 5px rgba(249, 115, 22, .35));
}
.tier-flame-flick {
  display: inline-block;
  transform-origin: bottom center;
  animation: lnp-flame-flick 1.4s ease-in-out infinite;
}

/* 프리즘 — 최상위. 프리즘처럼 갈라지는 전 색상 스펙트럼 */
.tier-prism {
  background-image: linear-gradient(90deg, #ef4444, #f59e0b, #facc15, #22c55e, #22d3ee, #3b82f6, #a855f7, #ef4444);
  background-size: 400% auto;
  animation-duration: 4s;
  filter: drop-shadow(0 0 6px rgba(168, 85, 247, .3));
}

/* 심해 — 깊은 청록·남색이 잔잔히 흐른다 */
.tier-ocean {
  background-image: linear-gradient(90deg, #0e7490, #06b6d4, #38bdf8, #14b8a6, #0e7490);
  background-size: 300% auto;
  animation-duration: 5s;
  filter: drop-shadow(0 0 6px rgba(6, 182, 212, .3));
}

/* 네온 — 자홍·청록이 네온사인처럼 번쩍인다(글로우 점멸) */
@keyframes lnp-neon-glow {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(236, 72, 153, .6)) drop-shadow(0 0 8px rgba(34, 211, 238, .4)); }
  50%      { filter: drop-shadow(0 0 6px rgba(236, 72, 153, .95)) drop-shadow(0 0 15px rgba(34, 211, 238, .75)); }
}
.tier-neon {
  background-image: linear-gradient(90deg, #f0abfc, #22d3ee, #f472b6, #67e8f9, #f0abfc);
  background-size: 280% auto;
  animation: lnp-shimmer 3.5s linear infinite, lnp-neon-glow 1.8s ease-in-out infinite;
}

/* 벚꽃 — 연분홍·산호빛이 은은히 흐르고 살랑인다(❀ 는 tier-float 로 떠오름) */
.tier-sakura {
  background-image: linear-gradient(90deg, #fbcfe8, #f9a8d4, #fda4af, #f9a8d4, #fbcfe8);
  background-size: 260% auto;
  animation-duration: 6s;
  filter: drop-shadow(0 0 5px rgba(244, 114, 182, .3));
}

/* ── 상점 구매 전용 디자인 ── */
/* 자정 — 깊은 남색·인디고가 잔잔히 흐르고 양옆 별이 반짝인다 */
.tier-midnight {
  background-image: linear-gradient(90deg, #1e3a8a, #4338ca, #6366f1, #3730a3, #1e3a8a);
  background-size: 280% auto;
  animation-duration: 5.5s;
  filter: drop-shadow(0 0 6px rgba(79, 70, 229, .35));
}
.tier-midnight-wrap { position: relative; display: inline-block; }
.tier-midnight-wrap .tier-star.left {
  left: -11px; top: -6px; color: #a5b4fc;
  animation: lnp-twinkle 1.7s infinite;
}
.tier-midnight-wrap .tier-star.right {
  right: -9px; top: -4px; color: #c7d2fe;
  animation: lnp-twinkle 2s infinite .8s;
}

/* 캔디 — 알록달록 파스텔이 통통 튄다 */
.tier-candy {
  background-image: linear-gradient(90deg, #fca5f5, #a5f3fc, #fde68a, #bbf7d0, #fca5f5);
  background-size: 300% auto;
  animation-duration: 4.5s;
  filter: drop-shadow(0 0 5px rgba(236, 153, 245, .3));
}

/* 에메랄드 — 보석처럼 반짝이는 초록·청록(♦ 장식) */
.tier-emerald {
  background-image: linear-gradient(90deg, #047857, #10b981, #34d399, #06b6d4, #047857);
  background-size: 280% auto;
  animation-duration: 4s;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, .35));
}

@media (prefers-reduced-motion: reduce) {
  .tier-grad, .tier-star, .tier-spin, .tier-float,
  .tier-holo, .tier-flame, .tier-flame-flick, .tier-neon {
    animation: none !important;
    filter: none !important;
    transform: none !important;
  }
  .tier-star { opacity: .8; }
}

/* -------------------- 별명 움직임 효과 + 긴 별명 스크롤 --------------------
   움직임 효과(nick-fx)는 tier 의 색/그라데이션 애니메이션과 독립적인 '바깥 래퍼' transform
   이라 어떤 칭호와도 겹쳐 쓸 수 있다. 긴 별명은 nick-scroll 이 가로로 스크롤한다. */
/* 긴 별명: 스크롤바가 아니라 좌우로 천천히 왕복(마퀴). 넘칠 때만 움직인다
   (JS 가 폭을 재서 is-run + --shift/--dur 를 준다. 짧으면 가만히 있음). */
.nick-marquee { display: inline-block; max-width: 100%; overflow: hidden; white-space: nowrap; vertical-align: bottom; }
.nick-marquee__inner { display: inline-block; white-space: nowrap; }
.nick-marquee__inner.is-run {
  animation: nick-marquee var(--dur, 6s) ease-in-out infinite alternate;
}
/* 확인 모달(useConfirm) 등장 애니메이션 — 정적 페이지는 common.js 가 같은 이름으로 주입한다. */
@keyframes appCfIn {
  from { opacity: 0; transform: translateY(10px) scale(.94); }
  to   { opacity: 1; transform: none; }
}

@keyframes nick-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--shift, 0)); }
}
@media (prefers-reduced-motion: reduce) {
  .nick-marquee__inner.is-run { animation: none; }
}

/* 폴백(측정 JS 가 아직 안 붙은 순간): 넘쳐도 줄바꿈·스크롤바 없이 잘리게만. */
.nick-scroll { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; }

.nick-fx { display: inline-block; will-change: transform; }
.nick-fx-pulse  { animation: nick-pulse 1.6s ease-in-out infinite; }
.nick-fx-sway   { animation: nick-sway 1.4s ease-in-out infinite; }
.nick-fx-bounce { animation: nick-bounce 1.1s ease-in-out infinite; }
.nick-fx-shake  { animation: nick-shake 0.5s ease-in-out infinite; }
@keyframes nick-pulse  { 0%, 100% { transform: scale(1); }       50% { transform: scale(1.14); } }
@keyframes nick-sway   { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
@keyframes nick-bounce { 0%, 100% { transform: translateY(0); }   50% { transform: translateY(-3px); } }
@keyframes nick-shake  {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25%      { transform: translateX(-1.5px) rotate(-2.5deg); }
  75%      { transform: translateX(1.5px) rotate(2.5deg); }
}
/* 글리치(shake) — 단어 통째가 아니라 글자마다 좌우로 흔든다(스태거 딜레이는 인라인).
   움직임을 transform 이 아니라 position:left 로 준다 — 그라데이션 칭호(배경-클립 텍스트)에서
   글자에 transform 이 걸리면 그 글자가 별도 레이어로 빠져 부모 그라데이션 클립이 끊기고,
   보정하려고 글자마다 자체 클립을 주면 부모와 이중으로 칠해져 '겹침'이 생긴다. position:left
   는 레이어 승격을 일으키지 않아, 각 글자가 부모의 '연속' 그라데이션을 그대로 물려받은 채
   좌우로만 흔들린다(겹침·끊김 없음). display 는 inline 유지 = 부모 클립 포함 보장. */
.nick-letter {
  position: relative;
  animation: nick-letter-x 0.5s ease-in-out infinite;
}
@keyframes nick-letter-x {
  0%, 100% { left: 0; }
  25%      { left: -1.6px; }
  75%      { left: 1.6px; }
}

/* 긴 별명이 마퀴로 '스크롤 중'일 때는 별명 움직임 효과(글자별 글리치·통짜 wobble)의
   transform 을 정지한다. 스크롤 자체가 이미 움직임이라 효과가 안 보이는데다, 움직이는
   마퀴(transform) 위에서 글자마다 transform+배경클립 레이어가 흔들리면 크로뮴에서
   글자가 깜빡이거나 사라진다(긴 별명에서만 마퀴가 켜져 재현). 글자별 클립 구조 자체는
   그대로 두고(정적 렌더는 정상), 움직임만 멈춰 겹침·깜빡임을 없앤다. */
.nick-marquee__inner.is-run .nick-fx,
.nick-marquee__inner.is-run .nick-letter {
  animation: none !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .nick-fx-pulse, .nick-fx-sway, .nick-fx-bounce, .nick-fx-shake,
  .nick-letter { animation: none !important; }
}

/* -------------------- tier picker (마이페이지) -------------------- */
.tier-panel { }
.tier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tier-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color .12s ease, background .12s ease, transform .08s ease;
  min-width: 0;
}
.tier-option:hover { border-color: var(--rule-2); background: var(--color-gray-50); }
.tier-option:active { transform: translateY(1px); }
.tier-option[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: 0 0 0 3px rgba(144, 184, 33, 0.15);
}
.tier-option__preview {
  flex: 1; min-width: 0;
  font-size: 15px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tier-option__label {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tier-option__color {
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  width: 22px; height: 22px;
  padding: 0;
  border: 1px solid var(--rule-2);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}
.tier-option__color::-webkit-color-swatch-wrapper { padding: 0; }
.tier-option__color::-webkit-color-swatch { border: none; border-radius: 50%; }
.tier-option__color::-moz-color-swatch { border: none; border-radius: 50%; }
.tier-panel__hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--mute-2);
}

/* -------------------- dropzone -------------------- */
.dropzone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px dashed var(--rule-2);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
  background: var(--color-gray-50);
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.dropzone:hover {
  border-color: var(--color-lnp-green-300);
  background: var(--surface);
  box-shadow: 0 6px 18px -14px rgba(84, 104, 17, 0.35);
}
.dropzone.is-drag {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-bg);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 16%, transparent);
}

/* 아이콘 배지 — lnp-green */
.dropzone__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--color-lnp-green-700);
  background: linear-gradient(135deg, var(--color-lnp-green-200), var(--color-lnp-green-100));
  box-shadow: inset 0 0 0 1px var(--color-lnp-green-300);
  transition: transform .16s ease;
}
.dropzone__icon svg { width: 18px; height: 18px; display: block; }
.dropzone.is-drag .dropzone__icon { transform: translateY(-1px) scale(1.05); }

.dropzone__text { min-width: 0; }
.dropzone__title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.dropzone__hint { color: var(--mute); font-size: 12px; margin-top: 1px; }
.dropzone input[type="file"] { display: none; }

.file-list {
  margin: 14px 0 0;
  list-style: none; padding: 0;
  display: grid; gap: 4px;
}
.file-list li {
  display: grid;
  grid-template-columns: minmax(0,1fr) 80px 20px;
  gap: 12px; align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 13px;
  background: var(--surface);
}
.file-list li .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li .fsize { color: var(--mute); text-align: right; font-family: var(--mono); font-size: 12px; }
.file-list li button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--mute); font-size: 16px; line-height: 1;
}
.file-list li button:hover { color: var(--bad); }

.actions { display: flex; gap: 8px; margin-top: 16px; }

/* -------------------- progress -------------------- */
.progress {
  height: 2px;
  background: var(--rule);
  border-radius: 2px;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width .3s ease;
}
.progress__label { margin-top: 8px; font-size: 12.5px; color: var(--mute); }

/* -------------------- tabs / results -------------------- */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--rule);
  margin: 0 0 14px;
  overflow-x: auto;
  overflow-y: hidden;   /* overflow-x:auto 가 y 를 auto 로 승격시켜 .tab 의 -1px margin 이
                           1px 세로 스크롤바를 만드는 것 방지 (탭바는 세로 스크롤 불필요) */
}
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--mute);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab .tab__err { color: var(--bad); margin-left: 4px; }

.result__toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 10px;
  flex-wrap: wrap;
}
.result__meta { color: var(--mute); font-size: 12.5px; }
.result__meta .mono { color: var(--ink); }

.viewer {
  height: 520px; overflow: auto;
  background: var(--color-gray-50);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.viewer.mode-source { padding: 0; }
.viewer.mode-source pre {
  margin: 0; padding: 20px 22px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
  color: var(--ink);
}

/* rendered markdown */
.md { color: var(--ink-2); }
.md h1, .md h2, .md h3 { color: var(--ink); letter-spacing: -0.005em; margin: 1.4em 0 .4em; }
.md h1 { font-size: 20px; }
.md h2 { font-size: 17px; }
.md h3 { font-size: 15px; }
.md p, .md li { margin: .5em 0; }
.md code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--surface); padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--rule);
}
.md pre {
  background: var(--color-gray-900); color: var(--color-gray-50);
  padding: 12px 14px; border-radius: 6px; overflow: auto;
}
.md pre code { background: transparent; border: 0; color: inherit; }
.md table { border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.md th, .md td { border: 1px solid var(--rule); padding: 6px 10px; }
.md blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 12px; color: var(--mute); margin: .8em 0;
}
.md a { color: var(--accent-ink); }

/* -------------------- chat -------------------- */
.chat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 16px;
  align-items: start;
}
.chat__panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  height: 72vh;
  min-height: 480px;
  overflow: hidden;
}
.chat__log {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 18px;
}
.chat__empty {
  margin: auto; text-align: center; color: var(--mute); font-size: 13px;
  max-width: 36ch;
}
.msg { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 12px; }
.msg__role {
  font-size: 12px;
  color: var(--mute);
  padding-top: 2px;
}
.msg--assistant .msg__role { color: var(--accent-ink); }
.msg--user .msg__role { color: var(--ink); }
.msg__body { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; }
.msg__body.md p:first-child { margin-top: 0; }
.msg__body.md p:last-child { margin-bottom: 0; }

.chat__composer {
  border-top: 1px solid var(--rule);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px; align-items: end;
  background: var(--color-gray-50);
}
.chat__composer textarea {
  resize: none;
  min-height: 38px; max-height: 160px;
  border: 1px solid var(--rule);
  background: var(--surface);
  border-radius: 6px;
  padding: 9px 12px;
  font-family: var(--font); font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.chat__composer textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}

.chat__side .card { margin-bottom: 12px; padding: 16px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; color: var(--mute);
}
.field label b {
  color: var(--ink); font-weight: 500;
  font-family: var(--mono); font-size: 12px;
}
.field input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 3px; background: var(--rule); border-radius: 2px;
}
.field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--accent-h);
  cursor: pointer;
}
.field input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  cursor: pointer;
}

/* -------------------- mypage: stats + row list + pill + modal -------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: 20px 24px;
}
.stat__label {
  font-size: 12.5px;
  color: var(--mute);
  margin-bottom: 4px;
}
.stat__value {
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.row-list { list-style: none; padding: 0; margin: 0; }
.row-list__empty {
  padding: 24px; text-align: center;
  color: var(--mute); font-size: 13px;
}
.row-list__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
  align-items: center;
}
.row-list__row:first-child { border-top: 0; }
.row-list__title {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-list__meta {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--mute);
}
.row-list__err {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--bad);
}
.row-list__actions { display: flex; gap: 6px; }

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  padding: 1px 6px;
  border-radius: 3px;
  vertical-align: middle;
}
.pill--ok  { background: color-mix(in oklab, var(--ok) 15%, var(--surface));  color: var(--color-green-600); }
.pill--bad { background: color-mix(in oklab, var(--bad) 12%, var(--surface)); color: var(--color-red-600); }

.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  z-index: 100;
  padding: 24px;
}
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(16, 24, 40, .35);
  backdrop-filter: blur(2px);
}
.modal__panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 80vh;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 20px 40px -12px rgba(16,24,40,.25);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal__head {
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--rule);
}
.modal__eyebrow {
  font-size: 11px;
  color: var(--mute);
  margin-bottom: 2px;
}
.modal__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.modal__body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
}
.modal__loading {
  padding: 8px 0;
  color: var(--mute);
  font-size: 13px;
}

/* -------------------- results page --------------------
   A workbench log. Rows use the same [.feed-row] grammar as the overview.
   The signature here is the day breaker: a hairline rule + KO relative label
   + monospace calendar key ("07-25"), so the log reads like a notebook. */
.container--narrow { max-width: 760px; }

.results-head { margin: 0 0 32px; }
.results-head__eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent-ink);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.results-head__title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 6px;
}
.results-head__desc {
  color: var(--mute);
  font-size: 14px;
  margin: 0;
  max-width: 52ch;
}

/* Chip filter — segmented, low-chrome. Active chip carries the accent as a
   thin underline rather than a filled pill; keeps the page monochrome. */
.chips {
  display: inline-flex;
  gap: 24px;
  margin: 0 0 20px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0;
}
.chip {
  all: unset;
  cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 8px 0 10px;
  color: var(--mute);
  font-size: 13.5px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; /* overlap the .chips underline */
}
.chip:hover { color: var(--ink); }
.chip.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.chip__count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute-2);
  letter-spacing: 0.02em;
}
.chip.is-active .chip__count { color: var(--accent-ink); }

/* Log — day-broken timeline of feed rows. */
.log { display: flex; flex-direction: column; gap: 32px; margin-top: 8px; }
.log__day { display: flex; flex-direction: column; }
.log__day-head {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 0 8px;
}
.log__day-rule {
  flex: 0 0 22px;
  height: 1px;
  background: var(--rule);
}
.log__day-label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.log__day-key {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--mute-2);
  letter-spacing: 0.06em;
}
.log__day-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.log__rows { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.log__rows .feed-row,
.log__rows .feed-row--btn { width: 100%; }

/* Row wrapper: two-column grid — clickable content on the left, 삭제 button
   floating on the right. No divider line; whitespace + hover chip carry the
   separation. The .feed-row inside surrenders its own border-bottom to the
   wrapper so the whole row has one clean rule. */
.log-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding-right: 4px;
  border-bottom: 1px solid var(--rule);
}
.log-row .feed-row,
.log-row .feed-row--btn {
  border-bottom: 0;
  padding: 13px 0 13px 0;
}
.log-row__del {
  all: unset;
  align-self: center;
  padding: 6px 12px;
  color: var(--bad);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease;
}
.log-row__del:hover {
  color: var(--color-red-600);
  background: color-mix(in oklab, var(--bad) 10%, transparent);
}
.log-row__del:focus-visible {
  outline: 1px solid var(--bad);
  outline-offset: -2px;
  color: var(--bad);
}
.log-row__del[disabled] { cursor: default; opacity: 0.4; }
/* Row inside .log uses the same grammar; last row keeps the divider so the
   day block always ends on a rule (reads like a page). */

.log__loading,
.log__empty {
  padding: 32px 4px;
  color: var(--mute);
  font-size: 13.5px;
}
.log__empty-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}
.log__empty-body { color: var(--mute); }
.log__empty b { color: var(--ink); font-weight: 500; }

/* -------------------- alerts -------------------- */
.alert {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
}
.alert--warn {
  border-color: color-mix(in oklab, var(--warn) 40%, var(--rule));
  background:   color-mix(in oklab, var(--warn) 10%, var(--surface));
}
.alert--err {
  border-color: color-mix(in oklab, var(--bad) 45%, var(--rule));
  background:   color-mix(in oklab, var(--bad) 8%, var(--surface));
}
.alert--ok {
  border-color: color-mix(in oklab, var(--ok) 40%, var(--rule));
  background:   color-mix(in oklab, var(--ok) 10%, var(--surface));
}

/* -------------------- responsive -------------------- */
/* 모바일 헤더: 햄버거로 세로 메뉴를 접었다 폈다 한다 */
.nav-toggle { display: none; }   /* 데스크톱에선 안 보임 */

@media (max-width: 900px) {
  body:has(.sidebar) { padding-left: 0; }
  .sidebar {
    position: sticky; top: 0;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    overflow: visible;
    z-index: 30;
    background: var(--bg);
  }
  .sidebar__inner {
    position: relative;
    flex-direction: row; align-items: center;
    padding: 8px 12px; gap: 10px; height: auto;
  }
  .brand { flex: 0 0 auto; padding: 0 2px; }

  /* 햄버거 버튼 (오른쪽) */
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: auto; flex: 0 0 auto;
    width: 40px; height: 40px; padding: 0;
    border: 1px solid var(--rule); border-radius: 10px;
    background: var(--bg); color: var(--ink); cursor: pointer;
  }
  .nav-toggle:active { background: var(--surface); }
  .nav-toggle__box { position: relative; width: 18px; height: 12px; display: block; }
  .nav-toggle__box::before,
  .nav-toggle__box::after,
  .nav-toggle__bar {
    content: ""; position: absolute; left: 0; right: 0; height: 2px;
    border-radius: 2px; background: currentColor;
    transition: transform .18s ease, opacity .18s ease, top .18s ease;
  }
  .nav-toggle__box::before { top: 0; }
  .nav-toggle__bar { top: 5px; }
  .nav-toggle__box::after { top: 10px; }
  .sidebar.is-open .nav-toggle__box::before { top: 5px; transform: rotate(45deg); }
  .sidebar.is-open .nav-toggle__bar { opacity: 0; }
  .sidebar.is-open .nav-toggle__box::after { top: 5px; transform: rotate(-45deg); }

  /* 메뉴 본체: 헤더 아래로 펼쳐지는 세로 드롭다운 (오버레이) */
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    gap: 2px; margin: 0; padding: 8px 12px 14px;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    box-shadow: 0 16px 30px rgba(16, 24, 40, .12);
    max-height: calc(100dvh - 57px); overflow-y: auto;
    display: none;
  }
  .sidebar.is-open .nav { display: flex; }
  .nav__group { flex-direction: column; gap: 1px; }
  .nav__label { display: none; }
  .nav__spacer { display: none; }
  .nav a {
    padding: 11px 12px; font-size: 15px; border-radius: 9px; display: block;
  }
  .nav a[aria-current="page"] {
    background: var(--surface); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent);
  }
  .nav a.nav__ext { margin-bottom: 0; }
  .nav__acc-sum { padding: 11px 12px; font-size: 15px; border-radius: 9px; }
  .nav a.nav__sub-link { padding: 10px 12px 10px 26px; font-size: 14px; }
  .nav__presence { display: none; }               /* 접속중 목록은 메뉴에선 생략 */
  .identity-chip { margin-top: 8px; }

  /* details 형태 접이식 그룹은 인라인 링크로 평탄화 */
  .nav__toggle,
  .nav__group--collapsible > summary { display: none; }
  .nav__group--collapsible > .nav__body,
  .nav__group--collapsible > .results { display: contents; }
}
@media (max-width: 760px) {
  .toolkit { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; }
  .chat__side { order: -1; }
  .chat__side .card { padding: 14px; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; }
  .stat__value { font-size: 20px; }
  .row-list__row { padding: 12px 16px; }
}
@media (max-width: 520px) {
  .container { padding: 0 16px; }
  .msg { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =========================================================================
   Landing (/) — 로그아웃 그리팅.
   방향: 절제. 아이콘·앰비언트·컬러 액센트 배제. 타이포와 여백으로만.
   ========================================================================= */
html:not([data-ready]) body.landing-body { visibility: hidden; }

.landing-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

.landing-top {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.landing-top__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.landing-top__brand:hover { color: var(--ink); text-decoration: none; }
.landing-top__logo {
  display: block;
  height: 22px;
  width: auto;
  flex: 0 0 auto;
}
.landing-top__wordmark {
  padding-left: 10px;
  border-left: 1px solid var(--rule);
  color: var(--mute);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
}
.landing-top__meta {
  color: var(--mute-2);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.landing {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 112px 24px 0;
}

.landing__title {
  margin: 0 0 20px;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.022em;
  font-weight: 600;
  color: var(--ink);
  max-width: 18ch;
}
.landing__lede {
  margin: 0 0 36px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--mute);
  max-width: 50ch;
}
.landing__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
}
.landing__cta-note {
  font-size: 12px;
  color: var(--mute-2);
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .16s ease, transform .1s ease;
}
.btn-cta:hover {
  background: var(--color-gray-800);
  color: #ffffff;
  text-decoration: none;
}
.btn-cta:active { transform: translateY(1px); }
.btn-cta__arrow { transition: transform .16s ease; }
.btn-cta:hover .btn-cta__arrow { transform: translateX(2px); }

.landing__tools {
  margin-top: 80px;
  border-bottom: 1px solid var(--rule);
}

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  transition: color .16s ease;
}
.row__body { min-width: 0; flex: 1; }
.row__name {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.row__badge {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--mute-2);
}
.row__desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--mute);
}
.row__arrow {
  color: var(--rule-2);
  font-size: 14px;
  transition: color .16s ease, transform .16s ease;
}
a.row:hover { text-decoration: none; color: var(--ink); }
a.row:hover .row__arrow { color: var(--ink); transform: translateX(2px); }
.row--soon .row__name { color: var(--mute-2); }
.row--soon .row__desc { color: var(--mute-2); }

.landing-foot {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 80px 24px 24px;
  font-size: 11px;
  color: var(--mute-2);
}

@media (max-width: 520px) {
  .landing-top { padding: 20px 20px 0; }
  .landing { padding: 72px 20px 0; }
  .landing__title { font-size: 26px; }
  .landing__tools { margin-top: 56px; }
  .landing-foot { padding: 56px 20px 20px; }
}


/* ── 외부(일반) 사용자 모드 ─────────────────────────────────────────────
   whoami 가 role=external 이면 body.role-external 이 붙는다(common.js / Sidebar.tsx).
   볼 수 있는 탭은 대시보드·리절트·툴 뿐 — nav 는 각 렌더러가 줄이지만, whoami 응답 전
   깜빡임과 정적 페이지를 위해 게임화 요소·부가 링크를 CSS 로도 확실히 숨긴다. */
body.role-external .nav__ext,
body.role-external .nav__presence,
body.role-external .pc-walker,
body.role-external .nav [data-nav="shop"],
body.role-external .nav [data-nav="hall"],
body.role-external .nav [data-nav="board"],
body.role-external .notif-bell { display: none !important; }  /* 초대 알림은 내부 유저 전용 */

/* ── 초대 알림 벨 (사이드바 프로필 옆) — 정적/React 공용 ─────────────────── */
/* 프로필 카드 + 알림 벨을 하나로 — 벨은 카드 우상단에 얹은 코너 아이콘(별도 박스 X) */
.identity-row { position: relative; margin: 12px -2px 0; min-width: 0; }
.identity-row .identity-chip { margin: 0; padding-right: 42px; }
.identity-row .notif-bell { position: absolute; top: 9px; right: 8px; width: 30px; height: 30px;
  border: none; background: transparent; box-shadow: none; border-radius: 9px; }
.identity-row .notif-bell svg { width: 18px; height: 18px; }
.identity-row .notif-bell:hover { background: rgba(84,104,17,.10); box-shadow: none; transform: none;
  color: var(--color-lnp-green-600); }
.identity-row .notif-bell:hover svg { transform: rotate(-6deg); }
.identity-row .notif-bell--has { background: transparent; border: none; box-shadow: none; }
.identity-row .notif-bell--has:hover { background: rgba(181,71,8,.12); box-shadow: none; }
.notif-bell { position: relative; flex: none; width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--rule-2); background: linear-gradient(180deg, var(--surface), var(--surface-2));
  color: var(--ink-2); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
  transition: background .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease, transform .14s ease; }
.notif-bell svg { transition: transform .14s ease; transform-origin: 50% 18%; }
/* 유휴: 브랜드 그린으로 살짝 반응(워크벤치 아이덴티티) */
.notif-bell:hover { color: var(--color-lnp-green-600); border-color: var(--color-lnp-green-300);
  box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 0 0 3px var(--color-lnp-green-100); transform: translateY(-1px); }
.notif-bell:active { transform: translateY(0); }
.notif-bell:focus-visible { outline: none; border-color: var(--color-lnp-green-400);
  box-shadow: 0 0 0 3px var(--color-lnp-green-200); }
.notif-bell:hover svg { transform: rotate(-6deg); }
/* 대기중 초대 있음: 따뜻한 앰버 + 부드러운 후광. 시선을 끄는 유일한 순간. */
.notif-bell--has { color: #b54708; border-color: #fec84b;
  background: linear-gradient(180deg, #fffaeb, #fef0c7);
  box-shadow: 0 1px 2px rgba(181,71,8,.14), 0 0 0 3px rgba(253,176,34,.20); }
.notif-bell--has:hover { color: #93370d; border-color: #fdb022;
  box-shadow: 0 2px 6px rgba(181,71,8,.20), 0 0 0 3px rgba(253,176,34,.28); }
.notif-bell--has svg { animation: notif-swing .9s ease .12s 2; }
.notif-bell__dot { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4.5px;
  border-radius: 999px; background: linear-gradient(180deg, #f97066, #f04438); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 17px; text-align: center;
  box-shadow: 0 2px 6px rgba(240,68,56,.45), 0 0 0 2px var(--surface);
  font-variant-numeric: tabular-nums; box-sizing: border-box; animation: notif-pop .28s cubic-bezier(.34,1.56,.64,1); }
@keyframes notif-swing {
  0%,100% { transform: rotate(0); } 15% { transform: rotate(-13deg); } 30% { transform: rotate(10deg); }
  45% { transform: rotate(-7deg); } 60% { transform: rotate(5deg); } 75% { transform: rotate(-2deg); } }
@keyframes notif-pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .notif-bell svg, .notif-bell--has svg, .notif-bell__dot { animation: none; transition: none; } }

.notif-pop { position: fixed; z-index: 2147483400; width: 300px; max-width: calc(100vw - 24px);
  background: var(--panel, #fff); border: 1px solid var(--rule); border-radius: 14px;
  box-shadow: 0 18px 48px rgba(16,24,40,.24); overflow: hidden; }
.notif-pop__hd { font-size: 12px; font-weight: 700; color: var(--ink); padding: 12px 14px;
  border-bottom: 1px solid var(--rule-2); display: flex; align-items: center; justify-content: space-between; }
.notif-pop__list { max-height: min(60vh, 420px); overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.notif-pop__empty { font-size: 12.5px; color: var(--mute); text-align: center; padding: 22px 8px; }
.notif-pop__bubble { display: flex; gap: 9px; padding: 10px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--rule-2); }
.notif-pop__av { width: 34px; height: 34px; border-radius: 10px; overflow: hidden; flex: none;
  display: flex; align-items: center; justify-content: center; background: var(--surface);
  border: 1px solid var(--rule-2); font-weight: 700; color: var(--ink-2); font-size: 14px; }
.notif-pop__av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.notif-pop__body { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 7px; }
.notif-pop__msg { font-size: 12.5px; color: var(--ink); line-height: 1.45; }
.notif-pop__meta { color: var(--mute); font-size: 11px; }
.notif-pop__acts { display: flex; gap: 6px; }
.notif-pop__acts .btn { padding: 5px 12px; min-height: 0; font-size: 12px; flex: 1; }
/* DM 알림 — 버튼 전체가 클릭(누르면 채팅창 열림) */
.notif-pop__bubble--dm {
  appearance: none; width: 100%; text-align: left; cursor: pointer; font: inherit;
  align-items: center; position: relative; transition: background .12s, border-color .12s;
}
/* 우상단 상대시간(방금 전 / N시간 전) */
.notif-pop__time {
  position: absolute; top: 8px; right: 10px;
  font-size: 10.5px; color: var(--mute-2); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.notif-pop__bubble--dm .notif-pop__msg { padding-right: 46px; }
.notif-pop__bubble--dm:hover { background: var(--accent-bg); border-color: var(--accent); }
.notif-pop__preview {
  font-size: 12px; color: var(--mute); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 이미 읽은 DM — 사라지지 않고 회색으로 남는다(24h) */
.notif-pop__bubble--read { background: var(--surface); opacity: .62; }
.notif-pop__bubble--read:hover { opacity: 1; }
