/* 로그인·갤러리·댓글 (account 에이전트). style.css 의 토큰(--gold, --panel …)과 .btn, .seg, .block-title 을 쓴다. */

/* 로그인 창·댓글 오류 알림이 창 뒤에 가리지 않게 */
.toast { z-index: 95; }

.ic { width: 1em; height: 1em; flex: none; vertical-align: -.125em; }

/* ---------------------------------------------------------------- 프로필 사진 */
.acct-av {
  width: 26px; height: 26px; flex: none;
  border-radius: 50%; object-fit: cover;
  background: #2a2620;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12);
}
.acct-av.sm { width: 20px; height: 20px; }
.acct-av.lg { width: 40px; height: 40px; }

/* 프로필 사진 고르기 창 */
.av-pick { display: grid; gap: 10px; }
.av-pick-head { display: flex; align-items: center; gap: 14px; padding-bottom: 4px; }
.av-pick-preview.acct-av { width: 72px; height: 72px; box-shadow: 0 0 0 2px var(--gold); }
.av-pick-name { color: var(--gold-hi); font-size: 17px; }
.av-pick-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.av-pick-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.av-pick-own { display: flex; align-items: center; gap: 10px; }
.av-pick-own .av-pick-opt { width: 60px; flex: none; }
.av-pick-opt {
  position: relative; display: block; aspect-ratio: 1; padding: 0;
  border: 0; border-radius: 50%; background: #2a2834; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .14);
  transition: box-shadow .12s, transform .12s;
}
.av-pick-opt img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.av-pick-opt:hover { transform: translateY(-1px); box-shadow: 0 0 0 2px rgba(217, 164, 65, .55); }
.av-pick-opt.on { box-shadow: 0 0 0 3px var(--gold), 0 0 14px rgba(217, 164, 65, .45); }
.av-pick-opt:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.av-pick-badge {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  padding: 1px 6px; border-radius: 999px;
  background: var(--panel-solid); border: 1px solid var(--line-strong);
  color: var(--muted); font-size: 10.5px; line-height: 1.4; white-space: nowrap;
}
.av-pick-file { display: none; }
.av-pick-status:empty { display: none; }

