/* ============================================================
   퀘스트 "제출 아이템" 탭 (quests.html #view=items · js/quest-items.js, 2026-10-05)
   style.css 와 따로 둔다 (퀘스트 페이지를 여러 세션이 같이 고치므로)
   ============================================================ */

.qi-toolbar { flex-wrap: wrap; }
.qi-toolbar #qi-search { flex: 1 1 220px; }
.qi-opts { gap: 6px 16px; margin-top: -6px; }
.qi-summary {
  margin: 4px 0 14px; padding: 10px 14px; border: 1px solid var(--border); border-left: 3px solid var(--tan);
  background: var(--panel); border-radius: var(--radius); font-size: 0.92rem;
}
.qi-summary b { color: var(--tan-bright); }
.qi-money { margin-top: 4px; color: var(--muted); font-size: 0.84rem; }
.qi-money b { color: var(--gold); font-family: var(--font-mono); }
.qi-hint { color: var(--muted); font-size: 0.82rem; margin-left: 4px; }
.qi-empty { color: var(--muted); padding: 24px 0; text-align: center; }
.qi-foot { color: var(--muted); font-size: 0.78rem; margin-top: 14px; line-height: 1.6; }

/* 아이템별 카드 */
.qi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.qi-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.qi-card.is-quest-item { border-style: dashed; }
.qi-card-head { display: flex; align-items: center; gap: 10px; }
.qi-icon {
  width: 52px; height: 52px; object-fit: contain; flex-shrink: 0;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border-strong); border-radius: 3px;
}
.qi-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qi-name strong { color: var(--text-strong); font-size: 0.98rem; line-height: 1.3; overflow-wrap: anywhere; }
.qi-en { color: var(--muted); font-size: 0.74rem; font-family: var(--font-mono); overflow-wrap: anywhere; }
.qi-name .badge { align-self: flex-start; }
.qi-total { font-family: var(--font-head); font-size: 1.7rem; color: var(--tan-bright); line-height: 1; white-space: nowrap; }
.qi-split { display: flex; gap: 6px; flex-wrap: wrap; font-size: 0.76rem; }
.qi-split span { padding: 1px 8px; border-radius: 10px; border: 1px solid var(--border-strong); }
.qi-fir { color: var(--gold); border-color: rgba(212, 180, 106, 0.5) !important; }
.qi-plain { color: var(--muted); }
.qi-quests { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; border-top: 1px solid var(--border); padding-top: 7px; }
.qi-quests li { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 0.84rem; }
.qi-cnt { margin-left: auto; color: var(--text-strong); font-family: var(--font-mono); white-space: nowrap; }
.qi-f {
  display: inline-block; padding: 0 5px; border-radius: 3px; font-size: 0.68rem; font-family: var(--font-mono);
  color: #1a1a16; background: var(--gold); vertical-align: 1px;
}
.qi-cond { color: var(--muted); font-size: 0.74rem; }
.qi-qlink {
  display: inline-flex; align-items: center; gap: 5px; padding: 0; border: none; background: none;
  color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0;
}
.qi-qlink:hover { color: var(--tan-bright); text-decoration: underline; }
.qi-trader { color: var(--muted); font-size: 0.78em; }
.qi-k { color: var(--gold); font-weight: 700; }
.qi-alts summary { cursor: pointer; color: var(--muted); font-size: 0.78rem; }
.qi-alt-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; max-height: 180px; overflow-y: auto; }
.qi-alt {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 2px 2px; font-size: 0.74rem;
  border: 1px solid var(--border); border-radius: 3px; background: var(--bg-alt);
}
.qi-alt img { width: 22px; height: 22px; object-fit: contain; }

/* 퀘스트별 */
.qi-qrow { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); margin-bottom: 8px; }
.qi-qrow.is-done { opacity: 0.55; }
.qi-qrow-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.qi-lv { margin-left: auto; color: var(--muted); font-family: var(--font-mono); font-size: 0.78rem; }
.qi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qi-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; font-size: 0.84rem;
  border: 1px solid var(--border-strong); border-radius: 3px; background: var(--bg-alt);
}
.qi-chip.is-quest-item { border-style: dashed; }
.qi-chip img { width: 34px; height: 34px; object-fit: contain; background: rgba(0, 0, 0, 0.3); border-radius: 2px; }
.qi-chip b { color: var(--tan-bright); font-family: var(--font-mono); }

@media (max-width: 560px) {
  .qi-grid { grid-template-columns: 1fr; }
  .qi-total { font-size: 1.4rem; }
}

