:root {
  --panel: rgba(255, 255, 255, 0.92);
  --line: rgba(35, 50, 70, 0.12);
  --ink: #2b3542;
  --muted: #6b7787;
  --accent: #f97316;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
    'Malgun Gothic', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #cfdfea;
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
}


.panel {
  position: fixed;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(20, 30, 45, 0.1);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(20, 35, 60, 0.06), 0 6px 16px rgba(20, 35, 60, 0.08);
  backdrop-filter: blur(8px);
}

/* HUD */
#hud { top: 14px; left: 14px; padding: 8px 10px; min-width: 0; max-width: 260px; }
.hud-title { font-weight: 800; font-size: 13.5px; letter-spacing: -0.2px; display: flex; align-items: center; gap: 6px; }
.badge {
  font-size: 9.5px; font-weight: 700; color: var(--muted); background: rgba(120, 140, 165, 0.14);
  padding: 2px 6px; border-radius: 4px;
}
.gdot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; vertical-align: 0; margin-right: 5px; flex-shrink: 0; }
.co { color: var(--muted); font-weight: 600; }
.hud-me { font-size: 12px; font-weight: 700; line-height: 1.5; }
.hud-me .co { font-size: 11px; }

/* 사이드 패널 */
#side { top: 14px; right: 14px; width: 236px; padding: 6px 8px 8px; }
.side-tabs { display: flex; gap: 0; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 8px 0 7px;
  font-size: 12px; font-weight: 700; background: none; color: var(--muted); cursor: pointer;
  font-family: inherit;
}
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.tab-body { max-height: 44vh; overflow-y: auto; }
.hidden { display: none; }

.row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 6px; border-radius: 6px; font-size: 12px;
}
.row + .row { margin-top: 1px; }
.row.me { background: rgba(249, 115, 22, 0.09); }
.row .gdot { margin-right: 0; }
.row .nm { font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sal { color: var(--muted); font-variant-numeric: tabular-nums; }
.row .rank { width: 16px; color: var(--muted); font-weight: 700; }
.tier-row { display: flex; align-items: center; gap: 8px; padding: 5px 7px; font-size: 12px; }
.tier-row .dot { width: 8px; height: 8px; border-radius: 999px; }
.tier-row .rng { color: var(--muted); margin-left: auto; font-size: 11px; }

/* 채팅 */
#chat { left: 14px; bottom: 14px; width: 380px; padding: 8px 10px 10px; }
@media (max-width: 720px) { #chat { width: calc(100vw - 28px); } #side { display: none; } }
#chat-log {
  height: 108px; overflow-y: auto; font-size: 12px; line-height: 1.55;
  padding-right: 4px; margin-bottom: 8px;
}
#chat-log .msg { word-break: break-word; }
#chat-log .who { font-weight: 800; }
#chat-log .sys { color: var(--muted); }
#chat-form { display: flex; gap: 6px; }
#chat-input {
  flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px;
  font-size: 13px; font-family: inherit; outline: none; background: #fff; color: var(--ink);
}
#chat-input:focus { border-color: var(--accent); }
#chat-form button {
  border: 0; border-radius: 8px; padding: 0 14px; font-weight: 700; font-size: 12.5px;
  background: var(--ink); color: #fff; cursor: pointer; font-family: inherit;
}

@media (max-width: 720px) { #chat { margin-left: 0; bottom: 14px; } }

/* 입장 화면 */
#gate {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: #eceeea;
  z-index: 10;
}
#gate.gone { display: none; }
.gate-card {
  width: min(400px, calc(100vw - 40px));
  background: #fff; border-radius: 14px; padding: 26px 24px; border: 1px solid rgba(20, 30, 45, 0.08);
  box-shadow: 0 10px 32px rgba(20, 40, 70, 0.12);
}
.gate-card h1 { margin: 0; font-size: 28px; letter-spacing: -1px; }
.gate-card .sub { margin: 6px 0 20px; color: var(--muted); font-size: 13px; word-break: keep-all; }
.field { display: block; margin-bottom: 16px; font-size: 12px; font-weight: 700; color: var(--muted); }
.field span { display: block; margin-bottom: 6px; }
.field em { font-style: normal; color: var(--ink); font-size: 14px; }
.field input[type='text'], #nick {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  font-size: 14px; font-family: inherit; outline: none; color: var(--ink);
}
#nick:focus { border-color: var(--accent); }
#salary { width: 100%; accent-color: var(--accent); }
.tier-preview {
  display: flex; align-items: center; gap: 10px;
  background: rgba(120, 140, 165, 0.1); border-radius: 12px; padding: 12px; font-size: 13px;
}
.tier-preview .big { font-size: 26px; }
.tier-preview b { font-size: 14px; }
.tier-preview small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.notice {
  margin: 14px 0; font-size: 11.5px; line-height: 1.6; color: var(--muted);
  background: rgba(249, 115, 22, 0.09); border-radius: 10px; padding: 10px 12px;
}
#enter {
  width: 100%; border: 0; border-radius: 12px; padding: 13px; font-size: 15px; font-weight: 800;
  background: var(--ink); color: #fff; cursor: pointer; font-family: inherit;
}
#enter:hover { background: #1c2530; }
.gate-error { margin-top: 10px; font-size: 12px; color: #d33; min-height: 16px; text-align: center; }

/* ---- 회사명/연차 입력 ---- */
.field-row { display: flex; gap: 10px; }
.field-row .grow { flex: 1; }
.field-row .w-years { width: 84px; }
.field small { font-weight: 600; color: #9aa5b3; font-size: 10px; }
#company, #years {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  font-size: 14px; font-family: inherit; outline: none; color: var(--ink); background: #fff;
}
#company:focus, #years:focus { border-color: var(--accent); }
.toggles { display: flex; gap: 14px; margin: -4px 0 16px; }
.tgl { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 5px; cursor: pointer; }
.tgl input { accent-color: var(--accent); }

/* ---- 이름표 미리보기 ---- */
.preview-wrap { background: rgba(120, 140, 165, 0.1); border-radius: 12px; padding: 12px; }
.preview-cap { font-size: 10.5px; font-weight: 700; color: var(--muted); text-align: center; margin-bottom: 8px; }
.tag-preview {
  background: #fff; border: 2px solid var(--line); border-radius: 9px;
  padding: 6px 11px; text-align: center; margin: 0 auto 10px; width: fit-content; min-width: 120px;
  box-shadow: 0 2px 6px rgba(30, 45, 65, 0.12);
}
.tag-preview .p-nick { font-size: 13px; font-weight: 800; color: #232d38; line-height: 16px; }
.tag-preview .p-sub { font-size: 11px; color: #7b8796; line-height: 14px; }
.tag-preview .p-sal { font-size: 11.5px; font-weight: 800; line-height: 15px; }
.tier-preview { background: none; padding: 0; }

/* ---- HUD 토글 칩 ---- */
.hud-toggles { display: flex; gap: 5px; margin-top: 6px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 6px; padding: 3px 8px; font-size: 10.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 5px;
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 999px; background: rgba(120, 140, 165, 0.35); }
.chip.on { color: var(--ink); border-color: rgba(20, 30, 45, 0.25); }
.chip.on::before { background: #22c55e; }

/* ---- 따라가기 배너 ---- */
#follow-bar {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(35, 45, 56, 0.94); color: #fff; border-radius: 999px;
  padding: 8px 10px 8px 16px; font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; gap: 10px; z-index: 5;
  box-shadow: 0 6px 18px rgba(20, 35, 60, 0.25);
}
#follow-bar.hidden { display: none; }
#follow-cancel {
  border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.2); color: #fff;
  padding: 4px 10px; font-size: 11px; font-weight: 700; cursor: pointer; font-family: inherit;
}

/* 접속자 행 클릭 가능 표시 */
.row { cursor: pointer; }
.row:hover { background: rgba(120, 140, 165, 0.14); }
.row.me:hover { background: rgba(249, 115, 22, 0.18); }
.row .co { color: var(--muted); font-size: 10.5px; }
.row .ai {
  display: inline-block; margin-left: 4px; padding: 1px 4px; border-radius: 3px;
  background: rgba(120, 140, 165, 0.18); color: var(--muted); font-size: 9px; font-weight: 800; vertical-align: 1px;
}

/* ---- 모바일 제스처 ---- */
html, body { overscroll-behavior: none; }

#recenter {
  position: fixed; left: 50%; bottom: 190px; transform: translateX(-50%);
  z-index: 6; border: 1px solid rgba(20, 30, 45, 0.12); border-radius: 999px;
  background: rgba(255, 255, 255, 0.96); color: var(--ink);
  padding: 8px 14px 8px 11px; font-size: 12px; font-weight: 700; font-family: inherit;
  cursor: pointer; box-shadow: 0 2px 8px rgba(20, 35, 60, 0.14);
  display: flex; align-items: center; gap: 6px;
}
#recenter svg { width: 16px; height: 16px; }
#recenter.hidden { display: none; }

