/* 정한 것(r23 — web/pins.js · server/pins.js). 색·글자는 style.css 의 변수 그대로(13 보조 글 · 하늘 잉크 하나 · 선 --line).
   ① 대화 칸 맨 위 접힌 한 줄 '정한 것 n'(없으면 안 보임) → 펴면 목록  ② 내 말풍선 옆 '이걸로 정함'(마우스 올림 · 터치는 누름)
   ③ Claude 의 '정해 둘까요? “…”' 줄 끝 [정해 두기]  ④ 메모 목록 줄 끝 '이걸로 정함' */

/* ① 접힌 한 줄 — 대화 칸과 같은 기둥(720) 왼쪽 끝. 위 끝 옅어지는 띠(style.css .right::after)는 이 줄이 있을 때 이 줄 아래로 옮긴다 */
.pinbox { flex: none; position: relative; z-index: 3; width: min(var(--col), calc(100% - 40px)); margin: 12px auto 0; background: #fff; font-size: var(--f3); }
.pinbox > summary { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 8px; margin-left: -8px; border-radius: var(--pill); list-style: none; cursor: pointer; user-select: none; color: var(--muted); }
.pinbox > summary::-webkit-details-marker { display: none; }
.pinbox > summary:hover { background: var(--hover); color: var(--text); }
.pinbox > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pinbox > summary svg { flex: none; }
.pinbox > summary .pn { font-variant-numeric: tabular-nums; }
.pinbox > summary::after { content: ''; width: 5px; height: 5px; margin: -2px 0 0 2px; border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor; transform: rotate(45deg); }
.pinbox[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
/* 새로 정한 순간: 하늘 잉크에서 제 색으로 1.6초(색만 — 자리·크기 그대로) */
.pinbox > summary.fresh { animation: pinfresh 1.6s ease-out; }
@keyframes pinfresh { from { color: var(--ink); background: var(--tint); } to { color: var(--muted); background: transparent; } }
/* 대화 글이 위로 지나갈 때 이 줄 밑에서 그냥 잘리지 않게 16px 옅어지는 띠 */
.pinbox::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 16px; background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0)); pointer-events: none; }
.right:has(#pinBox:not([hidden]))::after { display: none; }
/* 편 목록 — 선 하나로 묶은 흰 칸, 길면 안에서 스크롤 */
.pinlist { list-style: none; margin: 6px 0 4px; padding: 4px 0; max-height: min(40vh, 360px); overflow-y: auto; scrollbar-width: thin; border: 1px solid var(--line); border-radius: var(--r2); background: #fff; counter-reset: pin; }
.pinlist li { display: flex; align-items: baseline; gap: 12px; padding: 6px 14px; font-size: var(--fu); line-height: 1.5; color: var(--text); counter-increment: pin; }
.pinlist li::before { content: counter(pin); flex: none; min-width: 12px; font-size: var(--f3); color: var(--muted); font-variant-numeric: tabular-nums; }
.pinlist li + li { border-top: 1px solid var(--line); }
.pinlist .pin-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pinlist .pin-acts { flex: none; display: inline-flex; gap: 12px; font-size: var(--f3); opacity: 0; }
.pinlist li:hover .pin-acts, .pinlist li:focus-within .pin-acts, .pinlist li.editing .pin-acts { opacity: 1; }
.pinlist .pin-acts button.link { color: var(--ink); }
.pinlist .pin-acts button.link:hover { color: var(--ink); text-decoration: underline; }
.pinlist .pin-acts button[data-act="del"] { color: var(--muted); }
.pinlist li.editing { align-items: center; }
.pinlist .pin-in { flex: 1; min-width: 0; height: 32px; padding: 0 12px; border-radius: var(--r1); border-color: var(--line2); font-size: var(--fu); }
@media (hover: none) { .pinlist .pin-acts { opacity: 1; } }

/* ② 내 말풍선 옆 — 평소 안 보이고 마우스를 올렸을 때(터치는 말풍선을 누르면 .showact) 왼쪽 옆에. 자리가 모자라면 아래(.below — pins.js 가 잰다) */
.chatlog li.user { position: relative; }
.chatlog li.user > .pinact { position: absolute; right: calc(100% + 8px); bottom: 6px; height: 24px; padding: 0 2px; font-size: var(--f3); line-height: 24px; white-space: nowrap; color: var(--muted); opacity: 0; pointer-events: none; }
.chatlog li.user > .pinact.below { right: 6px; bottom: auto; top: calc(100% + 2px); z-index: 2; padding: 0 10px; border-radius: var(--pill); background: #fff; box-shadow: 0 0 0 1px var(--line); }
.chatlog li.user:hover > .pinact, .chatlog li.user.showact > .pinact, .chatlog li.user > .pinact:focus-visible { opacity: 1; pointer-events: auto; }
.chatlog li.user > .pinact:hover { color: var(--ink); background: none; text-decoration: underline; }
.chatlog li.user > .pinact.below:hover { background: #fff; }
/* 정해 둔 말 — 늘 보이는 작은 표시(하늘 잉크) */
.chatlog li.user > .pinact.on { opacity: 1; pointer-events: auto; color: var(--ink); }
.chatlog li.user > .pinact.on.below { box-shadow: none; background: transparent; }

/* ③ Claude 의 제안 줄 끝 — 결과 칩과 같은 꼴(선 알약 · 하늘 잉크) */
.chatlog .pinprop { height: 28px; margin-left: 4px; padding: 0 12px; font-size: var(--f3); font-weight: 600; vertical-align: 1px; background: transparent; color: var(--ink); border-color: var(--line2); white-space: nowrap; }
.chatlog .pinprop:hover { background: var(--tint); }
.chatlog .pinprop.on, .chatlog .pinprop:disabled { background: var(--sel-bg); color: var(--muted); border-color: transparent; cursor: default; }

/* ④ 메모 목록 줄 끝 */
.fblist .pinfb { margin-left: 8px; font-size: var(--f3); color: var(--ink); }
.fblist .pinfb:hover { color: var(--ink); text-decoration: underline; }
.fblist .pinfb.on, .fblist .pinfb:disabled { color: var(--muted); text-decoration: none; cursor: default; }

/* 좁은 화면 — 대화와 같은 양옆 16 · 태블릿은 640 기둥 */
@media (max-width: 900px) {
  .pinbox { width: auto; margin: 12px 16px 0; }
  .pinbox::after { display: none; }
}
@media (min-width: 601px) and (max-width: 900px) {
  .pinbox { margin-left: var(--tm); margin-right: var(--tm); }
}
@media (prefers-reduced-motion: reduce) { .pinbox > summary.fresh { animation: none; } }
