/* 상점 화면(결정 BA1~BA5, 2026-09-28) — screens_shop.js 전용. 공통 토큰만 쓴다(다크·라이트 자동, --phos 안 씀: 결정 AQ1).
   그림자 없음(D1), 주 버튼 없음(줄마다 같은 행동이라 모두 보조 — D3 화면당 1개 원칙). 좁은 화면 가로 넘침 0.
   결정 CN·CQ·CR(갈래 C, 2026-09-30): 옛 직각 → 모서리 16·8·3, 칸 바탕 없음, 목록 줄 사이 가는 줄(--rule), 왼쪽 색 띠 → 외곽선·글자 색(CR15), 입력 칸 모서리 8. */
.tw-sh { display: grid; gap: var(--sp-4); min-width: 0; }
.tw-sh-top, .tw-sh-main { min-width: 0; }

/* BA1 골드 카드 + 가격 내역 */
.tw-sh-gold { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px var(--sp-3); padding: var(--sp-2) var(--sp-4) var(--sp-3); border: var(--bw) solid var(--gold); border-radius: var(--radius); background: transparent; min-width: 0; }
.tw-sh-gold__label { grid-column: 1 / -1; font-size: var(--fs-card); font-weight: var(--fw-card); letter-spacing: var(--ls-card); color: var(--muted); }
.tw-sh-gold__num { font-size: var(--fs-bignum); line-height: var(--lh-tight); font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-width: 0; color: var(--gold); }
.tw-sh-gold__delta { font-size: var(--fs-body); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; padding: 2px var(--sp-2); border: var(--bw) solid; border-radius: var(--radius-chip); }
.tw-sh-gold__delta.is-minus { color: var(--bad); border-color: var(--edge-bad); }
.tw-sh-gold__delta.is-plus { color: var(--ok); border-color: var(--edge-ok); }
.tw-sh-gold.is-flash { box-shadow: inset 0 0 0 1px var(--gold); }
.tw-sh-gold__bank { grid-column: 1 / -1; font-size: var(--fs-cap); color: var(--muted); font-variant-numeric: tabular-nums; }   /* 결정 CL6: 은행 골드(모자라면 자동으로 함께 씀) — 모양은 CN 뒤 */
@media (max-width: 420px) { .tw-sh-gold__num { font-size: var(--fs-title); } }
.tw-sh-line { font-size: var(--fs-sub); color: var(--fg); line-height: var(--lh-base); overflow-wrap: anywhere; }
.tw-sh-line__k { color: var(--muted); font-weight: 700; margin-right: var(--sp-1); }
.tw-sh-out:empty { display: none; }
.tw-sh-result { font-size: var(--fs-sub); line-height: var(--lh-base); padding: var(--sp-2) var(--sp-3); border: var(--bw) solid var(--ok); border-radius: var(--radius-sm); background: transparent; overflow-wrap: anywhere; }   /* 결정 CN: 왼쪽 4px 띠 → 녹색 외곽선(성공 결과) */
.tw-sh-result b { color: var(--ok); margin-right: var(--sp-1); }

/* BA2 전환·종류·도구 */
.tw-sh-mode { margin-bottom: 2px; }
.tw-sh-mode small { font-size: var(--fs-cap); opacity: .8; }
.tw-sh-pane { display: grid; gap: var(--sp-2); min-width: 0; }
.tw-sh-tools { display: grid; gap: var(--sp-2); min-width: 0; }
.tw-sh-tools > *, .tw-sh-pane > * { min-width: 0; }   /* 정렬 알약 줄(가로 이동)이 칸을 밀어 360px에서 넘치지 않게 */
.tw-sh-search { font: inherit; font-size: var(--fs-body); width: 100%; min-height: 44px; padding: var(--sp-2) var(--sp-3); border: var(--bw) solid var(--line-strong); background: transparent; color: var(--fg-2); border-radius: var(--radius-btn); min-width: 0; }
.tw-sh-search:focus { border-color: var(--accent); outline: 0; }
/* 검토(2026-09-28 시인성): 공통 .tw-filters는 가로 이동 + 스크롤바 숨김이라 360~375px에서 마지막 정렬 알약('속성')이 잘려 보이고 더 있다는 단서가 없다 → 상점 정렬 줄은 줄바꿈 */
.tw-sh-sorts { flex-wrap: wrap; overflow-x: visible; }
.tw-sh-sorts > button { min-height: 36px; }
.tw-sh-note { display: grid; gap: var(--sp-2); min-width: 0; }
.tw-sh-note:empty { display: none; }
.tw-sh-count { font-size: var(--fs-cap); color: var(--muted); }
.tw-sh-count:empty { display: none; }