@media (max-width: 720px) {
  #hud { max-width: calc(100vw - 170px); padding: 8px 10px; }
  #chat-log { height: 88px; }
  #recenter { bottom: 168px; }
}
@media (max-width: 720px) {
  #hud { max-width: calc(100vw - 175px); }
}

/* ---- 접속자 패널 토글 (모바일) ---- */
#players-fab {
  display: none;
  position: fixed; top: 106px; right: 12px; z-index: 6;
  align-items: center; gap: 5px;
  border: 1px solid rgba(20, 30, 45, 0.12); border-radius: 999px;
  background: rgba(255, 255, 255, 0.96); color: var(--ink);
  padding: 7px 12px 7px 10px; font-size: 13px; font-weight: 800; font-family: inherit;
  cursor: pointer; box-shadow: 0 2px 8px rgba(20, 35, 60, 0.14);
}
#players-fab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
#players-fab .fab-icon { display: flex; }
#players-fab .fab-icon svg { width: 17px; height: 17px; }

@media (max-width: 720px) {
  #players-fab { display: flex; }
  #side {
    display: block;                     /* 위쪽 미디어쿼리의 display:none 을 되돌린다 */
    top: 152px; right: 12px; width: 244px;
    transform: translateX(calc(100% + 22px));
    transition: transform 0.22s ease;
    z-index: 5;
  }
  #side.open { transform: none; }
  .tab-body { max-height: 34vh; }
}


/* ---------------------------------------------------------- 명함 카드 */
#card-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(18, 28, 40, 0.32);
}
#card-backdrop.hidden, #namecard.hidden { display: none; }

#namecard {
  --surface-1: #fcfcfb;          /* 차트 표면 */
  --text-primary: #17202b;
  --text-secondary: #6b7787;
  --bar-latest: #2a78d6;         /* 파랑 step450 - 가장 최근 확정 연도 */
  --bar-past: #86b6ef;           /* 파랑 step250 - 이전 연도 (대비 2.06:1, 검증 통과) */

  position: fixed; z-index: 41;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(320px, calc(100vw - 32px));
  background: var(--surface-1); border-radius: 18px; padding: 20px;
  box-shadow: 0 20px 50px rgba(15, 30, 55, 0.28);
}
#card-close {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border: 0; border-radius: 999px;
  background: rgba(120, 140, 165, 0.14); color: var(--text-secondary);
  font-size: 13px; cursor: pointer; font-family: inherit;
}

.card-head { display: flex; align-items: center; gap: 12px; }
.card-avatar {
  width: 46px; height: 46px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff; line-height: 1; background: rgba(120, 140, 165, 0.12); flex-shrink: 0;
}
.card-avatar small { font-size: 9px; font-weight: 700; margin-top: 2px; opacity: .9; }
.card-nick { font-size: 17px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.3px; }
.card-nick .ai, .card-nick .me-tag {
  font-size: 9px; padding: 1px 5px; border-radius: 5px; vertical-align: 3px; margin-left: 4px;
  color: #fff; font-weight: 800;
}
.card-nick .ai { background: #6b7280; }
.card-nick .me-tag { background: var(--accent); }
.card-sub { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

.card-stats { display: flex; gap: 8px; margin: 16px 0 6px; }
.card-stats div {
  flex: 1; background: rgba(120, 140, 165, 0.1); border-radius: 10px; padding: 9px 4px; text-align: center;
}
.card-stats span { display: block; font-size: 10px; color: var(--text-secondary); font-weight: 700; }
.card-stats b { font-size: 13px; color: var(--text-primary); }

.chart-head { display: flex; align-items: baseline; gap: 7px; margin: 16px 0 2px; }
.chart-title { font-size: 12px; font-weight: 800; color: var(--text-primary); }
.chart-range { font-size: 10.5px; color: var(--text-secondary); }
.chart-delta { margin-left: auto; font-size: 12px; font-weight: 800; }
.chart-partial { margin-top: 2px; font-size: 10.5px; color: var(--text-secondary); line-height: 1.5; }
#namecard svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-note {
  margin-top: 8px; font-size: 10.5px; line-height: 1.5; color: var(--text-secondary);
  background: rgba(249, 115, 22, 0.1); border-radius: 8px; padding: 7px 9px;
}
#card-tip {
  position: absolute; pointer-events: none; z-index: 2;
  background: var(--text-primary); color: #fff; border-radius: 7px;
  padding: 5px 8px; font-size: 11px; font-weight: 700; white-space: nowrap;
  transform: translate(-50%, -100%); opacity: 0; transition: opacity 0.12s;
}
#card-tip.on { opacity: 1; }
#card-go {
  width: 100%; margin-top: 14px; border: 0; border-radius: 11px; padding: 11px;
  font-size: 13.5px; font-weight: 800; background: var(--ink); color: #fff;
  cursor: pointer; font-family: inherit;
}

