/* =====================================================
   고전 — 북마크 · 메모 (전경/훈시와 동일 개념, 한지 톤)
   ===================================================== */

/* ── 문단별 액션 버튼 ── */
p[data-gj-id] { position: relative; }
.gj-acts {
  position: absolute; top: .1em; right: -3.1em;
  display: flex; flex-direction: column; gap: .25em;
  opacity: .38; transition: opacity .15s;
}
p[data-gj-id]:hover .gj-acts, .gj-acts:focus-within { opacity: 1; }
.gj-acts button {
  width: 1.75em; height: 1.75em; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--ink-soft);
  border: 1px solid var(--rule); border-radius: 5px;
  cursor: pointer; line-height: 1; position: relative;
}
.gj-acts button:hover { color: var(--seal); border-color: var(--seal); }
.gj-acts button svg { width: 13px; height: 13px; fill: none;
  stroke: currentColor; stroke-width: 2; }
.gj-acts button.on { color: var(--seal); border-color: var(--seal); background: var(--tint); }
.gj-acts button.on svg { fill: currentColor; }
.gj-acts .gj-cnt {
  position: absolute; top: -5px; right: -5px;
  background: var(--seal); color: #fff; font-family: var(--sans);
  font-size: 9px; font-weight: 700; line-height: 1;
  min-width: 13px; height: 13px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
/* 북마크된 문단 표시 */
p.gj-marked { background: var(--tint); border-radius: 4px;
  box-shadow: -.55em 0 0 var(--tint), .55em 0 0 var(--tint); }

@media (max-width: 1100px) {
  .gj-acts { position: static; flex-direction: row; opacity: .5;
    margin-top: .35em; justify-content: flex-end; }
  p[data-gj-id]:hover .gj-acts { opacity: 1; }
  p.gj-marked { box-shadow: none; padding: .35em .55em; }
}

/* ── 상단바 버튼 ── */
.gj-tools { display: flex; gap: .3rem; }
.gj-tools button {
  background: var(--paper); color: var(--ink); border: 1px solid var(--rule);
  border-radius: 4px; cursor: pointer; padding: .3rem .45rem;
  display: flex; align-items: center; line-height: 1; position: relative;
}
.gj-tools button:hover { color: var(--seal); border-color: var(--seal); }
.gj-tools button svg { width: 15px; height: 15px; fill: none;
  stroke: currentColor; stroke-width: 2; }
.gj-tools button.is-login { color: var(--seal); border-color: var(--seal); background: var(--tint); }

/* ── 오버레이(목록/편집/로그인) ── */
.gj-ov {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 1rem; overflow-y: auto;
}
.gj-ov[hidden] { display: none; }
.gj-panel {
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 10px;
  width: 100%; max-width: 40em; box-shadow: 0 10px 40px rgba(0,0,0,.35);
  font-family: var(--sans);
}
.gj-head {
  display: flex; align-items: center; gap: .6rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--rule);
}
.gj-head .ttl { flex: 1; font-weight: 700; font-size: .95rem; }
.gj-head button {
  background: transparent; border: none; color: var(--ink-soft);
  font-size: 1.1rem; cursor: pointer; padding: .1rem .35rem; line-height: 1;
}
.gj-head button:hover { color: var(--seal); }
.gj-body { padding: .8rem 1rem 1.1rem; max-height: 70vh; overflow-y: auto; }

.gj-item {
  border: 1px solid var(--rule); border-radius: 7px;
  padding: .7rem .85rem; margin-bottom: .6rem; background: var(--paper-2);
}
.gj-item .loc { font-size: .74rem; color: var(--seal); font-weight: 700;
  letter-spacing: .04em; margin-bottom: .35rem; }
.gj-item .txt { font-size: .86rem; line-height: 1.7; color: var(--ink);
  word-break: keep-all; }
.gj-item .memo { font-size: .86rem; line-height: 1.7; white-space: pre-wrap;
  border-top: 1px dashed var(--rule); margin-top: .5rem; padding-top: .5rem; }
.gj-item .row { display: flex; gap: .4rem; margin-top: .55rem; }
.gj-item .row button, .gj-btn {
  font-family: var(--sans); font-size: .76rem; cursor: pointer;
  background: var(--paper); color: var(--ink-soft);
  border: 1px solid var(--rule); border-radius: 4px; padding: .28rem .6rem;
}
.gj-item .row button:hover, .gj-btn:hover { color: var(--seal); border-color: var(--seal); }
.gj-btn.primary { background: var(--seal); color: #fff; border-color: var(--seal); }
.gj-btn.primary:hover { opacity: .88; color: #fff; }
.gj-empty { text-align: center; color: var(--ink-soft); font-size: .86rem; padding: 2rem 0; }

.gj-ctx { font-size: .8rem; color: var(--ink-soft); line-height: 1.7;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 6px;
  padding: .6rem .75rem; margin-bottom: .7rem; word-break: keep-all; }
.gj-ta {
  width: 100%; min-height: 8.5em; resize: vertical;
  font-family: var(--sans); font-size: .9rem; line-height: 1.7;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 6px; padding: .6rem .7rem;
}
.gj-ta:focus { outline: none; border-color: var(--seal); }
.gj-acts-row { display: flex; gap: .45rem; justify-content: flex-end; margin-top: .6rem; }

/* 로그인 안내 */
.gj-login-body { padding: 1.6rem 1.4rem; text-align: center; }
.gj-login-body h3 { margin: .2rem 0 .7rem; font-size: 1.02rem; }
.gj-login-body p { font-size: .86rem; line-height: 1.8; color: var(--ink-soft); margin: 0 0 1.2rem; }
.gj-login-body .warn { color: var(--seal); }
.gj-login-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }

/* 토스트 */
.gj-toast {
  position: fixed; left: 50%; bottom: 2.2rem; transform: translateX(-50%) translateY(8px);
  background: rgba(30,24,16,.94); color: #fff; font-family: var(--sans);
  font-size: .82rem; padding: .6rem 1rem; border-radius: 22px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  z-index: 3000; max-width: 88%;
}
.gj-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
