/* ============================================================================
   피드백 층 — 스티키 메모 · 불렛 · 아래 막대  (Kicks public/feedback/css/feedback.css 이식)

   CS 포탈 모달은 z-index 10000~10002(일부 100000)를 쓴다 → 메모 층은 그 위(100100~)에 둔다.
   그래야 케이스 모달 위에도 메모를 붙일 수 있다. 로그인 문 스타일은 뺐다(Supabase 로그인 사용).
   ========================================================================== */

.fb-layer {
  position: fixed;
  inset: 0;
  z-index: 100100;
  pointer-events: none;          /* 층 자체는 클릭을 먹지 않는다 */
}
.fb-layer > * { pointer-events: auto; position: absolute; }

/* ------------------------------------------------------------------ 불렛 */
/* 메모가 붙어 있다는 표시. 사용자가 정한 대로 연한 붉은색 원이 기본이고,
   Master 모드에서만 --fb-c 로 사람별 색이 들어온다. */
.fb-bullet {
  --fb-c: #c53030;
  width: 22px; height: 22px; padding: 0;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--fb-c) 62%, transparent);
  background: color-mix(in srgb, var(--fb-c) 22%, #fff);
  color: color-mix(in srgb, var(--fb-c) 88%, #000);
  font: inherit; font-size: 10.5px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(20, 22, 26, .18);
  transition: transform .14s cubic-bezier(.2,.8,.3,1), box-shadow .14s;
}
.fb-bullet:hover {
  transform: scale(1.22);
  box-shadow: 0 3px 10px -2px rgba(20, 22, 26, .3);
}

/* 기획(백단 설계) 메모는 색만으로 가르지 않는다 — 네모라서 곁눈으로도 구분된다 */
.fb-bullet.is-spec { border-radius: 5px; }
/* 변수가 붙은 메모는 번호 대신 변수 글자를 찍는다. 글자라 조금 넓게 잡는다. */
.fb-bullet.is-var { border-radius: 5px; min-width: 22px; width: auto; padding: 0 5px; letter-spacing: .02em; }

/* color-mix 를 모르는 브라우저용 최소 대비 */
@supports not (background: color-mix(in srgb, red 20%, white)) {
  .fb-bullet { background: rgba(197, 48, 48, .22); border-color: rgba(197, 48, 48, .55); color: #8f2020; }
  .fb-bullet.is-spec { background: rgba(15, 118, 110, .18); border-color: rgba(15, 118, 110, .55); color: #0b544f; }
}

/* ------------------------------------------------------------------ 메모 */
.fb-note {
  --fb-c: #c53030;
  width: 296px;
  display: flex; flex-direction: column;
  background: #fffbe6;
  border: 1px solid rgba(180, 150, 40, .34);
  border-radius: 12px;
  box-shadow: 0 18px 46px -18px rgba(20, 22, 26, .42), 0 2px 6px rgba(20, 22, 26, .08);
  overflow: hidden;
  animation: fb-pop .16s cubic-bezier(.2,.8,.3,1);
}
@keyframes fb-pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }

/* 기획 메모 — 노란 포스트잇과 섞이면 무엇을 읽고 있는지 헷갈린다.
   담당자 요구가 아니라 이미 내린 결론이므로 종이 자체를 다르게 둔다. */
.fb-note.is-spec {
  width: 344px;
  background: #f4fbfa;
  border-color: rgba(15, 118, 110, .3);
}
.fb-note.is-spec .fb-note__head {
  background: rgba(15, 118, 110, .09);
  border-bottom-color: rgba(15, 118, 110, .2);
}
.fb-note.is-spec .fb-note__where { color: #37706a; }
.fb-note.is-spec .fb-note__text { min-height: 148px; }

.fb-note__head {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 9px 6px 11px;
  border-bottom: 1px solid rgba(180, 150, 40, .22);
  background: rgba(255, 245, 190, .6);
}
.fb-note__who {
  flex: none;
  font-size: 11px; font-weight: 700; letter-spacing: .01em;
  color: #fff; background: var(--fb-c);
  padding: 2px 7px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.fb-note__where {
  flex: 1; min-width: 0;
  font-size: 11.5px; color: #7a6a2e;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fb-note__hide {
  flex: none; border: 0; background: none; cursor: pointer;
  font-size: 11.5px; color: #8a7a3a; padding: 2px 4px; border-radius: 6px;
}
.fb-note__hide:hover { background: rgba(140, 115, 20, .12); color: #5d5120; }

.fb-note__text {
  border: 0; background: transparent; resize: vertical;
  min-height: 96px; padding: 11px 12px;
  font-size: 13.2px; line-height: 1.62; color: #2c2a1d;
  outline: none;
}
.fb-note__text::placeholder { color: #a99b62; }
.fb-note__text[readonly] { color: #5c5741; }

.fb-note__foot {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 10px;
}
.fb-note__spacer { flex: 1; }
.fb-note__del, .fb-note__save {
  border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 600;
  padding: 6px 13px; border: 1px solid transparent;
}
.fb-note__del { background: none; color: #a2694f; border-color: rgba(160, 90, 60, .3); }
.fb-note__del:hover { background: rgba(197, 48, 48, .09); color: #8f2020; }
.fb-note__save { background: #14161a; color: #fff; }
.fb-note__save:hover { background: #2b2f37; }

/* ------------------------------------------------------------------ 변수 --
   메모 안 한 줄(붙은 변수 칩 + [변수로 지정]) · 고르는 창 · 막대의 전체 목록 */
.fb-note__vars {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  position: relative;                       /* 고르는 창이 이 줄에 붙는다 */
  padding: 8px 11px 0;
}
.fb-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 4px 2px 8px; border-radius: 999px;
  background: rgba(124, 58, 237, .12);
  border: 1px solid rgba(124, 58, 237, .3);
  color: #5b21b6; font-size: 11.5px; font-weight: 600;
}
.fb-chip b { font-weight: 800; }
.fb-chip__x {
  border: 0; background: none; cursor: pointer;
  color: #7c3aed; font: inherit; font-size: 13px; line-height: 1; padding: 0 2px;
}
.fb-chip__x:hover { color: #14161a; }
.fb-note__varbtn {
  border: 1px dashed rgba(124, 58, 237, .5);
  background: none; color: #6d28d9;
  border-radius: 999px; padding: 2px 9px;
  font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.fb-note__varbtn:hover { background: rgba(124, 58, 237, .08); }

.fb-varpick {
  position: absolute; left: 11px; bottom: calc(100% + 6px); z-index: 5;
  width: 268px; padding: 8px;
  background: #fff; border: 1px solid var(--line-2, rgba(20, 22, 26, .14));
  border-radius: 12px; box-shadow: 0 18px 44px -18px rgba(20, 22, 26, .4);
}
.fb-varpick__q {
  width: 100%; box-sizing: border-box; padding: 7px 9px;
  border: 1px solid var(--line-2, rgba(20, 22, 26, .14));
  border-radius: 8px; font: inherit; font-size: 12.5px; outline: none;
}
.fb-varpick__q:focus { border-color: #7c3aed; }
.fb-varpick__make {
  width: 100%; margin-top: 6px; padding: 7px 9px;
  border: 0; border-radius: 8px; background: #7c3aed; color: #fff;
  font: inherit; font-size: 12.2px; font-weight: 600; cursor: pointer;
}
.fb-varpick__make[hidden] { display: none; }
.fb-varpick__list { max-height: 208px; overflow: auto; margin-top: 6px; }
.fb-varpick__row {
  width: 100%; display: flex; align-items: center; gap: 7px;
  padding: 6px 7px; border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: 12.4px; color: var(--ink-2, #3d434e);
  cursor: pointer; text-align: left;
}
.fb-varpick__row:hover { background: var(--surface-2, #fbfbfc); }
.fb-varpick__row.is-on { background: rgba(124, 58, 237, .12); color: #5b21b6; font-weight: 600; }
.fb-varpick__letter {
  flex: none; min-width: 20px; padding: 1px 5px; border-radius: 5px;
  background: rgba(124, 58, 237, .16); color: #5b21b6;
  font-size: 11px; font-weight: 800; text-align: center;
}
.fb-varpick__uses { margin-left: auto; color: var(--ink-4, #9aa1ad); font-size: 11px; }
.fb-varpick__empty { margin: 10px 4px; font-size: 12px; color: var(--ink-4, #9aa1ad); }

.fb-varpanel {
  position: fixed; z-index: 100250; width: 340px; padding: 12px;
  background: #fff; border: 1px solid var(--line-2, rgba(20, 22, 26, .14));
  border-radius: 14px; box-shadow: 0 22px 56px -20px rgba(20, 22, 26, .45);
}
.fb-varpanel__title { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.fb-varpanel__list { max-height: 320px; overflow: auto; }
.fb-varpanel__row { display: flex; align-items: center; gap: 7px; padding: 4px 0; }
.fb-varpanel__name {
  flex: 1; min-width: 0; padding: 5px 7px;
  border: 1px solid transparent; border-radius: 7px;
  font: inherit; font-size: 12.5px; background: none; outline: none;
}
.fb-varpanel__name:hover { border-color: var(--line-2, rgba(20, 22, 26, .14)); }
.fb-varpanel__name:focus { border-color: #7c3aed; background: #fff; }
.fb-varpanel__del {
  flex: none; border: 0; background: none; cursor: pointer;
  color: var(--ink-4, #9aa1ad); font: inherit; font-size: 11.5px;
}
.fb-varpanel__del:hover { color: var(--bad, #c53030); }

/* -------------------------------------------------------------- 아래 막대 */
.fb-bar {
  position: fixed; left: 20px; bottom: 20px; z-index: 100200;
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px 7px 12px;
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--line-2, rgba(20, 22, 26, .14));
  border-radius: 999px;
  box-shadow: 0 14px 40px -18px rgba(20, 22, 26, .4), 0 1px 2px rgba(20, 22, 26, .05);
  backdrop-filter: blur(8px);
  font-size: 12.4px; color: var(--ink-2, #3d434e);
  max-width: calc(100vw - 40px);
}
/* 자리를 옮길 수 있다는 표시. 버튼 위에서는 평소 커서로 돌려 둔다 */
.fb-bar { cursor: grab; user-select: none; }
.fb-bar.is-drag { cursor: grabbing; box-shadow: 0 20px 50px -18px rgba(20, 22, 26, .5); }
.fb-bar button, .fb-bar a { cursor: pointer; }

.fb-bar__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.fb-bar__who { font-weight: 660; color: var(--ink, #14161a); }
.fb-bar__n { color: var(--ink-4, #9aa1ad); font-variant-numeric: tabular-nums; }
.fb-bar__hint { color: var(--ink-4, #9aa1ad); border-left: 1px solid var(--line, rgba(20,22,26,.08)); padding-left: 9px; }
.fb-bar__btn {
  border: 1px solid var(--line-2, rgba(20, 22, 26, .14));
  background: #fff; color: var(--ink-2, #3d434e);
  border-radius: 999px; padding: 4px 11px;
  font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.fb-bar__btn:hover { background: var(--surface-2, #fbfbfc); color: var(--ink, #14161a); }
.fb-bar__btn.is-on {
  background: #14161a; border-color: #14161a; color: #fff;
}
.fb-bar__btn[hidden] { display: none; }

/* 피드백 | 기획 — 무엇을 적고 무엇을 보는지 가르는 스위치 (Admin 만 보인다) */
.fb-bar__mode {
  display: flex; flex: none;
  border: 1px solid var(--line-2, rgba(20, 22, 26, .14));
  border-radius: 999px; overflow: hidden; background: #fff;
}
.fb-bar__seg {
  border: 0; background: none; color: var(--ink-3, #6b7280);
  padding: 4px 12px; font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.fb-bar__seg:hover { background: var(--surface-2, #fbfbfc); }
.fb-bar__seg.is-on { background: #14161a; color: #fff; }

/* 접기 — 오른쪽 끝의 작은 빼기 버튼 */
.fb-bar__fold {
  flex: none; width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--line-2, rgba(20, 22, 26, .14));
  border-radius: 50%; background: #fff; color: var(--ink-3, #6b7280);
  font: inherit; font-size: 13px; line-height: 1; cursor: pointer;
}
.fb-bar__fold:hover { background: var(--surface-2, #fbfbfc); color: var(--ink, #14161a); }

/* 접힌 모습 — 동그라미 하나. 이 화면에 붙은 메모 수를 적는다 */
.fb-bar__face {
  --fb-c: #c53030;
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--fb-c) 55%, transparent);
  background: color-mix(in srgb, var(--fb-c) 18%, #fff);
  color: color-mix(in srgb, var(--fb-c) 88%, #000);
  font: inherit; font-size: 12px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.fb-bar__face[hidden] { display: none; }
.fb-bar.is-fold {
  padding: 3px; gap: 0;
  background: rgba(255, 255, 255, .95);
}
.fb-bar.is-fold > *:not(.fb-bar__face) { display: none; }

@media (max-width: 900px) {
  .fb-bar__hint { display: none; }
}

/* -------------------------------------------------------------- 알림 한 줄 */
.fb-toasts {
  position: fixed; left: 20px; bottom: 68px; z-index: 100300;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.fb-toast {
  padding: 9px 14px; border-radius: 10px;
  background: rgba(20, 22, 26, .94); color: #fff;
  font-size: 12.6px; box-shadow: 0 10px 28px -12px rgba(20, 22, 26, .5);
  transition: opacity .24s;
}
.fb-toast.is-bad { background: rgba(150, 32, 32, .95); }

/* ------------------------------------------------------------ 켬/끔 스위치 --
   우하단 작은 알약. 기본은 꺼짐(브라우저마다 기억, cs.fb.enabled). Ctrl+Shift+F 로도 토글. */
.fb-switch {
  position: fixed; right: 16px; bottom: 16px; z-index: 100200;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--line-2, rgba(20, 22, 26, .14)); border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: var(--ink-3, #6b7280);
  font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 18px -10px rgba(20, 22, 26, .4);
  opacity: .72; transition: opacity .14s, background .14s, color .14s;
}
.fb-switch:hover { opacity: 1; color: var(--ink, #14161a); }
.fb-switch__dot { width: 8px; height: 8px; border-radius: 50%; background: #c9ccd2; }
.fb-switch.is-on { opacity: 1; color: #8f2020; border-color: rgba(197, 48, 48, .4); }
.fb-switch.is-on .fb-switch__dot { background: #c53030; }

/* ── 개선 완료 (2026-09-23) — 고친 요청을 지우지 않고 '처리됨'으로 넘긴다 ── */
.fb-note__done-btn {
  font: inherit; font-size: 11.5px; padding: 4px 9px; border-radius: 6px; cursor: pointer;
  background: none; color: #0f766e; border: 1px solid rgba(15, 157, 118, .45);
}
.fb-note__done-btn:hover { background: rgba(15, 157, 118, .1); }
.fb-note__done-btn:disabled { opacity: .5; cursor: default; }
.fb-note__done {
  margin-left: auto; font-size: 11px; font-weight: 600; color: #0f9d76;
  background: rgba(15, 157, 118, .12); border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.fb-note.is-done { opacity: .72; }
.fb-note.is-done .fb-note__text { text-decoration: line-through; text-decoration-color: rgba(15, 157, 118, .5); }
.fb-bullet.is-done { font-weight: 700; }