@media (max-width: 720px) {
  #namecard {
    top: auto; bottom: 0; left: 0; transform: none;
    width: 100vw; border-radius: 20px 20px 0 0; padding: 18px 18px 26px;
  }
}

@media (max-width: 720px) {
  /* 상단은 HUD·미니맵이 차지하므로 배너류는 하단에 쌓는다 */
  #follow-bar {
    top: auto; bottom: 212px; white-space: nowrap;
    font-size: 11.5px; padding: 7px 8px 7px 14px;
  }
  #follow-cancel { font-size: 10.5px; padding: 3px 9px; }
}

/* ---------------------------------------------------------- 소득·재직 인증 */
#gate .ghost {
  margin-top: 8px; background: none; color: var(--muted);
  border: 1px solid var(--line); font-weight: 700; font-size: 13px;
}
#gate .ghost:hover { background: rgba(120, 140, 165, 0.1); }
#verify-state.done { background: rgba(34, 197, 94, 0.12); color: #15803d; }
#verify-state .relock {
  background: none; border: 0; color: var(--muted); font-size: 11px;
  text-decoration: underline; cursor: pointer; padding: 0; font-family: inherit;
}
.locked { opacity: 0.6; pointer-events: none; }

#verify { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background: rgba(18, 28, 40, 0.45); overflow-y: auto; padding: 20px 0; }
#verify.hidden { display: none; }
.verify-card {
  position: relative; width: min(380px, calc(100vw - 32px));
  background: #fff; border-radius: 20px; padding: 24px;
  box-shadow: 0 20px 50px rgba(15, 30, 55, 0.3);
}
#verify-close {
  position: absolute; top: 14px; right: 14px; width: 28px; height: 28px;
  border: 0; border-radius: 999px; background: rgba(120, 140, 165, 0.14);
  color: var(--muted); cursor: pointer; font-size: 13px; font-family: inherit;
}
.v-title { margin: 0 0 6px; font-size: 19px; letter-spacing: -0.4px; line-height: 1.35; }
.v-sub { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.v-field { display: block; margin-bottom: 13px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.v-field > span { display: block; margin-bottom: 5px; }
.v-field input, .v-field select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 14px; font-family: inherit; color: var(--ink); background: #fff; outline: none;
}
.v-field input:focus, .v-field select:focus { border-color: var(--accent); }
.v-row { display: flex; gap: 9px; }
.v-row .grow { flex: 1; }
.v-field.hidden { display: none; }

.v-providers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.v-prov {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 2px;
  background: #fff; font-size: 10.5px; font-weight: 800; cursor: pointer;
  font-family: inherit; color: var(--ink);
}
.v-prov.on { background: var(--c); color: var(--i); border-color: var(--c); }

.v-notice {
  margin: 16px 0 14px; font-size: 11px; line-height: 1.65; color: var(--muted);
  background: rgba(249, 115, 22, 0.09); border-radius: 10px; padding: 10px 12px;
}
.v-notice.ok { background: rgba(34, 197, 94, 0.1); color: #15803d; }
.v-error { font-size: 12px; color: #d33; margin-bottom: 10px; text-align: center; }
#v-submit, #v-go {
  width: 100%; border: 0; border-radius: 12px; padding: 13px; font-size: 14.5px;
  font-weight: 800; background: var(--ink); color: #fff; cursor: pointer; font-family: inherit;
}
#v-submit:disabled { background: rgba(120, 140, 165, 0.3); cursor: default; }
.v-ghost {
  width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px; font-size: 12.5px; font-weight: 700; background: none;
  color: var(--muted); cursor: pointer; font-family: inherit;
}
.v-mockbadge {
  margin-top: 12px; text-align: center; font-size: 10.5px; font-weight: 700;
  color: #6366f1; background: rgba(99, 102, 241, 0.1); border-radius: 8px; padding: 6px;
}

/* 대기 화면 */
.v-wait { text-align: center; padding-top: 6px; }
.v-spinner {
  width: 42px; height: 42px; margin: 4px auto 18px; border-radius: 999px;
  border: 4px solid rgba(120, 140, 165, 0.2); border-top-color: var(--accent);
  animation: vspin 0.9s linear infinite;
}
@keyframes vspin { to { transform: rotate(360deg); } }
.v-count { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.v-stage { font-size: 11.5px; color: var(--accent); font-weight: 700; min-height: 18px; margin-bottom: 12px; }

/* 결과 화면 */
.v-done-head {
  display: inline-block; font-size: 11px; font-weight: 800; color: #15803d;
  background: rgba(34, 197, 94, 0.14); border-radius: 999px; padding: 4px 10px; margin-bottom: 10px;
}
.v-result { display: flex; gap: 8px; margin-bottom: 16px; }
.v-result div {
  flex: 1; background: rgba(120, 140, 165, 0.1); border-radius: 11px; padding: 10px; text-align: center;
}
.v-result span { display: block; font-size: 10px; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.v-result b { font-size: 14px; }
.v-career-title { font-size: 12px; font-weight: 800; margin-bottom: 7px; }
.v-career-title small { font-weight: 600; color: var(--muted); font-size: 10px; }
.v-career { list-style: none; margin: 0; padding: 0; }
.v-career li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-size: 11.5px; padding: 7px 9px; border-radius: 8px; background: rgba(120, 140, 165, 0.08);
}
.v-career li + li { margin-top: 4px; }
.v-career li span { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.card-nick .ok-tag {
  font-size: 9px; padding: 1px 5px; border-radius: 5px; vertical-align: 3px; margin-left: 4px;
  background: #22c55e; color: #fff; font-weight: 800;
}
.chart-note.ok { background: rgba(34, 197, 94, 0.12); color: #15803d; }
.card-career-title { font-size: 11.5px; font-weight: 800; margin: 14px 0 6px; color: var(--text-primary); }
.card-career { list-style: none; margin: 0; padding: 0; }
.card-career li {
  display: flex; justify-content: space-between; gap: 8px; font-size: 11px;
  padding: 6px 8px; border-radius: 7px; background: rgba(120, 140, 165, 0.09);
}
.card-career li + li { margin-top: 3px; }
.card-career li span { color: var(--text-secondary); white-space: nowrap; font-size: 10.5px; }
.row .ok { color: #22c55e; font-weight: 800; font-size: 11px; margin-left: 3px; }

/* ---- 동의 화면 ---- */
.c-all {
  display: flex; align-items: center; gap: 8px; padding: 12px;
  border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer;
  font-size: 13.5px; margin-bottom: 12px;
}
.c-all input { accent-color: var(--accent); width: 17px; height: 17px; }
.c-all span { margin-left: auto; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.c-list { border-top: 1px solid var(--line); }
.c-item { border-bottom: 1px solid var(--line); }
.c-head { display: flex; align-items: center; gap: 7px; padding: 11px 2px; cursor: pointer; }
.c-head input { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; }
.c-tag { font-size: 9.5px; font-weight: 800; padding: 2px 5px; border-radius: 4px; flex-shrink: 0; }
.c-tag.req { background: rgba(249, 115, 22, 0.15); color: #c2410c; }
.c-tag.opt { background: rgba(120, 140, 165, 0.16); color: var(--muted); }
.c-title { font-size: 12.5px; font-weight: 700; flex: 1; }
.c-more {
  border: 0; background: none; color: var(--muted); font-size: 11px;
  text-decoration: underline; cursor: pointer; font-family: inherit; flex-shrink: 0;
}
.c-detail { padding: 2px 2px 12px 24px; }
.c-detail.hidden { display: none; }
.c-detail table { width: 100%; border-collapse: collapse; font-size: 11px; }
.c-detail th {
  text-align: left; vertical-align: top; padding: 4px 8px 4px 0; color: var(--muted);
  font-weight: 700; white-space: nowrap; width: 78px;
}
.c-detail td { padding: 4px 0; line-height: 1.55; color: var(--ink); }
.c-note {
  margin-top: 7px; font-size: 10.5px; font-weight: 700; color: #15803d;
  background: rgba(34, 197, 94, 0.1); border-radius: 7px; padding: 6px 8px;
}
#c-next {
  width: 100%; margin-top: 16px; border: 0; border-radius: 12px; padding: 13px;
  font-size: 14.5px; font-weight: 800; background: var(--ink); color: #fff;
  cursor: pointer; font-family: inherit;
}
#c-next:disabled { background: rgba(120, 140, 165, 0.3); cursor: default; }
.c-ver { margin-top: 10px; text-align: center; font-size: 10px; color: var(--muted); }
.v-steps {
  display: flex; align-items: center; gap: 5px; justify-content: center;
  flex-wrap: wrap; margin-bottom: 14px;
}
.v-steps span { width: 18px; height: 4px; border-radius: 999px; background: rgba(120, 140, 165, 0.25); }
.v-steps span.done { background: #22c55e; }
.v-steps span.now { background: var(--accent); }
.v-steps b { font-size: 11.5px; margin-left: 4px; }
.v-steps small { font-size: 10.5px; color: var(--muted); width: 100%; }
.card-stats span em { font-style: normal; opacity: 0.75; font-size: 9px; }

/* ---------------------------------------------------------- 건물 점령전 */
#claim-bar {
  --mc: #64748b;
  position: fixed; left: 50%; bottom: 250px; transform: translateX(-50%); z-index: 6;
  display: flex; flex-direction: column; gap: 8px;
  background: rgba(255, 255, 255, 0.97); border: 1px solid rgba(20, 30, 45, 0.12);
  border-left: 4px solid var(--mc);
  border-radius: 10px; padding: 10px 12px 10px 12px;
  box-shadow: 0 2px 6px rgba(20, 35, 60, 0.08), 0 10px 24px rgba(20, 35, 60, 0.14);
  width: min(520px, calc(100vw - 24px));
}
#claim-bar.hidden { display: none; }
.cb-head { display: flex; align-items: center; gap: 10px; }
.cb-icon {
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--mc) 12%, white); flex-shrink: 0;
}
.cb-icon::before { content: ''; width: 11px; height: 11px; border-radius: 999px; background: var(--mc); }
.cb-cond { font-size: 11px; line-height: 1.5; color: var(--ink); background: rgba(120, 140, 165, 0.1); border-radius: 6px; padding: 6px 9px; }
.cb-cond b { font-weight: 800; margin-right: 4px; }
.cb-cond em { font-style: normal; font-weight: 800; color: var(--mc); }
.cb-cond.met { background: rgba(34, 197, 94, 0.12); }
.cb-cond.unmet { background: rgba(239, 68, 68, 0.08); }
.cb-main { flex: 1; min-width: 0; }
.cb-title b { font-size: 13.5px; }
.cb-title span { font-size: 11px; color: var(--mc); font-weight: 800; }
.cb-desc { font-size: 11px; color: var(--muted); margin-top: 1px; }
.cb-vs { display: grid; gap: 3px; }
.vs-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; font-size: 11px; }
.vs-row span { color: var(--muted); font-weight: 800; }
.vs-row i { display: block; height: 7px; border-radius: 999px; min-width: 6px; transition: width 0.25s; }
.vs-row em { font-style: normal; color: var(--ink); font-weight: 700; white-space: nowrap; }
#cb-go {
  flex: 1; border: 0; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; font-weight: 800;
  background: var(--ink); color: #fff; cursor: pointer; font-family: inherit; white-space: nowrap;
}
#cb-go.ok { background: #16a34a; }
#cb-go:disabled { background: rgba(120, 140, 165, 0.35); color: #fff; cursor: default; }

#toast {
  position: fixed; left: 50%; top: 70px; transform: translate(-50%, -12px); z-index: 12;
  padding: 11px 18px; border-radius: 8px; font-size: 13px; font-weight: 700;
  color: #fff; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 8px 24px rgba(20, 35, 60, 0.3); max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.ok { background: #16a34a; }
#toast.bad { background: #475569; }

.cq-head { font-size: 11.5px; font-weight: 800; padding: 4px 7px 8px; color: var(--muted); }
.cq-head b { color: var(--ink); font-size: 14px; }
.row.cq { cursor: default; }
.row.cq:hover { background: none; }
.row.cq.me { background: rgba(249, 115, 22, 0.09); }
.row.cq .sal { text-align: right; }

@media (max-width: 720px) {
  #claim-bar { bottom: 254px; gap: 8px; padding: 8px 10px 8px 12px; }
  .cb-info b { font-size: 12px; }
  .cb-holder { padding-left: 8px; font-size: 10.5px; }
  #cb-go { padding: 9px 11px; font-size: 12px; }
}

/* ---- 인증 플로우 진행 표시 ---- */
.v-stepper {
  display: flex; justify-content: space-between; list-style: none; margin: 0 0 18px; padding: 0;
  position: relative;
}
.v-stepper::before {
  content: ''; position: absolute; left: 14px; right: 14px; top: 11px; height: 2px;
  background: rgba(120, 140, 165, 0.25);
}
.v-stepper li { position: relative; text-align: center; width: 20%; font-size: 10px; color: var(--muted); font-weight: 700; }
.v-stepper li i {
  display: block; width: 22px; height: 22px; margin: 0 auto 4px; border-radius: 999px; line-height: 22px;
  font-style: normal; font-size: 10.5px; font-weight: 800;
  background: #fff; border: 2px solid rgba(120, 140, 165, 0.35); color: var(--muted);
}
.v-stepper li.done i { background: #22c55e; border-color: #22c55e; color: #fff; }
.v-stepper li.done span { color: #15803d; }
.v-stepper li.now i { background: var(--accent); border-color: var(--accent); color: #fff; }
.v-stepper li.now span { color: var(--ink); }

.v-handoff {
  margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; font-size: 12px; font-weight: 700;
  background: rgba(34, 197, 94, 0.12); color: #15803d; text-align: center;
}
.v-title small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.v-howto { text-align: left; margin: 6px 0 14px; padding-left: 22px; font-size: 12.5px; line-height: 1.7; color: var(--ink); }
.v-howto em { font-style: normal; color: var(--accent); font-weight: 700; }
.v-primary {
  width: 100%; border: 0; border-radius: 12px; padding: 13px; font-size: 14px; font-weight: 800;
  background: var(--ink); color: #fff; cursor: pointer; font-family: inherit;
}
.v-primary:disabled { background: rgba(120, 140, 165, 0.35); cursor: default; }
#v-go.v-primary.big, .v-primary.big { background: var(--accent); font-size: 15.5px; padding: 15px; }

.chart-single {
  background: rgba(120, 140, 165, 0.1); border-radius: 12px; padding: 14px; text-align: center;
}
.chart-single span { display: block; font-size: 11px; font-weight: 700; color: var(--text-secondary); }
.chart-single b { display: block; font-size: 22px; margin: 4px 0; color: var(--text-primary); }
.chart-single small { font-size: 10.5px; color: var(--text-secondary); }

/* 점령 탭 — 종목 범례와 아이콘 */
.cq-legend { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 4px 8px; }
.cq-lg {
  font-size: 10px; font-weight: 700; padding: 2px 7px 2px 5px; border-radius: 4px;
  color: var(--ink); background: rgba(120, 140, 165, 0.1); display: inline-flex; align-items: center; gap: 4px;
}
.cq-lg::before { content: ''; width: 7px; height: 7px; border-radius: 999px; background: var(--mc); }
.row.cq { border-left: 3px solid var(--mc); padding-left: 6px; }
.cq-ic { width: 20px; display: flex; justify-content: center; }
.cq-ic::before { content: ''; width: 8px; height: 8px; border-radius: 999px; background: var(--mc); }
@media (max-width: 720px) {
  #claim-bar { bottom: 254px; gap: 8px; padding: 8px 10px; }
  .cb-icon { width: 36px; height: 36px; }
  .cb-desc { display: none; }
  #cb-go { padding: 9px 11px; font-size: 11.5px; }
}


/* ============================================================ 뷰/탭 구조 */
:root { --tab-h: 56px; }
.view.hidden { display: none !important; }
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--tab-h); z-index: 30;
  display: none; justify-content: space-around; align-items: stretch;
  background: rgba(255, 255, 255, 0.96); border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
#tabbar.on { display: flex; }
.tb {
  flex: 1; border: 0; background: none; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted);
}
.tb svg { width: 22px; height: 22px; }
.tb span { font-size: 10px; font-weight: 700; letter-spacing: -0.2px; }
.tb.active { color: var(--ink); }
.tb.active svg { stroke-width: 2.2; }

/* 라운지 안의 하단 요소는 탭바만큼 올린다 */
#lounge #chat { bottom: calc(14px + var(--tab-h)); }
#lounge #claim-bar { bottom: calc(250px + var(--tab-h)); }
#lounge #recenter { bottom: calc(190px + var(--tab-h)); }
@media (max-width: 720px) {
  #lounge #claim-bar { bottom: calc(254px + var(--tab-h)); }
  #lounge #recenter { bottom: calc(168px + var(--tab-h)); }
  #lounge #follow-bar { bottom: calc(212px + var(--tab-h)); }
}

/* 페이지형 뷰 공통 */
.page {
  max-width: 560px; margin: 0 auto; padding: 18px 16px calc(var(--tab-h) + 24px);
  min-height: 100vh; background: #f6f5f1;
}
body.paged { background: #f6f5f1; overflow: auto; }
.soon { text-align: center; color: var(--muted); font-weight: 700; padding: 80px 0; line-height: 1.8; }
.soon small { font-weight: 600; font-size: 12px; }

/* ============================================================ 홈: 성적표 */
.brand { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: -0.8px; }
.brand span { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 0.3px; }

.report {
  background: #fff; border-radius: 12px; padding: 20px 18px 16px; border: 1px solid rgba(20, 30, 45, 0.08);
  box-shadow: 0 1px 2px rgba(20, 35, 60, 0.04), 0 4px 14px rgba(20, 35, 60, 0.05); position: relative; overflow: hidden;
}
.report::before {
  content: ''; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--gc, var(--accent));
}
.rp-head { display: flex; justify-content: space-between; align-items: flex-start; }
.rp-title { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: 0.5px; }
.rp-year { font-size: 11px; color: var(--muted); font-weight: 700; }
.rp-grade { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 2px; flex-wrap: wrap; }
.rp-grade b { font-size: 56px; line-height: 1; letter-spacing: -2px; color: var(--gc, var(--ink)); }
.rp-grade b small { font-size: 22px; letter-spacing: 0; margin-left: 2px; }
.rp-grade .top { font-size: 18px; font-weight: 800; }
.rp-grade .top { white-space: nowrap; }
.rp-grade .top em { font-style: normal; color: var(--muted); font-size: 12px; font-weight: 700; margin-left: 4px; white-space: nowrap; }
.rp-pay { font-size: 15px; font-weight: 700; margin: 6px 0 2px; }
.rp-pay .v { font-size: 11px; font-weight: 800; color: #15803d; background: rgba(34,197,94,.12); padding: 2px 7px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; }
.rp-pay .u { font-size: 11px; font-weight: 800; color: #c2410c; background: rgba(249,115,22,.12); padding: 2px 7px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; }
.rp-sub { font-size: 12px; color: var(--muted); }
.rp-tier { display: inline-flex; align-items: center; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--muted); }

.rp-denoms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 16px 0 6px; }
.dn {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 4px; text-align: center;
  background: #fff; cursor: pointer; font-family: inherit; color: var(--ink);
}
.dn.on { border-color: var(--ink); background: rgba(20, 30, 45, 0.04); box-shadow: inset 0 0 0 1px var(--ink); }
.dn:disabled { opacity: .45; cursor: default; }
.dn small { display: block; font-size: 9.5px; color: var(--muted); font-weight: 700; }
.dn b { display: block; font-size: 15px; margin-top: 2px; }
.dn i { display: block; font-style: normal; font-size: 9.5px; color: var(--muted); }
.rp-note { font-size: 10.5px; color: var(--muted); line-height: 1.6; margin-top: 8px; }

.rp-actions { display: flex; gap: 8px; margin-top: 14px; }
.rp-actions button {
  flex: 1; border: 1px solid transparent; border-radius: 8px; padding: 11px 8px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.rp-actions .pri { background: var(--ink); color: #fff; }
.rp-actions .sec { background: #fff; color: var(--ink); border-color: var(--line); }

.card2 { background: #fff; border-radius: 12px; padding: 16px; margin-top: 12px; border: 1px solid rgba(20, 30, 45, 0.08);
  box-shadow: 0 1px 2px rgba(20, 35, 60, 0.04), 0 4px 14px rgba(20, 35, 60, 0.05); }
.card2 h3 { margin: 0 0 10px; font-size: 13px; }
.card2 h3 small { font-weight: 700; color: var(--muted); font-size: 10.5px; margin-left: 6px; }

/* 등급컷 표 */
.cuts { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cuts th { text-align: left; font-size: 10.5px; color: var(--muted); font-weight: 800; padding: 4px 6px; }
.cuts td { padding: 7px 6px; border-top: 1px solid var(--line); }
.cuts td:nth-child(2), .cuts th:nth-child(2) { text-align: center; }
.cuts td:nth-child(3), .cuts th:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }
.cuts tr.me td { background: rgba(120, 140, 165, 0.12); font-weight: 800; }
.cuts tr.me td .co { color: var(--ink); }
.cuts .g { display: inline-block; min-width: 24px; text-align: center; font-weight: 800; color: #fff;
  border-radius: 4px; padding: 2px 4px; font-size: 11.5px; }

.home-cta { background: #1f2937; color: #fff; border-radius: 12px; padding: 24px 20px; }
.home-cta h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -1px; }
.home-cta p { margin: 0 0 16px; opacity: .85; font-size: 13px; line-height: 1.6; }
.home-cta button { width: 100%; border: 0; border-radius: 8px; padding: 13px; font-size: 14px; font-weight: 800;
  background: var(--accent); color: #fff; cursor: pointer; font-family: inherit; }

/* ---- 성적표 공유 ---- */
#share { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; }
#share.hidden { display: none; }
#share-backdrop { position: absolute; inset: 0; background: rgba(18,28,40,.5); }
.share-card { position: relative; width: min(420px, calc(100vw - 32px)); background: #fff; border-radius: 14px; padding: 20px;
  box-shadow: 0 16px 40px rgba(15,30,55,.25); max-height: calc(100vh - 40px); overflow: auto; }
.share-card h2 { margin: 0 0 12px; font-size: 17px; }
#share-close { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border: 0; border-radius: 999px;
  background: rgba(120,140,165,.14); color: var(--muted); cursor: pointer; font-family: inherit; }
#sh-preview { width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; }
.sh-opt { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 12px 0; }
.sh-opt input { accent-color: var(--accent); }
#sh-go { width: 100%; border: 0; border-radius: 8px; padding: 13px; font-size: 14px; font-weight: 800;
  background: var(--ink); color: #fff; cursor: pointer; font-family: inherit; }
.sh-hint { font-size: 10.5px; color: var(--muted); margin-top: 8px; line-height: 1.6; }

/* ---- 등급컷 탭: 계산기 / 밴드 / 배치표 ---- */
.calc-row { display: flex; align-items: center; gap: 8px; }
.calc-row input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; font-size: 16px;
  font-weight: 800; font-family: inherit; color: var(--ink); outline: none; }
.calc-row input:focus { border-color: var(--accent); }
.calc-row span { font-size: 12px; font-weight: 800; color: var(--muted); }
.calc-row button { border: 0; border-radius: 8px; padding: 11px 16px; font-weight: 800; font-size: 13px;
  background: var(--ink); color: #fff; cursor: pointer; font-family: inherit; }
.calc-out { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 4px; }
.calc-out b { font-size: 28px; }
.calc-out span { font-size: 15px; font-weight: 800; }
.calc-out small { font-size: 11px; color: var(--muted); font-weight: 700; margin-left: auto; }
.band { width: 100%; height: auto; display: block; margin-top: 10px; }

.ladder { display: grid; gap: 4px; }
.lad-row { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: start; padding: 7px 6px; border-radius: 6px; }
.lad-row.me { background: rgba(120, 140, 165, 0.12); }
.lad-cut { display: flex; flex-direction: column; gap: 2px; }
.lad-cut b { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.lad-cut small { font-size: 9.5px; color: var(--muted); font-weight: 700; }
.lad-cut .g { display: inline-block; width: 22px; text-align: center; font-weight: 800; color: #fff; border-radius: 4px; font-size: 11px; padding: 1px 0; }
.lad-people { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.lad-chip { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 5px; background: rgba(120,140,165,.14); color: var(--ink); }
.lad-chip.seed { opacity: .65; }
.lad-chip.me { background: var(--ink); color: #fff; }
.lad-chip.more { background: none; color: var(--muted); }
.lad-empty { font-size: 10.5px; color: var(--muted); padding: 3px 0; }

/* ---- 게이트 (인증 전용) ---- */
.gate-points { list-style: none; margin: 4px 0 18px; padding: 0; display: grid; gap: 8px; }
.gate-points li { font-size: 12.5px; color: var(--muted); line-height: 1.5; padding: 8px 11px 8px 24px; position: relative;
  background: rgba(120,140,165,.09); border-radius: 8px; }
.gate-points li::before { content: ''; position: absolute; left: 11px; top: 14px; width: 6px; height: 6px; border-radius: 999px; background: var(--ink); }
.gate-points b { color: var(--ink); }
#enter-verified { width: 100%; border: 0; border-radius: 8px; padding: 14px; font-size: 15px; font-weight: 800;
  background: var(--accent); color: #fff; cursor: pointer; font-family: inherit; }
#enter-verified:hover { filter: brightness(.95); }

/* ---- 홈: 조회수 요약 / 링크 버튼 / 셀렉트 ---- */
.rp-react { margin-top: 12px; font-size: 12px; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-react b { color: var(--ink); }
button.link { border: 0; background: none; color: var(--accent); font-weight: 800; font-size: 12px; cursor: pointer; font-family: inherit; padding: 0; }
.sel { width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); }

/* ---- 피드 ---- */
.fsort { display: flex; gap: 6px; margin-bottom: 10px; }
.fs { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 12px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; font-family: inherit; }
.fs.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.fsearch { display: grid; gap: 8px; margin-bottom: 12px; }
#fq-company { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 13.5px; background: #fff; outline: none; -webkit-user-select: text; user-select: text; }
#fq-company:focus { border-color: var(--accent); }
.fyears { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.fyears::-webkit-scrollbar { display: none; }
.fy { flex-shrink: 0; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.fy.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.fstat { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fstat b { color: var(--ink); font-weight: 800; }
.fstat .link { margin-left: auto; }
.ftop1 { background: #fff; border: 1px solid var(--line); border-left: 3px solid #d97706; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; font-weight: 700; margin-bottom: 10px; color: var(--muted); }
.ftop1 b { color: var(--ink); }
.flist { display: grid; gap: 8px; }
.fcard { display: grid; grid-template-columns: 52px 1fr; gap: 12px; background: #fff; border-radius: 10px; padding: 14px; border: 1px solid rgba(20, 30, 45, 0.08);
  box-shadow: 0 1px 2px rgba(20, 35, 60, 0.04); border-left: 4px solid var(--gc); }
.fcard.me { background: rgba(120, 140, 165, 0.08); }
.fcard { cursor: pointer; }
.fcard:hover { border-color: rgba(20, 30, 45, 0.2); }
.fcard.seed { opacity: .8; }
.fc-left { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--gc); }
.fc-left b { font-size: 34px; line-height: 1; letter-spacing: -1px; }
.fc-left small { font-size: 10px; font-weight: 800; }
.fc-top { display: flex; justify-content: space-between; align-items: baseline; }
.fc-nick { font-weight: 800; font-size: 13.5px; }
.fc-nick em { font-style: normal; font-size: 9.5px; color: #fff; background: var(--ink); border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: 2px; }
.fcard.seed .fc-nick em { background: #94a3b8; }
.fc-pct { font-size: 12px; font-weight: 800; color: var(--muted); }
.fc-pay { font-size: 18px; font-weight: 800; margin: 3px 0 1px; display: flex; align-items: baseline; gap: 8px; }
.fc-growth { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 6px; }
.fc-growth.up { color: #15803d; background: rgba(34,197,94,.12); }
.fc-growth.down { color: #b91c1c; background: rgba(239,68,68,.1); }
.fc-sub { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.fc-views { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; color: var(--muted); white-space: nowrap; }
.fc-views svg { width: 13px; height: 13px; }
.fc-views b { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---- 도전 바: 가기/닫기 버튼 ---- */
.cb-btns { display: flex; gap: 6px; }
.cb-walk { flex: 1; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px;
  padding: 10px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; }
.cb-walk.hidden { display: none; }
#cb-close { margin-left: auto; width: 26px; height: 26px; border-radius: 999px; flex-shrink: 0;
  border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; cursor: pointer; font-family: inherit; }

/* ---- 게이트: 저장된 인증으로 바로 입장 ---- */
#gate-fresh.hidden { display: none; }
#gate.checking { visibility: hidden; } /* 세션 확인 중 — 있으면 바로 홈 */

/* ---- 점령 불꽃 오버레이: 모든 패널 위 ---- */
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }
#fx.hidden { display: none; }


/* ============================================================ 연봉 라이브 (통합 채팅) */
.co { color: var(--muted); }
#live {
  position: fixed; inset: 0; bottom: var(--tab-h); display: grid; grid-template-columns: 320px 1fr;
  background: #f6f5f1;
}
/* 옆 패널: LIVE 헤더 · 등급 분포 · 오늘의 질문 */
.lv-side { display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow-y: auto; border-right: 1px solid var(--line); background: #fff; min-height: 0; }
.lv-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lv-head > b { font-size: 17px; font-weight: 800; letter-spacing: -.4px; }
.lv-on { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 900; letter-spacing: .6px; color: #fff; background: #ef4444; border-radius: 5px; padding: 3px 7px; }
.lv-on i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: lv-blink 1.4s ease-in-out infinite; }
@keyframes lv-blink { 50% { opacity: .25; } }
.lv-count { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--ink); }
.lv-count b { font-weight: 900; }

.lv-dist { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; height: 76px; align-items: end; padding: 6px 2px 0; border-radius: 10px; }
.lv-bar { --gc: #64748b; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; }
.lv-bar-n { font-size: 9.5px; font-weight: 800; color: var(--muted); min-height: 12px; }
.lv-bar-fill { width: 100%; max-width: 22px; border-radius: 4px 4px 2px 2px; background: color-mix(in srgb, var(--gc) 70%, white); transition: height .4s ease; }
.lv-bar-g { font-size: 10px; font-weight: 800; color: var(--gc); }
.lv-bar.me .lv-bar-fill { background: var(--gc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gc) 35%, white); }
.lv-bar.me .lv-bar-g::after { content: ' 나'; color: var(--ink); }

.lv-q { border: 1px solid var(--line); border-radius: 12px; background: #fafaf7; overflow: hidden; }
.lv-q-head { all: unset; box-sizing: border-box; width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 10px 12px; cursor: pointer; font-family: inherit; }
.lv-q-head b { flex: 1 1 100%; font-size: 13.5px; font-weight: 800; line-height: 1.4; }
.lv-q-head small { font-size: 11px; color: var(--muted); font-weight: 700; }
.lv-q-tag { font-size: 10.5px; font-weight: 800; color: var(--accent); }
.lv-q-body { display: none; padding: 0 12px 12px; }
.lv-q.open .lv-q-body { display: block; }
.lv-hint { margin-top: 8px; font-size: 12px; }
/* 선택지 — 한 번 탭하면 투표, 다시 누르면 바꾼다 */
.lv-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.lv-opt { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink); cursor: pointer; }
.lv-opt:hover:not(:disabled) { border-color: #2a78d6; }
.lv-opt.on { background: #1c5cab; border-color: #1c5cab; color: #fff; }
.lv-opt:disabled { cursor: default; color: var(--muted); }
/* 결과 — 등급대별 100% 누적 막대. 칸 사이 2px 흰 틈, 양 끝 4px 둥글게 */
.lv-pres { display: grid; gap: 7px; margin-top: 12px; }
.lv-pr { display: grid; grid-template-columns: 62px 1fr 26px; align-items: center; gap: 8px; font-size: 11.5px; }
.lv-pr-l { font-weight: 700; color: var(--muted); white-space: nowrap; }
.lv-pr-l em { font-style: normal; font-size: 9.5px; color: #fff; background: var(--ink); border-radius: 4px; padding: 0 4px; }
.lv-pr.all .lv-pr-l, .lv-pr.me .lv-pr-l { color: var(--ink); }
.lv-pr-bar { display: flex; gap: 2px; height: 20px; border-radius: 4px; overflow: hidden; }
.lv-pr.all .lv-pr-bar { height: 24px; }
.lv-seg { min-width: 3px; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; white-space: nowrap; overflow: hidden; }
.lv-seg.empty { flex: 1; background: #efeee9; color: var(--muted); font-weight: 600; }
.lv-pr-n { text-align: right; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.lv-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 10px; font-size: 11px; color: var(--muted); font-weight: 600; }
.lv-legend span { display: inline-flex; align-items: center; gap: 4px; }
.lv-legend i { width: 10px; height: 10px; border-radius: 3px; }

/* 등급 뱃지 — 채팅 공용 */
.lv-g { flex-shrink: 0; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 900; color: #fff; background: var(--gc, #64748b); border-radius: 5px; padding: 0 4px; vertical-align: 1px; }

/* 대화 */
.lv-chat { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.lv-msgs { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 7px; min-height: 0; -webkit-user-select: text; user-select: text; }
.lv-m { font-size: 13.5px; line-height: 1.55; word-break: break-word; }
.lv-m > * + * { margin-left: 5px; }
.lv-m.sys { text-align: center; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.lv-m.typing { color: var(--muted); font-size: 12px; }
.lv-m.mine { background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 8px; margin: 0 -6px; padding: 2px 6px; }
.lv-who { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; color: var(--ink); display: inline; }
.lv-who em { margin-left: 4px; }
.lv-who b { font-weight: 800; color: color-mix(in srgb, var(--gc) 75%, var(--ink)); }
.lv-who:hover b { text-decoration: underline; }
.lv-who em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--muted); }
.lv-m.mine .lv-who b { color: var(--accent); }
.lv-m small { float: right; margin-left: 8px; font-size: 10px; line-height: 21px; color: var(--muted); }
.lv-m .ai { font-style: normal; font-size: 9px; font-weight: 800; color: var(--muted); background: rgba(120,140,165,.18); border-radius: 3px; padding: 1px 4px; }
.lv-new { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); border: 0; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 12px; font-weight: 800; background: var(--ink); color: #fff; box-shadow: 0 4px 14px rgba(20,35,60,.25); cursor: pointer; z-index: 2; }
.lv-new.hidden, .lv-up.hidden, .lv-input.hidden { display: none; }
.lv-up { margin: 8px 16px 12px; border: 0; border-radius: 10px; padding: 13px; font: inherit; font-size: 14px; font-weight: 800; background: var(--accent); color: #fff; cursor: pointer; }
.lv-input { display: flex; gap: 6px; padding: 10px 16px 12px; border-top: 1px solid var(--line); background: #fff; }
.lv-input input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; font-size: 14px; font-family: inherit; outline: none; background: #f6f5f1; }
.lv-input input:focus { border-color: var(--accent); background: #fff; }
.lv-input button { border: 0; border-radius: 999px; padding: 0 16px; font-weight: 800; font-size: 13px; background: var(--accent); color: #fff; cursor: pointer; font-family: inherit; }

/* 탭바 '라이브' 안 읽은 수 */
.tb { position: relative; }
.tb-badge { display: none; position: absolute; top: 5px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-style: normal; font-size: 9.5px; font-weight: 800; align-items: center; justify-content: center; }
.tb-badge.on { display: flex; }

/* 데스크톱: 오른쪽 위 접속자 패널(#side)에 대화가 가리지 않게 */
@media (min-width: 721px) {
  .lv-msgs { padding-right: 266px; }
  #hud { z-index: 3; }
}
/* 모바일: 한 줄 — 헤더·분포·접힌 질문이 위, 대화가 아래 */
@media (max-width: 720px) {
  #live { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .lv-side { gap: 8px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .lv-head { padding-right: 96px; } /* 접속자 버튼(#players-fab) 자리 */
  .lv-count { display: none; }     /* 인원수는 접속자 버튼에 이미 있다 */
  .lv-dist { height: 46px; padding-top: 0; }
  .lv-bar-n { display: none; }
  .lv-q-head { padding: 8px 10px; }
  .lv-q-head b { flex-basis: auto; font-size: 12.5px; }
  .lv-q.open .lv-q-body { max-height: 34vh; overflow-y: auto; }
  .lv-msgs { padding: 10px 12px; }
  #lounge #players-fab { top: 10px; }
}

.my-toggles { display: flex; gap: 6px; margin-top: 8px; }

/* 게이트: 인증 없이 구경 */
#enter-guest { width: 100%; margin-top: 8px; border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 8px; padding: 11px; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }

/* 구경꾼용 예시 명함 */
.card-lock { background: #fff7ed; border: 1px solid rgba(249,115,22,.35); border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.5; margin-bottom: 12px; }
.card-lock b { display: block; color: #c2410c; }
.card-lock button { margin-top: 8px; width: 100%; border: 0; border-radius: 8px; padding: 10px; font-size: 13px; font-weight: 800; background: var(--accent); color: #fff; cursor: pointer; font-family: inherit; }
.card-head.sample { position: relative; }
.card-head.sample::after { content: '예시'; position: absolute; right: 0; top: 0; font-size: 10px; font-weight: 800; color: var(--muted); background: rgba(120,140,165,.14); border-radius: 4px; padding: 2px 6px; }

/* 피드 올리기 */
.fpost { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.fpost.on { border-left: 3px solid #16a34a; }
.fpost span { flex: 1; }
.fpost button { border: 0; border-radius: 6px; padding: 8px 12px; font-size: 12px; font-weight: 800; background: var(--ink); color: #fff; cursor: pointer; font-family: inherit; white-space: nowrap; }
.fpost.on button { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.rp-actions .sec.on { border-color: #16a34a; color: #15803d; }

/* PWA 카드 */
.pwa-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; font-size: 12px; }
.pwa-row button { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 12.5px; font-weight: 800; cursor: pointer; font-family: inherit; background: #fff; color: var(--ink); }
.pwa-row button.pri { background: var(--ink); color: #fff; border-color: var(--ink); }
.pwa-row button.on { border-color: #16a34a; color: #15803d; }
.pwa-ok { font-size: 12px; font-weight: 800; color: #15803d; }
