/* search.css — header stock search (static/js/search.js) + mobile header that never wraps.
   Loaded by base.html after align.css / rtl.css. */

/* ===== mobile header: one 52px row at any width / language. Only the logo text shrinks (ellipsis), and last:
   search.js (.hd-m.share-ico) first drops the share label to an icon, then hides the logo text (.logo-off). */
.hd-m { flex-wrap: nowrap; overflow: hidden; }
.hd-m > * { flex: none; }
.hd-m .logo { flex: 0 1 auto; min-width: 0; }
.hd-m .logo > svg, .hd-m .logo > img, .hd-m .logo > span:not(.logo-t) { flex: none; }
.hd-m .logo-t { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-m .hd-sp { flex: 1 1 0; min-width: 0; }
.hd-m .icon-btn { flex: none; width: 40px; height: 40px; min-width: 40px; }
.hd-m .share-pill { flex: none; height: 32px; white-space: nowrap; line-height: 1; max-width: 132px; }
.hd-m .share-pill > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hd-m .share-pill > svg { flex: none; }
.hd-m.share-ico .share-pill { width: 36px; padding: 0; justify-content: center; }
.hd-m.share-ico .share-pill > span { display: none; }
.hd-m.logo-off .logo-t { display: none; }
@media (max-width: 359px) { .hd-m:not(.logo-off) .logo-t { display: block; } }

/* ===== search overlay ===== */
.srch-bg { position: fixed; inset: 0; z-index: 120; }
.srch-bg.is-m { background: var(--surface); }
.srch-bg.is-pc { background: rgba(0, 0, 0, .12); }
.srch { display: flex; flex-direction: column; background: var(--surface); color: var(--text); }
.is-m .srch { position: absolute; inset: 0; padding-top: env(safe-area-inset-top); }
.is-pc .srch { position: fixed; top: 64px; right: 16px; width: 420px; max-width: calc(100vw - 32px); max-height: min(560px, calc(100vh - 88px));
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; animation: srch-in .14s ease-out; }
@keyframes srch-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.srch-top { display: flex; align-items: center; gap: 4px; flex: none; height: 60px; padding: 0 16px 0 4px; }
.is-pc .srch-top { height: auto; padding: 12px 12px 4px; }
.is-pc .srch-back { display: none; }
.srch-back { flex: none; width: 44px; height: 44px; }
.srch-box { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 6px 0 14px; border-radius: 999px;
  background: var(--subtle); color: var(--muted); cursor: text; }
.srch-box:focus-within { box-shadow: 0 0 0 2px var(--ink) inset; }
.srch-box > svg { flex: none; }
.srch-in { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--text); font-size: 16px; padding: 0; }
.srch-in::-webkit-search-cancel-button, .srch-in::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.srch-in:focus-visible { outline: none; }
.srch-clr { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); padding: 0; }
.srch-clr:hover { background: var(--btn2); }
.srch-chips { display: flex; gap: 6px; flex: none; overflow-x: auto; padding: 6px 16px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.srch-chips::-webkit-scrollbar { display: none; }
.srch-chip { flex: none; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--btn2); color: var(--sub);
  font-size: 14px; font-weight: 600; white-space: nowrap; }