/* ---------- 상인 레벨별 (2026-10-06) ---------- */
.qi-ll-trader { margin-bottom: 18px; }
.qi-ll-trader h3 {
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-strong);
  color: var(--tan-bright);
  font-family: var(--font-head);
  letter-spacing: 0.06em;
}
.qi-ll {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.qi-ll-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 8px; }
.qi-ll-badge {
  padding: 1px 8px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #14140f;
  background: var(--tan);
}
.qi-ll-badge.ll2 { background: var(--green); }
.qi-ll-badge.ll3 { background: var(--blue); }
.qi-ll-badge.ll4 { background: var(--gold); }
.qi-ll-cond { color: var(--text); font-size: 0.85rem; }
.qi-ll-sum { color: var(--muted); font-size: 0.8rem; margin-left: auto; }
.qi-ll-chip { cursor: help; }
.qi-ll-quests { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 8px; font-size: 0.82rem; }

/* 리뉴얼 (css/renewal.css 와 짝) — quests.html 전용. 레거시에는 영향 없음.
   한글이 섞인 라벨은 고정폭 글꼴 대신 본문 글꼴, 각진 칩은 둥글게, 옛 황토색은 노랑으로 */
html[data-design="renewal"] .quest-progress,
html[data-design="renewal"] .tree-legend,
html[data-design="renewal"] .tree-count,
html[data-design="renewal"] .qt-sum,
html[data-design="renewal"] .qt-link,
html[data-design="renewal"] .qt-lock,
html[data-design="renewal"] .qt-fold,
html[data-design="renewal"] .qt-ghost span,
html[data-design="renewal"] .qt-focus-tag,
html[data-design="renewal"] .qt-focus-stat,
html[data-design="renewal"] .qt-fcap,
html[data-design="renewal"] .qt-fmore,
html[data-design="renewal"] .qt-fchip em,
html[data-design="renewal"] .qt-fdetail > summary,
html[data-design="renewal"] .quest-record-head,
html[data-design="renewal"] .qr-src,
html[data-design="renewal"] .mm-root span,
html[data-design="renewal"] .mm-name em,
html[data-design="renewal"] .qi-en,
html[data-design="renewal"] .ki-en,
html[data-design="renewal"] .ki-tag {
  font-family: var(--font-body); letter-spacing: 0; text-transform: none;
}
html[data-design="renewal"] .quest-progress strong { font-family: var(--font-mono); }
html[data-design="renewal"] .tree-legend { border-left-width: 1px; border-radius: var(--radius); background: var(--panel); font-size: 0.82rem; }
html[data-design="renewal"] .qt-trader summary,
html[data-design="renewal"] .qt-focus-head strong,
html[data-design="renewal"] .mm-root b,
html[data-design="renewal"] .qi-ll-trader h3,
html[data-design="renewal"] .kappa-subhead,
html[data-design="renewal"] tr.kappa-tier-row td { letter-spacing: 0; text-transform: none; }
html[data-design="renewal"] .qt-row,
html[data-design="renewal"] .qt-link,
html[data-design="renewal"] .qt-ghost,
html[data-design="renewal"] .qt-fold,
html[data-design="renewal"] .qt-fcol,
html[data-design="renewal"] .qt-fchip,
html[data-design="renewal"] .qt-bar,
html[data-design="renewal"] .kappa-chip,
html[data-design="renewal"] .qimg-row img,
html[data-design="renewal"] .qi-chip img { border-radius: 6px; }
html[data-design="renewal"] .qt-focus-tag { border-radius: 6px; font-weight: 700; color: #111; }
html[data-design="renewal"] .qt-focus { border-color: var(--border); border-left: 3px solid var(--tan); border-radius: var(--radius); background: var(--panel); }
html[data-design="renewal"] .qt-fcol { border-style: solid; }
html[data-design="renewal"] .qt-fcol.target { background: var(--bg-alt); } /* sticky 라 불투명해야 뒤 칸이 비치지 않는다 */
html[data-design="renewal"] .qt-row.is-focus { background: rgba(242, 207, 74, 0.08); }
html[data-design="renewal"] .qt-fchip.target { background: rgba(242, 207, 74, 0.12); }
html[data-design="renewal"] .quest-record { border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--radius); background: rgba(255, 255, 255, 0.02); }
html[data-design="renewal"] .quest-record-head { font-weight: 700; font-size: 0.82rem; }
/* 퀘스트 상세의 "참고"는 실제 내용 — renewal.css 의 .qr-note 숨김에서 되살린다 */
html[data-design="renewal"] .quest-record .qr-note { display: block !important; }
html[data-design="renewal"] .quest-objectives li::before { content: "• "; }
html[data-design="renewal"] .kappa-bar { height: 8px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
html[data-design="renewal"] .kappa-bar-fill { background: var(--tan); border-radius: 999px; }
html[data-design="renewal"] .mm-view {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 1px, transparent 1.5px) 0 0 / 22px 22px, var(--bg-alt);
}
/* 좁은 화면 — 보기 탭 5개가 글자 단위로 꺾이지 않게 가로 스크롤 */
@media (max-width: 600px) {
  html[data-design="renewal"] #quest-view { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  html[data-design="renewal"] #quest-view button { flex: 0 0 auto; white-space: nowrap; padding: 7px 12px; }
}