/* ---------------------------------------------------------------- 상단: 로그인 / 프로필 */
.acct-top { display: flex; align-items: center; }
.acct-login-btn .ic { font-size: 15px; }
.acct-chip {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 190px; min-height: 34px; padding: 3px 8px 3px 4px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(0, 0, 0, .3); color: var(--text);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.acct-chip:hover { border-color: var(--gold); }
.acct-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-chip .ic-caret { font-size: 16px; color: var(--muted); }

.popover:has(> .acct-menu) { width: min(260px, calc(100vw - 16px)); }
.acct-menu { display: grid; gap: 2px; margin: -4px; }
.acct-menu-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.acct-menu-who { display: grid; min-width: 0; }
.acct-menu-who strong { color: var(--gold-hi); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu-who span { color: var(--muted); font-size: 12px; }
.acct-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 40px; padding: 0 10px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--text); font-size: 14px; text-align: left; cursor: pointer;
}
.acct-menu-item .ic { font-size: 18px; color: var(--gold); }
.acct-menu-item:hover, .acct-menu-item:focus-visible { background: rgba(217, 164, 65, .12); }
.acct-menu-item.danger { color: #ffb4b0; }
.acct-menu-item.danger .ic { color: #ffb4b0; }

/* ---------------------------------------------------------------- 창(모달) */
.acct-modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(5, 6, 9, .78);
  backdrop-filter: blur(3px);
  animation: fade .15s ease;
}
.acct-modal {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 22px 22px 20px;
  background: linear-gradient(180deg, #221d17, #15130f);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 220, 150, .08);
}
.acct-modal:focus { outline: none; }
.acct-modal-close {
  position: absolute; top: 10px; right: 12px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .15); background: rgba(0, 0, 0, .3);
  color: var(--text); font-size: 21px; line-height: 1; cursor: pointer;
}
.acct-modal-close:hover { border-color: var(--gold); color: var(--gold-hi); }
.acct-modal-title { margin: 0 44px 14px 0; font-family: var(--font-title); font-size: 22px; color: var(--gold-hi); line-height: 1.3; }

.acct-login { display: grid; gap: 14px; }
.acct-reason { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(217, 164, 65, .1); border: 1px solid var(--line); color: var(--gold-hi); font-weight: 600; }
.acct-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.acct-perks li { position: relative; padding-left: 24px; font-size: 14.5px; line-height: 1.5; }
.acct-perks li::before {
  content: "✦"; position: absolute; left: 2px; top: 0;
  color: var(--gold); font-size: 13px;
}
/* 페이지는 color-scheme: dark 인데 구글 버튼(iframe)은 밝은 문서라, 둘이 다르면 크롬이 iframe 뒤를 흰색으로 칠한다. */
.acct-gbtn { display: flex; justify-content: center; align-items: center; min-height: 48px; color-scheme: light; }
.acct-loading { color: var(--muted); font-size: 13.5px; }
.acct-status { margin: 0; min-height: 1em; text-align: center; color: var(--muted); font-size: 13.5px; }
.acct-status:empty { display: none; }
.acct-status.error { color: #ffb4b0; }
.acct-privacy { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.acct-form { display: grid; gap: 12px; }
.acct-form .field input, .acct-form textarea {
  width: 100%;
  border-radius: 8px; border: 1px solid rgba(255, 255, 255, .16);
  background: #101217; color: var(--text); font-size: 15px;
}
.acct-form textarea { padding: 8px 10px; resize: vertical; min-height: 70px; line-height: 1.5; }
.acct-form .field input:focus, .acct-form textarea:focus { border-color: var(--gold); outline: none; }
.acct-help { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.acct-help.error { color: #ffb4b0; font-weight: 600; }
.acct-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
/* 내 ID */
.acct-id-row { display: flex; gap: 8px; }
.acct-id-input {
  flex: 1 1 auto; min-width: 0; min-height: 38px; padding: 0 10px;
  border-radius: 8px; border: 1px solid rgba(255, 255, 255, .16); background: #101217; color: var(--gold-hi);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; letter-spacing: .02em;
}
.acct-id-input:focus { border-color: var(--gold); outline: none; }
.acct-radios { display: grid; gap: 4px; margin: 0; padding: 0; border: 0; }
.acct-radios label {
  display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 0 12px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .1); background: rgba(0, 0, 0, .2);
  cursor: pointer; font-size: 14.5px;
}
.acct-radios label:has(input:checked) { border-color: var(--gold); background: rgba(217, 164, 65, .1); }
.acct-radios input { accent-color: var(--gold); }

/* ---------------------------------------------------------------- 갤러리 카드 */
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.gal-grid > .empty { grid-column: 1 / -1; }
.gal-card {
  --accent: var(--gold);
  position: relative; min-width: 0;
  display: flex; flex-direction: column;
  border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .09);
  border-top: 3px solid var(--accent);
  background: var(--panel);
  color: var(--text); text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  transition: transform .15s ease, border-color .15s ease;
}
a.gal-card:hover { transform: translateY(-2px); border-color: var(--line-strong); border-top-color: var(--accent); }

/* 미리보기: 위쪽 줄 3개, 줄마다 첫 항목들 */
.gal-prev {
  display: grid; align-content: start; gap: 3px;
  height: 118px; padding: 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .35), rgba(0, 0, 0, .15));
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  overflow: hidden;
}
.gal-prev-row { display: flex; align-items: stretch; gap: 4px; height: 32px; min-width: 0; border-radius: 4px; background: rgba(0, 0, 0, .25); overflow: hidden; }
.gal-prev-label {
  flex: 0 0 30px; display: grid; place-items: center;
  padding: 0 2px; background: var(--tier); color: #15110b;
  font-family: var(--font-game); font-weight: 700; font-size: 13px; line-height: 1;
  overflow: hidden; white-space: nowrap; text-overflow: clip;
}
.gal-prev-items { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; }
.gal-prev-items img { flex: none; height: 30px; width: auto; max-width: 34px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.gal-prev.kind-icon .gal-prev-items img { height: 26px; }
.gal-prev-dot { flex: none; width: 18px; height: 24px; border-radius: 3px; background: rgba(255, 255, 255, .12); }
.gal-prev-empty { display: grid; place-items: center; height: 100%; color: rgba(255, 255, 255, .15); font-size: 40px; }

.gal-card-body { display: grid; gap: 4px; padding: 10px 12px 12px; min-width: 0; }
.gal-card-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 15px; line-height: 1.35; color: var(--gold-hi); overflow-wrap: anywhere;
}
.gal-card-tpl { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-card-author { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--muted); }
.gal-card-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.gal-card-author time { flex: none; white-space: nowrap; }
.gal-dot { opacity: .5; }
.gal-card-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gal-stat { display: inline-flex; align-items: center; gap: 4px; }
.gal-stat .ic { font-size: 14px; opacity: .8; }
.gal-stat.on { color: var(--gold-hi); }
.gal-stat.on .ic { opacity: 1; color: var(--gold); }

/* 불러오는 동안 */
.gal-card.skeleton { pointer-events: none; }
.gal-card.skeleton .gal-prev { background: rgba(255, 255, 255, .03); }
.sk-line { display: block; height: 12px; width: 80%; border-radius: 6px; background: linear-gradient(90deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .11), rgba(255, 255, 255, .05)); background-size: 200% 100%; animation: sk 1.4s ease-in-out infinite; }
.sk-line.short { width: 45%; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .sk-line { animation: none; } .gal-card { transition: none; } }