.srch-chip.on { background: var(--ink); color: #fff; }
.srch-cap { flex: none; padding: 4px 16px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.srch-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.srch-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 16px; color: var(--text); }
.srch-row:hover, .srch-row.on { background: var(--hover); }
.srch-row.sep { border-top: 1px solid var(--divider); }
.srch-fl { flex: none; width: 24px; display: inline-flex; justify-content: center; font-size: 18px; line-height: 1; }
.srch-nm { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.srch-nm b, .srch-nm small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srch-nm b { font-size: 17px; font-weight: 600; }
.srch-nm small { font-size: 13px; color: var(--muted); }
.srch-px { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: end; font-variant-numeric: tabular-nums; max-width: 45%; }
.srch-px b { font-size: 17px; font-weight: 600; white-space: nowrap; }
.srch-rate { font-size: 13px; white-space: nowrap; color: var(--sub); }
.srch-rate.up { color: var(--up); } .srch-rate.down { color: var(--down); }
.srch-px b, .srch-rate { unicode-bidi: isolate; direction: ltr; }
.srch-empty { padding: 32px 16px; text-align: center; font-size: 17px; color: var(--muted); }
[dir=rtl] .srch-back svg { transform: scaleX(-1); }
[dir=rtl] .srch-top { padding: 0 4px 0 16px; }
[dir=rtl] .srch-box { padding: 0 14px 0 6px; }

/* ===== small-phone fixes found in the 320–430px audit ===== */
/* home "most predicted right now": long names (en/de/ar) pushed the row wider than the screen at 320px */
.es-hot a > * { flex: none; }
.es-hot .es-sn { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; overflow: hidden; }
.es-hot .es-sn-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-hot-n { width: auto; min-width: 52px; white-space: nowrap; }
/* home columns are 1fr grids: a long word set the min-content width -> let grid items shrink */
.es-home-cols > *, .es-home-side > * { min-width: 0; }
/* segment buttons (다음 거래일 / 모레 / 글피 ...): the label never breaks inside a button; the group wraps instead */
.es-seg button { white-space: nowrap; }
/* 내 예측 (/me): stat tiles and the All / Pending / Settled tabs pushed the page sideways in en/de/ja/ar at 320px */
@media (max-width: 640px) {
  .mp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-stats > *, .mpr-cols > *, .mpr-main > * { min-width: 0; }
  .mp-stat b, .mp-stat span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mp-seg { overflow-x: auto; scrollbar-width: none; }
  .mp-seg::-webkit-scrollbar { display: none; }
  .mp-seg > a, .mp-seg > button { min-width: 0; flex: 1 0 auto; white-space: nowrap; padding: 6px 8px; font-size: 14px; }
}

/* 2026-11-21 회의: 폰 헤더 = 로고 · 검색 · 내 아바타(마이페이지) · ⋮ 메뉴 (공유 버튼 없음) */
.hd-m .hd-me { display: inline-flex; align-items: center; justify-content: center; }
.hd-m .hd-me .es-av, .hd-m .hd-me .av { width: 30px; height: 30px; }
.drawer .dr-row.js-region { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: start; cursor: pointer; }
.drawer .dr-row.js-region .flag { width: 22px; height: auto; border-radius: 2px; }
/* 2026-11-21 회의: 폰 헤더 내 아바타 크게(36px) + 닉네임 (페이스북 프로필 칩) */
.hd-m .hd-me-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 52vw; padding: 2px 4px 2px 2px; border-radius: 22px; color: var(--es-text, #050505); text-decoration: none; }
.hd-m .hd-me-chip:active { background: var(--es-hover, #F2F2F2); }
.hd-m .hd-me-chip .es-av, .hd-m .hd-me-chip .av { width: 36px; height: 36px; flex: 0 0 auto; }
.hd-m .hd-me-n { font-size: 17px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-m .logo { min-width: 0; flex-shrink: 1; }
/* 2026-11-21 회의: 헤더 아바타 왼쪽 아래에 국기 (다른 회원 아바타와 같은 위치·모양) */
.hd-m .hd-me-chip { padding-left: 4px; overflow: visible; }
.hd-m .hd-me-chip .av, .hd-m .hd-me-chip .es-av { width: 38px; height: 38px; overflow: visible; }
.hd-m .hd-me-chip .av > img.av-f { left: -4px; bottom: -3px; width: 17px; box-shadow: 0 0 0 2px var(--es-surface, #fff); }
.hd-m .hd-me-chip .av-flag { left: -3px; bottom: 0; line-height: 0; border-radius: 3px; box-shadow: 0 0 0 2px var(--es-surface, #fff); }
.hd-m .hd-me-chip .av-flag img { width: 16px; height: auto; border-radius: 2px; display: block; }