/* BA3·BA4 목록 줄 */
.tw-sh-list { list-style: none; margin: 0; padding: 0; border-top: var(--bw) solid var(--rule); min-width: 0; }
.tw-sh-row { display: grid; gap: var(--sp-2); padding: var(--sp-3) 2px; border-bottom: var(--bw) solid var(--rule); min-width: 0; }
.tw-sh-row:last-child { border-bottom: 0; }
.tw-sh-row.is-off .tw-sh-row__head { opacity: .72; }
.tw-sh-row__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--sp-1) var(--sp-3); min-width: 0; }
.tw-sh-row__head > .tw-eqi { grid-column: 1; }
.tw-sh-row__head > .tw-sh-row__name:nth-child(1) { grid-column: 1 / 3; }
.tw-sh-row__name { display: grid; gap: 2px; min-width: 0; font-size: var(--fs-body); overflow-wrap: anywhere; }
.tw-sh-name { font-weight: 700; }
.tw-sh-gname, .tw-sh-sub { font-size: var(--fs-cap); color: var(--muted); }
.tw-sh-open { font: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; color: inherit; text-decoration: none; }
.tw-sh-open:hover { color: var(--accent); }
.tw-sh-price { display: grid; justify-items: end; gap: 1px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tw-sh-base { color: var(--faint); font-size: var(--fs-cap); }
.tw-sh-final { color: var(--fg-2); font-size: var(--fs-body); }
.tw-sh-price small { font-size: var(--fs-cap); color: var(--muted); }
.tw-sh-stats { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); min-width: 0; }
.tw-sh-stat { display: inline-flex; align-items: baseline; gap: 3px; font-size: var(--fs-cap); padding: 2px var(--sp-2); border: var(--bw) solid var(--line-strong); border-radius: var(--radius-chip); background: transparent; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tw-sh-stat__k { color: var(--muted); }
.tw-sh-stat b { color: var(--fg-2); }
.tw-sh-up { color: var(--ok); font-weight: 700; }
.tw-sh-down { color: var(--bad); font-weight: 700; }
.tw-sh-up .tw-li, .tw-sh-down .tw-li { vertical-align: -.15em; }   /* 결정 BS4: 옛 ▲▼ 글자 → 선 아이콘 */
.tw-sh-sorts > button .tw-li { margin-left: 2px; }                  /* 정렬 방향(옛 ↑↓) */
.tw-sh-same { color: var(--muted); }
.tw-sh-cmp { font-size: var(--fs-cap); color: var(--muted); overflow-wrap: anywhere; }
.tw-sh-cmp .tw-grade { font-size: var(--fs-cap); }
.tw-sh-desc { font-size: var(--fs-cap); color: var(--muted); line-height: var(--lh-base); overflow-wrap: anywhere; }
.tw-sh-warn { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: var(--fs-cap); color: var(--warn); line-height: var(--lh-base); }
.tw-sh-act { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-2) var(--sp-3); min-width: 0; }
.tw-sh-btn { min-height: 44px; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sub); }
.tw-sh-why { flex-basis: 100%; text-align: right; }
.tw-sh-why[hidden] { display: none; }
.tw-sh-qty { display: inline-flex; align-items: stretch; }
.tw-sh-qty .tw-btn { min-height: 44px; min-width: 44px; padding: 0 var(--sp-2); font-size: var(--fs-strong); font-weight: 700; display: inline-grid; place-items: center; }   /* −/+ = 선 아이콘 */
.tw-sh-qty input { font: inherit; font-size: var(--fs-body); width: 4.5em; min-height: 44px; text-align: center; border: var(--bw) solid var(--line-strong); border-left: 0; border-right: 0; background: transparent; color: var(--fg-2); border-radius: 0; -moz-appearance: textfield; }
.tw-sh-qty .tw-btn:first-child { border-radius: var(--radius-btn) 0 0 var(--radius-btn); } .tw-sh-qty .tw-btn:last-child { border-radius: 0 var(--radius-btn) var(--radius-btn) 0; }   /* − 수량 + 한 덩어리(가운데 칸만 직각) */
.tw-sh-qty input::-webkit-outer-spin-button, .tw-sh-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tw-sh-qty input:focus { outline: 2px solid var(--focus); outline-offset: -2px; }
.tw-sh-sum { font-size: var(--fs-sub); font-weight: 700; color: var(--fg-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tw-sh-detail { border: var(--bw) solid var(--line); border-radius: var(--radius-sm); background: transparent; padding: var(--sp-3); display: grid; gap: var(--sp-2); min-width: 0; overflow-wrap: anywhere; }
.tw-sh-detail[hidden] { display: none; }
.tw-sh-empty { list-style: none; }
/* 결정 BS② 2단계: '상점 규칙' 접힘 상자(.tw-sh-rules)는 제목 옆 ⓘ로 옮겨 지웠다 */

@media (max-width: 420px) {
  .tw-sh-act { justify-content: flex-start; }
  .tw-sh-why { text-align: left; }
  .tw-sh-act .tw-sh-btn { margin-left: auto; }
}
@media (min-width: 600px) {
  .tw-sh-tools { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
}