/* 밸런스 투표 글: 너프/적당/버프 3줄 (짧은 판정 이름이 들어가게 이름 칸을 넓힌다) */
.gal-prev-bal .gal-prev-label { flex-basis: 44px; font-family: var(--font-ui); font-size: 12px; letter-spacing: -.01em; }
.gal-card-match {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  font-size: 12.5px; font-weight: 700; color: #b7dd84;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gal-card-match span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gal-card-match i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.gal-card-match[hidden] { display: none; }

/* ---------------------------------------------------------------- 갤러리 목록 */
.gal-head { margin-bottom: 4px; }
/* 티어표 | 밸런스 투표 탭 */
.gal-tabs { display: flex; gap: 4px; margin: 14px 0 0; border-bottom: 1px solid rgba(255, 255, 255, .1); overflow-x: auto; scrollbar-width: none; }
.gal-tabs a {
  flex: none; padding: 9px 14px 8px; margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted); font-size: 14.5px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.gal-tabs a:hover { color: var(--text); }
.gal-tabs a.on { color: var(--gold-hi); border-bottom-color: var(--gold); }
.gal-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 16px; }
.gal-select {
  min-height: 34px; max-width: 100%; padding: 0 26px 0 10px;
  background: #13151b; border: 1px solid rgba(255, 255, 255, .14); border-radius: 8px;
  font-size: 13.5px;
}
.gal-filter-chip {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 34px; padding: 0 4px 0 12px; max-width: 100%;
  border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(217, 164, 65, .1);
  color: var(--gold-hi); font-size: 13px; font-weight: 600;
}
.gal-filter-chip .gal-author-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-filter-chip a { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--muted); text-decoration: none; font-size: 17px; }
.gal-filter-chip a:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.gal-more { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 18px; }
.gal-more:empty { display: none; }
.gal-empty { padding: 40px 0; }

