/* 시전(市廛) 거래소 (public/js/market.js)
   그림: 운종가 시전 행랑의 기와 처마 밑, 반닫이 나무 판에 풀칠한 한지 장부. 줄마다 붉은 괘선(罫線), 값은 엽전(네모 구멍) 그림.
   탭은 매단 나무 패(買·賣·帳·函), 성사하면 붉은 도장이 찍힌다. 등급색은 어두운 바탕용이라 장부 위에서는 먹빛으로 낮춘다. */

#panel-market { left: 50%; top: 48px; transform: translateX(-50%); width: 760px; max-width: calc(100vw - 16px); height: min(660px, calc(100vh - 150px)); min-height: 380px;
  padding: 0; overflow: visible; display: flex; flex-direction: column; color: var(--ink); }
#panel-market.hidden { display: none !important; }

/* 기와 처마 (줄기와 + 막새) */
.mk-eave { flex: none; height: 26px; margin: 0 -18px -3px; position: relative; z-index: 1;
  background: repeating-linear-gradient(90deg, #2a2826 0 10px, #4a4540 10px 12px, #201e1d 12px 20px), #2a2826;
  clip-path: polygon(0 100%, 3% 22%, 10% 0, 90% 0, 97% 22%, 100% 100%); box-shadow: 0 3px 0 #120c08; }
.mk-eave::after { content: ''; position: absolute; left: 2.5%; right: 2.5%; bottom: 0; height: 7px;
  background: radial-gradient(circle at 50% 30%, #77706a 0 3px, #3c3834 3.5px 5px, transparent 5.5px) 0 0 / 20px 7px repeat-x; }
/* 처마에 매단 상호 깃 (시전 표시) */
.mk-eave i { position: absolute; right: 9%; top: 18px; width: 22px; height: 44px; z-index: 2;
  background: linear-gradient(#8e2a22, #6e1a14); clip-path: polygon(0 0, 100% 0, 100% 86%, 50% 100%, 0 86%); box-shadow: inset 0 0 0 2px rgba(255,210,180,0.25); }
.mk-eave i::after { content: '市'; position: absolute; left: 0; right: 0; top: 7px; text-align: center; font: 400 15px var(--title); color: #f4dcc4; }

.mk-sheet { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative;
  border: 16px solid transparent; border-image: url("../ui/frame_bandaji.png") 58 stretch;
  background: url("../ui/tex_hanji.png") center / 340px, #e6d8b8; background-clip: padding-box;
  padding: 8px 12px 6px; box-shadow: 0 14px 44px rgba(0,0,0,0.75), inset 0 0 26px rgba(120,84,40,0.35); }

/* 머리 */
.mk-head { display: flex; align-items: center; gap: 10px; padding: 0 0 6px; border-bottom: 2px solid rgba(60,36,20,0.6); }
.mk-seal { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font: 400 32px/1 var(--title);
  color: #f6e0c8; background: #9a2a1e; border: 2px solid #5e140d; border-radius: 3px; transform: rotate(-3deg);
  box-shadow: inset 0 0 0 2px rgba(255,214,186,0.35), 1px 1px 0 rgba(0,0,0,0.25); }
.mk-ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mk-name { font: 400 23px/1.1 var(--title); letter-spacing: 6px; color: #2a1a10; }
.mk-line { font-size: 12.5px; color: var(--ink2); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mk-purse { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 7px; border-radius: 14px;
  background: url("../ui/tex_bandaji.png") center / 160px, #3a2416; color: #ffe2a0; font: 400 16px var(--title); letter-spacing: 1px;
  box-shadow: inset 0 0 0 1px rgba(201,162,79,0.55), 0 1px 2px rgba(0,0,0,0.4); font-variant-numeric: tabular-nums; }
.mk-x { align-self: flex-start; background: none; border: none; color: var(--ink2); font-size: 17px; padding: 2px 4px; }
.mk-x:hover { color: var(--red); }

/* 엽전: 둥근 놋쇠에 네모 구멍 */
.mk-coin { display: inline-block; flex: none; position: relative; width: 15px; height: 15px; border-radius: 50%; vertical-align: -2px;
  background: radial-gradient(circle at 34% 30%, #f8e29a, #c79a3a 52%, #7a5418 92%); box-shadow: 0 0 0 1px rgba(60,36,10,0.65), inset 0 0 0 2px rgba(110,74,20,0.45); }
.mk-coin::after { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: #2a1a0e; box-shadow: 0 0 0 1px rgba(250,220,150,0.5); }
.mk-coin.big { width: 30px; height: 30px; }
.mk-coin.big::after { width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; }

/* 탭: 매단 나무 패 */
.mk-tabs { display: flex; gap: 6px; margin: 8px 0 6px; flex-wrap: wrap; }
.mk-tabs button { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 3px 14px 3px 7px; font: 400 15px var(--title); letter-spacing: 2px;
  color: #e0c890; background: url("../ui/tex_bandaji.png") center / 200px, #3a2416; border: 1px solid #1a0e08; border-radius: 2px 2px 0 0;
  box-shadow: inset 0 0 0 1px rgba(201,162,79,0.35), 0 2px 3px rgba(0,0,0,0.35); filter: brightness(0.72); touch-action: manipulation; }
.mk-tabs button i { font-style: normal; font-size: 13px; padding: 1px 3px; line-height: 1.15; color: #2a0806; background: #b8944a; border-radius: 2px; }
.mk-tabs button.on { filter: none; color: #ffe2a0; box-shadow: inset 0 0 0 1px #c9a24f, 0 0 0 1px #2a0806, 0 3px 5px rgba(0,0,0,0.45); }
.mk-tabs button.on i { background: #d8b45a; }
.mk-tabs em { font: 400 11px var(--font); font-style: normal; color: #d8c290; letter-spacing: 0; }
.mk-tabs em:empty { display: none; }
.mk-tabs em.hot { min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #a3281c; color: #fbe6cc; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1px #4a0e08; }

.mk-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mk-page.hidden { display: none; }
.mk-sub { display: flex; align-items: baseline; gap: 8px; font: 400 15px var(--title); color: #7a1a12; letter-spacing: 2px; margin: 4px 0 3px; }
.mk-sub small { font: 400 11.5px var(--font); color: var(--ink2); letter-spacing: 0; }
.mk-sub button { margin-left: auto; }
.mk-dim { color: #7a6448; }

/* 찾기 줄 · 거르개 */
.mk-search { display: flex; gap: 6px; align-items: center; }
.mk-search input, .mk-range input, .mk-range select, .mk-search select, .mk-form input { font: 14px var(--font); color: var(--ink); background: rgba(255,250,236,0.6);
  border: 1px solid rgba(90,60,30,0.45); border-radius: 2px; padding: 4px 7px; min-height: 30px; box-sizing: border-box; box-shadow: inset 0 1px 2px rgba(80,50,20,0.18); }
.mk-search input:focus, .mk-range input:focus, .mk-form input:focus { outline: none; border-color: var(--red); background: rgba(255,252,242,0.9); }
.mk-q { flex: 1; min-width: 0; }
.mk-ftog { display: none; }
.mk-filters { margin: 5px 0 4px; display: flex; flex-direction: column; gap: 4px; }
.mk-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.mk-chips button { min-height: 26px; padding: 1px 8px; font-size: 12.5px; color: var(--ink2); background: rgba(255,250,236,0.35);
  border: 1px solid rgba(90,60,30,0.32); border-radius: 2px; touch-action: manipulation; display: inline-flex; align-items: center; gap: 4px; }
.mk-chips button:hover { background: rgba(142,42,34,0.08); }
.mk-chips button.on { color: #fbe9cf; background: #7a2218; border-color: #4a0e08; }
.mk-grades button s { width: 8px; height: 8px; border-radius: 50%; background: var(--gc); box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }
.mk-grades button.on { background: var(--gc); border-color: rgba(0,0,0,0.5); }
.mk-grades button.on s { background: #fbe9cf; }
.mk-range { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 12.5px; color: var(--ink2); }
.mk-range label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.mk-range input[type=number] { width: 70px; min-height: 26px; padding: 2px 5px; font-size: 13px; }
.mk-range .mk-lmin, .mk-range .mk-lmax { width: 48px; }
.mk-range select { min-height: 26px; padding: 1px 4px; font-size: 13px; }
.mk-chk input { accent-color: #8e2a22; }

/* 장부 줄 */
.mk-rows { flex: 1; min-height: 60px; overflow-y: auto; overscroll-behavior: contain; position: relative;
  border-top: 1px solid rgba(142,42,34,0.55); border-bottom: 1px solid rgba(142,42,34,0.55);
  background: linear-gradient(90deg, transparent 57px, rgba(142,42,34,0.35) 57px 58px, transparent 58px); transition: opacity 0.15s; }
.mk-rows.wait { opacity: 0.55; }
.mk-page[data-p="mine"] .mk-rows { flex: 1 1 40%; }
.mk-row { display: grid; grid-template-columns: 50px 1fr auto auto; align-items: center; gap: 4px 10px; padding: 4px 6px 4px 3px; min-height: 52px;
  border-bottom: 1px solid rgba(142,42,34,0.22); }
.mk-row:nth-child(odd) { background: rgba(255,248,228,0.28); }
.mk-row:hover { background: rgba(255,240,200,0.55); }
.mk-row.done { opacity: 0.78; }
.mk-row.poor .mk-pr b { color: #a03a2a; }
.mk-ic { position: relative; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  background: rgba(16,10,6,0.9); border: 1px solid #b08a48; box-shadow: inset 0 0 8px #000; cursor: help; }
.mk-ic img { max-width: 42px; max-height: 42px; object-fit: contain; pointer-events: none; }
.mk-ic.coin { background: none; border: none; box-shadow: none; cursor: default; }
.mk-ic.g-sang, .mk-bi.g-sang { background-color: rgba(40,60,140,0.6); } .mk-ic.g-jin, .mk-bi.g-jin { background-color: rgba(150,130,30,0.55); }
.mk-ic.g-myeong, .mk-bi.g-myeong { background-color: rgba(150,90,20,0.65); } .mk-ic.g-beol, .mk-bi.g-beol { background-color: rgba(40,130,50,0.6); }
.mk-ic.g-gak, .mk-bi.g-gak { background-color: rgba(110,40,120,0.6); } .mk-ic.g-hon, .mk-bi.g-hon { background-color: rgba(150,60,20,0.5); }
.mk-ic.g-gem, .mk-bi.g-gem { background-color: rgba(20,100,110,0.5); }
.mk-ic.unid img, .mk-bi.unid img { filter: saturate(0.3) brightness(0.8); }
.mk-n { position: absolute; right: 2px; bottom: 0; font: 700 12px var(--font); color: #ffe8b0; text-shadow: 0 0 2px #000, 1px 1px 0 #000; pointer-events: none; }
.mk-nm { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.mk-nm b { font: 400 16px var(--title); letter-spacing: 0.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-nm b em { font: 700 12px var(--font); font-style: normal; color: var(--ink2); }
.mk-nm small { font-size: 12px; color: #6a5438; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-no { color: #b0301e; }
.mk-who { color: #4a3a2a; }
.mk-pr { text-align: right; display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.mk-pr span { display: inline-flex; align-items: center; gap: 5px; }
.mk-pr b { font: 400 18px var(--title); color: #2a1a10; letter-spacing: 0.5px; }
.mk-pr small { font-size: 11px; color: #7a6448; }
.mk-act { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; min-width: 76px; justify-content: center; padding: 3px 10px 3px 6px;
  font: 400 14px var(--title); letter-spacing: 1px; color: #fbe9cf; background: #8e2a22; border: 1px solid #3a120c; border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255,200,170,0.25), 0 2px 3px rgba(0,0,0,0.3); touch-action: manipulation; white-space: nowrap; }
.mk-act i { font-style: normal; font-size: 12px; padding: 1px 3px; line-height: 1.1; color: #8e2a22; background: #f2dcc0; border-radius: 2px; }
.mk-act:hover:not(:disabled) { background: #a3332a; }
.mk-act:disabled { filter: grayscale(0.7) brightness(0.9); opacity: 0.6; }
.mk-act.ghost { color: #4a2a1a; background: rgba(255,250,236,0.5); border-color: rgba(90,60,30,0.5); box-shadow: none; }
.mk-act.ghost i { color: #f2dcc0; background: #6a4a2a; }
.mk-act.armed { background: #c0461e; animation: mk-pulse 0.9s ease-in-out infinite; }
.mk-act.ghost.armed { color: #fbe9cf; background: #8e2a22; }
@keyframes mk-pulse { 50% { box-shadow: 0 0 0 3px rgba(192,70,30,0.35), inset 0 0 0 1px rgba(255,200,170,0.4); } }
.mk-empty { padding: 26px 16px; text-align: center; color: #7a6448; font-size: 14px; line-height: 1.6; }
.mk-pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 4px 0 0; font-size: 12.5px; color: var(--ink2); }
.mk-pager button, .mk-sub button { min-height: 28px; padding: 2px 10px; font: 13px var(--font); color: var(--ink2); background: rgba(255,250,236,0.45);
  border: 1px solid rgba(90,60,30,0.4); border-radius: 2px; touch-action: manipulation; }
.mk-pager button:disabled, .mk-sub button:disabled { opacity: 0.4; }
.mk-sub .mk-all { color: #fbe9cf; background: #8e2a22; border-color: #3a120c; font-family: var(--title); letter-spacing: 1px; }

/* 팔기 */
.mk-sell { flex: 1; min-height: 0; display: flex; gap: 14px; align-items: flex-start; overflow-y: auto; }
.mk-bagbox { flex: none; padding: 4px 8px 8px; border: 1px solid #6d5636; background: url("../ui/tex_bandaji.png") center / 300px, #3a2416; color: #ecdcb6;
  box-shadow: 0 3px 8px rgba(0,0,0,0.35); }
.mk-bagbox .mk-sub { color: #f0c870; } .mk-bagbox .mk-sub small { color: #c8b48a; }
.mk-bag { position: relative; border: 2px solid #b08a48; background-color: rgba(16,10,6,0.9);
  background-image: linear-gradient(rgba(176,138,72,0.35) 1px, transparent 1px), linear-gradient(90deg, rgba(176,138,72,0.35) 1px, transparent 1px); box-shadow: inset 0 0 18px #000; }
.mk-bi { position: absolute; display: flex; align-items: center; justify-content: center; cursor: pointer; box-sizing: border-box; }
.mk-bi img { max-width: 100%; max-height: 100%; pointer-events: none; }
.mk-bi:hover { box-shadow: inset 0 0 0 1px #f0c870; }
.mk-bi.sel { box-shadow: inset 0 0 0 2px #ffd77a, 0 0 10px rgba(255,200,90,0.6); z-index: 1; }
.mk-bi.deny { opacity: 0.32; filter: grayscale(0.8); cursor: not-allowed; }
.mk-form { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.mk-pick { display: flex; gap: 10px; align-items: center; min-height: 52px; padding-bottom: 6px; border-bottom: 1px dashed rgba(142,42,34,0.45); }
.mk-pick-ic:empty { width: 46px; height: 46px; border: 1px dashed rgba(90,60,30,0.5); }
.mk-pick-nm { min-width: 0; display: flex; flex-direction: column; font-size: 14px; color: var(--ink2); line-height: 1.35; }
.mk-pick-nm b { font: 400 17px var(--title); }
.mk-pick-nm small { font-size: 12px; color: #6a5438; }
.mk-fld { display: flex; align-items: center; gap: 8px; }
.mk-fld.hidden { display: none; }
.mk-fld > label { width: 34px; flex: none; font: 400 15px var(--title); color: #7a1a12; letter-spacing: 2px; }
.mk-price { flex: 1; display: flex; align-items: center; gap: 6px; }
.mk-price input { flex: 1; min-width: 0; font: 400 20px var(--title) !important; letter-spacing: 1px; text-align: right; min-height: 38px !important; }
.mk-price span { font: 400 16px var(--title); color: var(--ink2); }
.mk-step { display: inline-flex; }
.mk-step input { width: 64px; text-align: center; border-radius: 0 !important; }
.mk-step button { width: 30px; min-height: 30px; font: 700 16px var(--font); color: #fbe9cf; background: #6a4a2a; border: 1px solid #3a2414; touch-action: manipulation; }
.mk-of { font-size: 12px; color: var(--ink2); }
.mk-hint { font-size: 12.5px; color: var(--ink2); line-height: 1.5; min-height: 1.5em; }
.mk-hint b { font: 400 14px var(--title); color: #7a1a12; cursor: pointer; text-decoration: underline dotted rgba(142,42,34,0.6); text-underline-offset: 3px; }
.mk-calc { font-size: 13px; color: var(--ink2); }
.mk-calc > div { display: flex; justify-content: space-between; padding: 2px 0; border-bottom: 1px dotted rgba(90,60,30,0.3); font-variant-numeric: tabular-nums; }
.mk-calc b { font-weight: 400; font-family: var(--title); font-size: 15px; color: #6a2a1a; }
.mk-calc .mk-net { border-bottom: none; padding-top: 4px; }
.mk-calc .mk-net span { font: 400 15px var(--title); color: #2a1a10; }
.mk-calc .mk-net b { display: inline-flex; align-items: center; gap: 5px; font-size: 20px; color: #2a1a10; }
.mk-bad { color: #b0301e; justify-content: flex-end !important; border-bottom: none !important; }
.mk-go { align-self: flex-end; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 4px 18px 4px 9px;
  font: 400 17px var(--title); letter-spacing: 3px; color: #fbe9cf; background: #8e2a22; border: 1px solid #3a120c; border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255,200,170,0.28), 0 3px 5px rgba(0,0,0,0.35); touch-action: manipulation; }
.mk-go i { font-style: normal; font-size: 14px; padding: 1px 4px; color: #8e2a22; background: #f2dcc0; border-radius: 2px; letter-spacing: 0; }
.mk-go:disabled { filter: grayscale(0.8); opacity: 0.5; }

.mk-foot { margin: 5px 0 0; font-size: 11.5px; color: #6a5438; text-align: center; }

/* 혼 값 (2026-10-11): 냥 대신 혼 한 가지 × 개수. 혼은 먹빛 옻칠 함 속 작은 그림 + 주홍 먹 이름 (혼 등급색 #b2481a), 엽전 자리에 놓인다 */
.mk-purse small { font: 400 11px var(--font); color: #d8c290; letter-spacing: 0; opacity: 0.9; }
.mk-purse small:empty { display: none; }
.mk-hico { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 15px; height: 15px; font: 400 10px/1 var(--title); font-style: normal;
  color: #fbe0c4; background: radial-gradient(circle at 40% 35%, #c2582a, #7a2410 80%); border-radius: 3px; box-shadow: 0 0 0 1px rgba(60,16,6,0.7); }
.mk-hon { flex: none; width: 22px; height: 22px; object-fit: contain; background: rgba(16,10,6,0.9); border: 1px solid #8a5a2a; box-shadow: inset 0 0 4px #000; }
.mk-hp { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.mk-pr.hon .mk-hp b, .mk-calc .mk-hp { font: 400 16px var(--title); color: #9a3a14; letter-spacing: 0.5px; }
.mk-pr.hon .mk-hp em { font: 700 15px var(--font); font-style: normal; color: #2a1a10; }
.mk-calc .mk-net b.mk-hp { font-size: 17px; color: #9a3a14; }
.mk-curs button .mk-coin { width: 12px; height: 12px; }
.mk-curs button .mk-coin::after { width: 4px; height: 4px; margin: -2px 0 0 -2px; }
.mk-curs button.on .mk-hico { box-shadow: 0 0 0 1px #fbe9cf; }
/* 팔기: 냥으로 · 혼으로 고르는 두 쪽 패 */
.mk-curt { display: inline-flex; border: 1px solid #3a2414; border-radius: 2px; overflow: hidden; }
.mk-curt button { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 2px 12px 2px 8px; font: 400 14px var(--title); letter-spacing: 1px;
  color: var(--ink2); background: rgba(255,250,236,0.4); border: none; touch-action: manipulation; }
.mk-curt button + button { border-left: 1px solid #3a2414; }
.mk-curt button.on { color: #fbe9cf; background: #6a4a2a; }
.mk-hpick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mk-hic { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.mk-hic .mk-hon { width: 32px; height: 32px; }
.mk-hic b { font: 400 18px var(--title); color: #9a3a14; }
.mk-hsel { flex: 1; min-width: 120px; min-height: 32px; font: 15px var(--title); color: var(--ink); background: rgba(255,250,236,0.6); border: 1px solid rgba(90,60,30,0.45); border-radius: 2px; padding: 2px 4px; }
.mk-hsel:focus { outline: none; border-color: var(--red); }
.mk-hpick .mk-step input { width: 48px; }
.mk-hqs { margin-top: 2px; }
.mk-hq { display: inline-flex; align-items: center; gap: 3px; margin-right: 4px; color: #9a3a14; font: 400 13px var(--title); cursor: pointer; text-decoration: underline dotted rgba(142,42,34,0.6); text-underline-offset: 3px; }
.mk-hq .mk-hon { width: 16px; height: 16px; }
.mk-hq small { font: 11px var(--font); color: var(--ink2); }

/* 성사 도장 */
.mk-stamp { position: absolute; right: 26%; top: 38%; z-index: 5; pointer-events: none; width: 70px; height: 70px; display: flex; align-items: center; justify-content: center;
  font: 400 50px/1 var(--title); color: rgba(178,34,24,0.88); border: 4px solid rgba(178,34,24,0.85); border-radius: 6px; mix-blend-mode: multiply;
  animation: mk-stamp 1.3s ease-out forwards; }
@keyframes mk-stamp { 0% { transform: scale(2.6) rotate(-16deg); opacity: 0; } 18% { transform: scale(0.94) rotate(-8deg); opacity: 1; } 26% { transform: scale(1) rotate(-8deg); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1) rotate(-8deg); } }

/* ── 태블릿·터치 ── */
body.touch #panel-market { top: 40px !important; height: calc(100vh - 48px); }
body.short #panel-market .mk-eave { height: 12px; } body.short #panel-market .mk-eave i { display: none; }
body.short #panel-market .mk-sheet { border-width: 10px; padding: 4px 8px 4px; }
body.short #panel-market .mk-seal { width: 30px; height: 30px; font-size: 22px; }
body.short #panel-market .mk-name { font-size: 18px; letter-spacing: 3px; }
body.short #panel-market .mk-line, body.short #panel-market .mk-foot { display: none; }
body.short #panel-market .mk-tabs { margin: 4px 0 3px; }
body.short #panel-market .mk-tabs button { min-height: 30px; font-size: 14px; }

/* ── 좁은 화면 (휴대폰 세로 등) ── */
@media (max-width: 620px) {
  #panel-market { top: 6px !important; width: calc(100vw - 8px); max-width: none; height: calc(100vh - 12px); height: calc(100dvh - 12px); }
  #panel-market .mk-eave { height: 10px; margin: 0 -8px -2px; } #panel-market .mk-eave i { display: none; }
  #panel-market .mk-sheet { border-width: 9px; padding: 4px 6px 4px; }
  .mk-head { gap: 7px; padding-bottom: 4px; }
  .mk-seal { width: 30px; height: 30px; font-size: 22px; }
  .mk-name { font-size: 18px; letter-spacing: 3px; }
  .mk-line { display: none; }
  .mk-purse { font-size: 14px; padding: 3px 8px 3px 5px; }
  .mk-tabs { gap: 3px; margin: 5px 0 4px; flex-wrap: nowrap; }
  .mk-tabs button { flex: 1; justify-content: center; padding: 3px 4px; gap: 3px; font-size: 13.5px; letter-spacing: 0; min-height: 36px; }
  .mk-tabs button i { display: none; }
  .mk-ftog { display: inline-block; min-height: 30px; padding: 2px 8px; font: 13px var(--font); color: #fbe9cf; background: #6a4a2a; border: 1px solid #3a2414; border-radius: 2px; }
  .mk-filters { display: none; }
  #panel-market.mk-fopen .mk-filters { display: flex; max-height: 42vh; overflow-y: auto; }
  .mk-search select { max-width: 116px; }
  .mk-rows { background: none; }
  .mk-row { grid-template-columns: 46px 1fr auto; gap: 2px 8px; padding: 5px 4px; }
  .mk-row .mk-act { grid-column: 3; grid-row: 2; min-height: 32px; min-width: 70px; justify-self: end; }
  .mk-row .mk-nm { grid-column: 2 / 4; grid-row: 1; }
  .mk-row .mk-ic { grid-row: 1 / 3; width: 44px; height: 44px; }
  .mk-row .mk-pr { grid-column: 2; grid-row: 2; align-items: flex-start; flex-direction: row; gap: 6px; align-self: center; }
  .mk-row .mk-pr small { align-self: center; }
  .mk-pr.hon .mk-hp b { font-size: 14px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
  .mk-row .mk-pr small { white-space: nowrap; }
  .mk-row .mk-act.armed { white-space: normal; word-break: keep-all; max-width: 150px; line-height: 1.2; text-align: left; }
  .mk-row .mk-pr.hon { flex-wrap: wrap; row-gap: 0; min-width: 0; }                                  /* 혼 값 + 수수료: 좁으면 수수료가 아랫줄로 */   /* '185,000냥 치르기 (궤짝 125,000)' 이 값 칸을 덮지 않게 두 줄로 */
  .mk-hsel { min-width: 0; font-size: 14px; }
  .mk-curt button { padding: 2px 9px 2px 6px; font-size: 13.5px; }
  .mk-nm small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .mk-sell { flex-direction: column; gap: 8px; align-items: stretch; }
  .mk-bagbox { align-self: center; }
  .mk-form { min-width: 0; }
  .mk-foot { display: none; }
  .mk-stamp { right: 30%; top: 30%; }
}
/* 휴대폰 가로 (낮은 화면): 팔기는 행낭과 적는 칸을 옆으로 */
body.phone:not(.portrait) #panel-market { top: 4px !important; height: calc(100vh - 8px); width: min(820px, calc(100vw - 8px)); }
body.phone:not(.portrait) .mk-sell { flex-direction: row; }
body.phone:not(.portrait) .mk-filters { max-height: 34vh; overflow-y: auto; }