/* ---------------------------------------------------------------- 홈: 갤러리 구역 */
.gal-home-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.gal-home-head .block-title { margin: 0; }
.gal-strip-note { grid-column: 1 / -1; margin: 0; padding: 28px 0; text-align: center; color: var(--muted); font-size: 14px; }
.gal-home-all { margin-left: auto; color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.gal-home-all:hover { color: var(--gold-hi); }
.gal-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gal-strip > :nth-child(n+5) { display: none; }
@media (max-width: 899px) {
  /* 좁은 화면: 옆으로 넘기는 띠 */
  .gal-strip {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 210px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
    margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px;
    scrollbar-width: thin;
  }
  .gal-strip > * { scroll-snap-align: start; }
  .gal-strip > :nth-child(n+5) { display: flex; }
}
@media (max-width: 640px) {
  .gal-strip { margin: 0 -12px; padding: 0 12px 8px; scroll-padding: 0 12px; grid-auto-columns: 188px; }
}

/* ---------------------------------------------------------------- 갤러리 글 */
.gal-post-head { margin-bottom: 12px; }
.gal-post-head .shared-title { margin: 0 0 8px; overflow-wrap: anywhere; }
.gal-post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--muted); font-size: 13.5px; }
.gal-post-meta .acct-av { width: 24px; height: 24px; }
.gal-post-author { color: var(--gold-hi); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.gal-post-author:hover { text-decoration: underline; }
.gal-post-tpl { color: var(--muted); }
.gal-post-tpl:hover { color: var(--gold-hi); }
.gal-hidden-badge { padding: 2px 8px; border-radius: 999px; background: rgba(229, 72, 77, .18); color: #ffb4b0; font-size: 12px; font-weight: 700; }
.gal-post-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 16px; }
.gal-react { display: inline-flex; gap: 8px; }
.gal-react-btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px;
  background: rgba(0, 0, 0, .3); color: var(--text);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.gal-react-btn .ic { font-size: 18px; color: var(--muted); }
.gal-react-btn b { font-variant-numeric: tabular-nums; }
.gal-react-btn:hover { border-color: var(--gold); }
.gal-react-btn.like.on { border-color: #9fdc7a; background: rgba(110, 190, 80, .16); color: #c9eeb2; }
.gal-react-btn.like.on .ic { color: #9fdc7a; }
.gal-react-btn.dislike.on { border-color: #f07a7d; background: rgba(229, 72, 77, .16); color: #ffc4c2; }
.gal-react-btn.dislike.on .ic { color: #f07a7d; }
.gal-post-bar .actions .ic { font-size: 15px; }
.gal-kind-badge { padding: 2px 8px; border-radius: 999px; background: rgba(87, 167, 216, .16); color: #a9d4ef; font-size: 12px; font-weight: 700; }

/* 밸런스 투표 글: 모두의 결과와 비교 */
.bal-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  margin: 0 0 12px; padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: var(--radius);
  background: rgba(0, 0, 0, .25); font-size: 13.5px; color: var(--muted);
}
.bal-summary[hidden] { display: none; }
.bal-sum-pct { color: #c9eeb2; font-size: 14.5px; }
.bal-sum-legend { display: inline-flex; align-items: center; gap: 6px; }
.bal-sum-legend .bal-mark { position: static; }
.bal-sum-link { margin-left: auto; color: var(--gold-hi); font-weight: 600; text-decoration: none; white-space: nowrap; }
.bal-sum-link:hover { text-decoration: underline; }
.bal-mark {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  font-size: 10.5px; font-weight: 800; line-height: 1; white-space: nowrap;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .7);
}
.bal-mark.agree { background: #8fcf6a; color: #10200a; }
.bal-mark.differ { background: #f6a347; color: #261405; }
.tile .bal-mark { position: absolute; right: -4px; top: -4px; z-index: 1; pointer-events: none; }

/* ---------------------------------------------------------------- 티어 화면: 공개 창 미리보기 */
.gal-publish-prev { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.gal-publish-prev .gal-prev { height: auto; max-height: 118px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .08); }
.gal-publish-prev p { margin: 0; font-size: 13px; }

/* ---------------------------------------------------------------- 댓글 */
.cmt-sec { margin-top: 28px; }
.cmt-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.cmt-title { display: flex; align-items: center; gap: 8px; margin: 0; font-family: var(--font-title); font-size: 20px; color: var(--gold-hi); }
.cmt-title .ic { color: var(--gold); font-size: 18px; }
.cmt-count { font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--muted); }
.cmt-sort button { padding: 4px 10px; font-size: 12.5px; }
.cmt-list { list-style: none; margin: 0; padding: 0; }
.cmt-note { padding: 14px 0; color: var(--muted); font-size: 14px; }
/* 댓글 한 줄: [프로필 사진 + 연결선] [본문] / [ ] [답글 N개] / [ ] [펼친 답글]. --av 사진 크기, --gap 사진과 본문 사이 */
.cmt {
  --av: 32px; --gap: 10px; --pad: 12px;
  position: relative;
  display: grid; grid-template-columns: var(--av) minmax(0, 1fr); column-gap: var(--gap);
  padding: var(--pad) 0;
  border-top: 1px solid rgba(255, 255, 255, .07);
}
.cmt:first-child { border-top: 0; }
.cmt-avcol { grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: center; min-height: 0; }
.cmt-avcol > .acct-av { flex: none; width: var(--av); height: var(--av); font-size: 14px; }
.cmt-main { grid-column: 2; min-width: 0; }
.cmt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.cmt-name { color: var(--gold-hi); overflow-wrap: anywhere; }
.cmt-me { padding: 0 7px; border-radius: 999px; background: rgba(217, 164, 65, .18); color: var(--gold-hi); font-size: 11.5px; font-weight: 700; }
.cmt-vote {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--v) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--v) 60%, transparent);
  font-size: 11.5px; font-weight: 700; color: var(--text); white-space: nowrap;
}
.cmt-vote i { width: 7px; height: 7px; border-radius: 50%; background: var(--v); }
.acct-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.cmt-body { margin: 3px 0 4px; font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
.cmt-removed { color: var(--muted); font-style: italic; }
.cmt-actions { display: flex; flex-wrap: wrap; gap: 2px; margin-left: -8px; }
.cmt-actions button {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 30px; padding: 0 8px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.cmt-actions button:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.cmt-actions .ic { font-size: 14px; }
.cmt-like { font-variant-numeric: tabular-nums; }
.cmt-like.on, .cmt-like.on:hover { color: #f58f9c; }

/* 답글(대댓글) — YouTube 처럼 3단계까지. 펼친 답글 목록만 한 칸 들여 쓰므로 들여쓰기는 두 번(맨 위 → 2단계 → 3단계)이 끝이다.
   부모 사진 밑에서 내려오는 세로선(.cmt-rail, 누르면 접힘)이 답글 목록으로 이어지고, 답글마다 둥근 꺾은선(::before)으로 이어진다. */
.cmt { --line: rgba(217, 164, 65, .28); }
.cmt-thread-toggle {
  grid-column: 2; justify-self: start;
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 30px; margin: 2px 0 0 -10px; padding: 0 10px;
  border: 0; border-radius: 999px; background: transparent;
  color: var(--gold); font-size: 13px; font-weight: 700; cursor: pointer;
}
.cmt-thread-toggle:hover { background: rgba(217, 164, 65, .12); }
.cmt-thread-toggle .ic { font-size: 18px; transition: transform .15s ease; }
.cmt-thread-toggle[aria-expanded="true"] .ic { transform: rotate(180deg); }
/* 세로선: 사진 밑부터 "답글 숨기기" 줄 끝까지. 넓게 눌리도록 단추는 16px, 선은 가운데 2px */
.cmt-rail {
  flex: 1 1 auto; width: 16px; min-height: 8px; margin: 4px 0 0; padding: 0;
  border: 0; background: linear-gradient(var(--line), var(--line)) center / 2px 100% no-repeat; cursor: pointer;
}
.cmt-rail:hover { --line: rgba(240, 200, 120, .75); }
.cmt-replies {
  grid-column: 2; list-style: none; margin: 0; padding: 0;
  /* 부모 사진 가운데(=세로선)까지의 거리: 목록은 본문 칸에서 시작하므로 사진 칸 절반 + 간격만큼 왼쪽 */
  --rx: calc(-1 * (var(--gap) + var(--av) / 2) - 1px);
}
.cmt.cmt-reply { --av: 24px; --gap: 8px; --pad: 8px; border-top: 0; }
.cmt.cmt-reply .acct-av { font-size: 11px; }
/* 꺾은선: 위에서 내려와 답글 사진 가운데 높이에서 둥글게 꺾여 사진 왼쪽까지 */
.cmt-replies > .cmt::before {
  content: ''; position: absolute; left: var(--rx); top: 0;
  width: calc(-1 * var(--rx) - 4px); height: calc(var(--pad) + var(--av) / 2);
  border: solid var(--line); border-width: 0 0 2px 2px; border-bottom-left-radius: 12px;
  pointer-events: none;
}
/* 다음 답글이 있으면 세로선을 이어 그린다 */
.cmt-replies > .cmt:not(:last-child)::after {
  content: ''; position: absolute; left: var(--rx); top: 0; bottom: 0;
  border-left: 2px solid var(--line); pointer-events: none;
}
.cmt-reply .cmt-body { font-size: 14px; }
.cmt-replies > .cmt-note { padding: 8px 0; font-size: 13px; }
.cmt-mention { color: var(--gold); font-weight: 700; }
.cmt-reply-form { margin: 8px 0 4px; }
.cmt-reply-lead { font-size: 13px; }
.cmt-av-gone { display: inline-block; background: rgba(255, 255, 255, .08); box-shadow: none; }
.cmt-new > .cmt-main { animation: cmt-new 1.8s ease; border-radius: 8px; }
@keyframes cmt-new { from { background: rgba(217, 164, 65, .18); } to { background: transparent; } }

.cmt-form-box { margin: 6px 0 10px; }
.cmt-form { display: grid; gap: 6px; }
.cmt-input {
  width: 100%; min-height: 64px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, .16);
  background: #101217; color: var(--text);
  font-size: 14.5px; line-height: 1.5; resize: vertical;
}
.cmt-input:focus { border-color: var(--gold); outline: none; }
.cmt-form-foot { display: flex; align-items: center; gap: 10px; }
.cmt-hint { margin-right: auto; color: var(--muted); font-size: 12px; }
.cmt-counter { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cmt-counter.over { color: #ffb4b0; font-weight: 700; }
@media (pointer: coarse) { .cmt-hint { visibility: hidden; } }
.cmt-login {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px dashed var(--line-strong); border-radius: 10px;
  background: rgba(217, 164, 65, .06); color: var(--gold-hi);
  font-size: 14.5px; font-weight: 600; cursor: pointer;
}
.cmt-login:hover { background: rgba(217, 164, 65, .12); border-style: solid; }

/* 상세 창 안의 항목 댓글 */
.cmt-item-sec { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(217, 164, 65, .2); }
.cmt-item-sec .cmt-title { font-size: 17px; }

/* ---------------------------------------------------------------- 좁은 화면 */
@media (max-width: 640px) {
  .gal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gal-prev { height: 96px; padding: 6px; }
  .gal-prev-row { height: 26px; }
  .gal-prev-label { flex-basis: 24px; font-size: 11.5px; }
  .gal-prev-items img { height: 24px; max-width: 26px; }
  .gal-prev.kind-icon .gal-prev-items img { height: 22px; }
  .gal-card-body { padding: 8px 10px 10px; }
  .gal-card-title { font-size: 14px; }
  .gal-card-stats { gap: 2px 10px; }
  .gal-controls .seg { flex: none; }
  .gal-select { flex: 1 1 160px; min-width: 0; }
  .gal-post-bar .gal-react { width: 100%; }
  .gal-react-btn { flex: 1; justify-content: center; }
  .gal-post-bar .actions { width: 100%; }
  .gal-post-bar .actions .btn:not(.small) { flex: 1 1 auto; }
  .gal-prev-bal .gal-prev-label { flex-basis: 34px; font-size: 10.5px; }
  .gal-card-match { font-size: 11.5px; }
  .bal-summary { font-size: 12.5px; padding: 8px 10px; }
  .bal-sum-link { margin-left: 0; }
  .acct-modal { padding: 18px 16px 16px; }
  .acct-modal-title { font-size: 19px; }
}
@media (max-width: 420px) {
  .acct-chip { padding-right: 4px; }
  .acct-chip-name, .acct-chip .ic-caret { display: none; }
  .acct-login-btn .ic { display: none; }
  .acct-login-btn { padding: 0 9px; }
  .gal-react-label { display: none; }
}
