/* 2026-11-28 owner: phone screens (< 600px) get the home's text rule - nothing under 14px, body / numbers +1px, section titles
   18px bold, buttons: text only (no padding change). PC (>= 600px) untouched. Avatar letters / rank badges on avatars keep
   their size. Spots that wrapped / clipped after the change are put back at the end of this file (checked ko + en, 390px). */
@media (max-width: 599px) {
  /* ── 종목 상세 · 예측하기 ── */
  body:not([data-active="home"]) .es-dc-info, body:not([data-active="home"]) .es-dc-info * { font-size: 14px !important; }   /* 13 -> 14 */
  body:not([data-active="home"]) .es-chips > span { font-size: 14px !important; }                                          /* 13 -> 14 */
  body:not([data-active="home"]) .es-fp-vl { font-size: 14px !important; }                                                 /* 12 -> 14 */
  body:not([data-active="home"]) .es-seg:not(.es-ch-pd) button { font-size: 15px !important; }                             /* 다음 거래일 / 모레: 13 / 14 -> 15 (not the chart's 일·주·월·년, 17px) */
  body:not([data-active="home"]) .es-fp-pct button { font-size: 15px !important; }                                         /* 14 -> 15 */
  body:not([data-active="home"]) main table th, body:not([data-active="home"]) main dl dt { font-size: 14px !important; }  /* 13 -> 14 */
  body:not([data-active="home"]) main table td, body:not([data-active="home"]) main dl dd { font-size: 15px !important; }  /* 14 -> 15 */
  body:not([data-active="home"]) .es-rk { font-size: 14px !important; }                                                   /* 12 -> 14 */
  body:not([data-active="home"]) .es-panel-h > .es-h, body:not([data-active="home"]) .es-box-h > .es-h { font-size: 18px !important; font-weight: 800 !important; }   /* 16 -> 18 */
  body:not([data-active="home"]) .rs-h-meta, body:not([data-active="home"]) .rs-h-cap, body:not([data-active="home"]) .rs-g-u,
  body:not([data-active="home"]) .rs-g-d, body:not([data-active="home"]) .rs-ppl-n, body:not([data-active="home"]) .rs-pct,
  body:not([data-active="home"]) .rs-days a, body:not([data-active="home"]) .rs-sort button { font-size: 15px !important; }   /* 14 -> 15 */
  body:not([data-active="home"]) .es-pr small, body:not([data-active="home"]) .es-rx { font-size: 15px !important; }      /* 14 -> 15 */
  body:not([data-active="home"]) .es-card-crowd { font-size: 17px !important; }                                         /* 16 -> 17 */
  /* ── 공통 (랭킹 · 증시 맞추기 · AI · 이벤트 · 무료 구독 · 홍보) ── */
  body:not([data-active="home"]) .mp-cap, body:not([data-active="home"]) .mp-seg a, body:not([data-active="home"]) .mp-pill { font-size: 15px !important; }   /* 14 -> 15 */
  /* 랭킹 */
  body:not([data-active="home"]) .rk-n { font-size: 14px !important; }                                                   /* 13 -> 14 */
  body:not([data-active="home"]) .mp-grow small.mp-ell, body:not([data-active="home"]) .rk-pod-n, body:not([data-active="home"]) .rk-pod small { font-size: 15px !important; }   /* 14 -> 15 */
  /* 증시 맞추기 */
  body:not([data-active="home"]) .dc-pts, body:not([data-active="home"]) .dc-price em { font-size: 15px !important; }    /* 14 -> 15 */
  /* AI */
  body:not([data-active="home"]) main td small, body:not([data-active="home"]) main a small, body:not([data-active="home"]) .al-grow small,
  body:not([data-active="home"]) .al-h small, body:not([data-active="home"]) .best small { font-size: 14px !important; }  /* 12.5 / 13 -> 14 */
  body:not([data-active="home"]) main td b, body:not([data-active="home"]) .al-ell { font-size: 17px !important; }        /* 16 -> 17 */
  body:not([data-active="home"]) .al-chip { font-size: 16px !important; }                                                /* 15 -> 16 */
  body:not([data-active="home"]) .al-sub, body:not([data-active="home"]) .al-cap { font-size: 15px !important; }   /* 14 -> 15 */
  /* 이벤트 */
  body:not([data-active="home"]) .ev-d, body:not([data-active="home"]) .ev-rules span { font-size: 15px !important; }    /* 14 -> 15 */
  /* 홍보하고 돈벌기 */
  body:not([data-active="home"]) .pm-badge, body:not([data-active="home"]) .pm-calc small { font-size: 14px !important; }   /* 13 / 12 -> 14 */
  /* ── put back (wrapped / clipped after the change, ko / en 390px) ── */
  /* .es-pd-h .es-sub stays 15px (English: two rows) · .mp-step stays 15px (free / promote: one more row) · .al-how li stays 14px (AI: one more row) */
  body:not([data-active="home"]) .mp-grow .mp-cap { font-size: 14px !important; }   /* 증시 맞추기 list, 2nd row: 15px cut "NASDAQ Composite · 11/…" in English */
}

/* 2026-11-28 "정확도 봉 보는 법" (!) icon + popover (templates/partials/acc_help.html, script at the end of static/js/chart.js).
   Phone only: nothing of it exists on PC (>= 600px). */
.es-ah { display: none; }
@media (max-width: 599px) {
  .es-ah { display: inline-flex; flex: none; align-items: center; align-self: center; }
  .es-ah-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -8px -10px -8px 0;
    padding: 0; border: 0; border-radius: 50%; background: none; box-shadow: none; color: #111; cursor: pointer;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .es-ah-btn[aria-expanded="true"] { background: rgba(17, 24, 39, .08); }
  .es-ah-btn svg { width: 26px; height: 26px; flex: none; }
  .es-ah-feat { margin-left: auto; }   /* home card: right end of the name / price row */
  .es-ah-pop { position: fixed; z-index: 1000; box-sizing: border-box; padding: 14px 16px 14px; background: #fff; border: 1px solid #E4E6EB;
    border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .10); color: #1F2328; text-align: left; white-space: normal; font-weight: 500; }
  .es-ah-pop[hidden] { display: none; }
  .es-ah-tail { position: absolute; top: -7px; width: 12px; height: 12px; background: #fff; border-left: 1px solid #E4E6EB;
    border-top: 1px solid #E4E6EB; transform: translateX(-50%) rotate(45deg); }
  .es-ah-t { display: block; margin: 0 0 8px; font-size: 16px; font-weight: 800; line-height: 1.35; color: #111; }
  .es-ah-svg { display: block; width: 100%; height: 70px; margin: 0 0 8px; overflow: visible; font-family: inherit; }   /* 2026-11-29: the ruler drawing (0% / 100% ticks, −50% · 50% · 200% dots) */
  .es-ah-ul { display: block; }
  .es-ah-li { position: relative; display: block; padding-left: 14px; margin: 0 0 6px; font-size: 14px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
  .es-ah-li:last-child { margin-bottom: 0; }
  .es-ah-li::before { content: ''; position: absolute; left: 2px; top: .7em; width: 5px; height: 5px; border-radius: 50%; background: #6B7280; }
  .es-ah-sq { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 1px; border-radius: 2px; vertical-align: 0; }
}

/* 2026-11-28 phone: Japanese / Chinese have no spaces - "keep-all" (kept for Korean) made the home headline one 445px line, so the
   whole page got wider than the screen (the card's (!) icon ended off-screen). Break them where those languages break. */
@media (max-width: 599px) {
  html[lang|="ja"] .es-home .es-intro *, html[lang|="zh"] .es-home .es-intro * { word-break: normal !important; line-break: strict; overflow-wrap: anywhere; }
}

/* 2026-11-28 phone home card: the "avatars + 126명 ▲31% 예측" row ends up beside the chart legend (chart.js measure()). Its first
   place above the chart takes no room from the start, so the chart does not jump up ~45px when it appears. If the canvas chart
   fails (.es-fc-ssr: the server picture stays), the row shows in its old place as before. */
@media (max-width: 599px) {
  .es-home .es-feat .es-market > .es-feat-h { visibility: hidden; height: 0; min-height: 0; margin: 0 !important; padding: 0 !important; overflow: hidden; }
  .es-home .es-feat .es-market:has(.es-fc-ssr) > .es-feat-h { visibility: visible; height: auto; overflow: visible; }
}

/* 2026-11-28 phone home list - FINAL (owner + planner). PC keeps its 2-4 column cards: the new parts are hidden there.
   top: left = name (20px bold) / price (20px bold black) + change (16px bold) on one baseline;
        right (152px) = 5-day chart (34px) + one-line legend (13px) - both blocks 56px tall, same top and bottom line
   people: 3 faces (44px, overlapping, white ring) + "126명" + "▲31% 상승 예측" (16px, one line)
   very light line, comment (15px, up to 3 lines), nickname (grey 14px) | thumbs up · thumbs down · comments (18px icons)
   No comment -> no line / comment / bottom row. Spacing in 4px steps: box 12/16px inside, 8px between boxes, 12px from the screen. */
.es-card-sp, .es-card-pp, .es-card-cm { display: none; }
@media (max-width: 599px) {
  .es-home .es-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 8px !important; padding-left: 12px !important; padding-right: 12px !important; }
  .es-home .es-grid > .es-card.es-xm { display: flex !important; }          /* one per row: no odd last card to hide */
  .es-home .es-more.es-more-m { display: none !important; }
  .es-home .es-grid > .es-card > .es-card-btn { display: none !important; }  /* the whole row opens the stock page */
  .es-home .es-grid > .es-card { border: 0 !important; box-shadow: none !important; background: #fff !important; border-radius: 12px !important; }
  /* v8 (owner, 2026-11-29): left = 2 lines - name (26px bold, ellipsis) / "price ▲change" side by side on one baseline - centred on the
     chart's 98px: 15 + 32 (name) + 8 + 28 (price row) + 15 = 98. Right = the chart box 124 x 98 (v5 was 132: 8px narrower in every box so the
     longest "price ▲change" - TW NT$ / HK$ / BTC, 198px with the 6px gap - fits the 202px left column; gap 8 -> 6 was not enough alone), label "예측선" inside it.
     (v5 had 3 lines of 28px; v6 kept the sizes 22 / 21 / 17 - price 21px and change 17px stay.) */
  .es-home .es-grid .es-card-a { display: grid !important; grid-template-columns: minmax(0, 1fr) 124px; column-gap: 8px; row-gap: 0;
    grid-template-rows: 15px 32px 8px 28px 15px auto auto; grid-template-areas: ". sp" "h sp" ". sp" "p sp" ". sp" "pp pp" "cm cm"; align-items: center; padding: 12px 16px !important; }
  .es-home .es-grid .es-card-c, .es-home .es-grid .es-card-crowd { display: none !important; }
  /* left block: no grey text anywhere in the box (v6: #111 / #333 + red / blue only) */
  .es-home .es-grid .es-card-h { grid-area: h; min-width: 0; height: 32px; line-height: 32px; font-size: 26px !important; }
  .es-home .es-grid .es-card-h .es-flag { display: none !important; }
  .es-home .es-grid .es-card-h .es-sn { display: block; min-width: 0; }
  .es-home .es-grid .es-card-h .es-sn-t { display: block; font-size: 26px !important; font-weight: 800 !important; color: #0A0A0A; line-height: 32px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .es-home .es-grid .es-card-p { grid-area: p; display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; align-items: baseline !important;
    justify-content: flex-start !important; gap: 0 6px !important; margin: 0 !important; min-width: 0; height: 28px; white-space: nowrap; }
  .es-home .es-grid .es-card-p::after { content: none !important; }
  .es-home .es-grid .es-card-p b { flex: none; line-height: 28px; color: #0A0A0A !important; font-weight: 800 !important; font-size: 21px !important;
    letter-spacing: -0.4px; white-space: nowrap; overflow: visible; font-variant-numeric: tabular-nums; }
  .es-home .es-grid .es-card-p .es-chg { flex: none; line-height: 28px; font-size: 17px !important; font-weight: 800 !important;
    white-space: nowrap; font-variant-numeric: tabular-nums; }
  /* right block: the chart alone, the label inside it */
  .es-home .es-grid .es-card-sp { grid-area: sp; display: block; position: relative; width: 124px; height: 98px; align-self: start; justify-self: end; }
  .es-home .es-grid .es-sp5 { display: block; width: 124px; height: 98px; }
  .es-home .es-grid .es-sp-in { position: absolute; top: 2px; right: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 0; height: 18px;
    color: #E0283A; font-size: 14px; font-weight: 800; line-height: 20px; white-space: nowrap; }
  .es-home .es-grid .es-sp-in > i { flex: none; width: 9px; height: 2.5px; border-radius: 2px; background: #E0283A; }
  /* people */
  .es-home .es-grid .es-card-pp { grid-area: pp; display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 11px; white-space: nowrap;   /* v8: row-gap 0 -> 7 + 4 = 11px kept */
    font-size: 17px; font-weight: 400; }
  .es-home .es-grid .es-card-pp .es-stack { display: inline-flex; flex: none; }
  .es-home .es-grid .es-card-pp .es-stack .es-av { --s: 44px !important; width: 44px !important; height: 44px !important; }
  .es-home .es-grid .es-card-pp .es-stack .es-av + .es-av { margin-left: -12px; }
  .es-home .es-grid .es-card-pp .es-stack .es-av > .es-av-l { box-shadow: 0 0 0 2px #fff; }
  .es-home .es-grid .es-card-ppt { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: #111; font-size: 17px; }
  .es-home .es-grid .es-card-ppt.es-muted { color: #333 !important; }
  .es-home .es-grid .es-card-ppt b { font-weight: 700; color: #111; }            /* v6: "88명" bold */
  .es-home .es-grid .es-card-ppt .es-up { color: #E0283A; font-weight: 400; }
  /* comment (v6: 18px #111, 1.5 lines, still 3 lines at most; nickname / counts 16px #333, icons 22px in the same #333) */
  .es-home .es-grid .es-card-cm { grid-area: cm; display: block; margin-top: 11px; padding-top: 12px; border-top: 1px solid #EEF0F2; min-width: 0; }
  .es-home .es-grid .es-cm-tx { margin: 0; font-size: 18px; line-height: 1.5; color: #111; font-weight: 400; display: -webkit-box; -webkit-box-orient: vertical;
    -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; word-break: break-word; }
  .es-home .es-grid .es-cm-ft { display: flex; align-items: center; gap: 12px; margin-top: 8px; min-width: 0; height: 24px; }
  .es-home .es-grid .es-cm-nk { flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 400; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .es-home .es-grid .es-cm-ic { flex: none; display: flex; align-items: center; gap: 16px; color: #333; }
  .es-home .es-grid .es-cm-n { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; font-weight: 400; color: #333; font-variant-numeric: tabular-nums; }
  .es-home .es-grid .es-cm-n svg { flex: none; width: 22px; height: 22px; stroke-width: 1.8; }
}
/* 2026-11-28 phone home bottom: the "무제한 열람" title / text / black button go (PC keeps them in its right column); one share
   button stays, last on the page, on the cards' line. Outline = default; .tint = the light-red alternative (not used yet).
   Same height / corners as the card's [예측하기] (54px, 4px), one step quieter: no black fill. */
.es-ss-ic { display: none; }
@media (max-width: 599px) {
  .es-home .es-subbox { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 12px !important; margin: 0 0 16px !important; }
  .es-home .es-subbox > .es-h, .es-home .es-subbox > p.es-sub, .es-home .es-subbox > a.es-btn.dark { display: none !important; }
  .es-home .es-subbox .es-subshare.es-btn { display: flex !important; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 54px !important;
    margin: 0 !important; padding: 0 14px !important; border-radius: 4px !important; background: #fff !important; border: 1.5px solid #1F2328 !important;
    color: #111 !important; font-size: 16px !important; font-weight: 800 !important; white-space: nowrap; box-shadow: none !important;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  .es-home .es-subbox .es-subshare.es-btn:active { background: #F1F3F5 !important; transform: translateY(1px); }
  .es-home .es-subbox .es-subshare.es-btn.tint { background: rgba(224, 40, 58, .07) !important; border-color: rgba(224, 40, 58, .45) !important; color: #B4232F !important; }
  .es-home .es-subbox .es-subshare.es-btn.tint:active { background: rgba(224, 40, 58, .14) !important; }
  .es-home .es-ss-ic { display: inline-flex; flex: none; }
  .es-home .es-ss-ic svg { width: 20px; height: 20px; }
}
/* 2026-11-29 (owner, quick fix): predict page - [예측하기] and [공유하고 무료 이용 시간 받기] were side by side and the share text broke
   "받 / 기". Phone only: the two buttons stack, both full width, 8px apart; the share button is the SAME thing as the home's bottom
   share button (white, border, share icon, bold 16px: the same values as the .es-subshare rule above, icon macro ui.share_icon()). Text never wraps: side
   padding 10px, then an ellipsis (.es-ss-t). Same on the stock page's pair (already stacked there). PC untouched. */
@media (max-width: 599px) {
  .es-pd-row { grid-template-areas: "vals vals" "reason reason" "err err" "save save" "share share" !important; row-gap: 8px !important; }
  .es-pd-row .es-pd-share.es-btn, .es-pp-share.es-btn { display: flex !important; align-items: center; justify-content: center; gap: 8px; width: 100% !important; max-width: none !important;
    height: 54px !important; min-height: 54px !important; margin: 0 !important; padding: 0 10px !important; border-radius: 4px !important; background: #fff !important;
    border: 1.5px solid #1F2328 !important; color: #111 !important; font-size: 16px !important; font-weight: 800 !important; line-height: 1.2 !important;
    white-space: nowrap !important; box-shadow: none !important; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  .es-pd-row .es-pd-share.es-btn:active, .es-pp-share.es-btn:active { background: #F1F3F5 !important; transform: translateY(1px); }
  .es-pd-row .es-pd-share.es-btn:disabled, .es-pp-share.es-btn:disabled { color: #9AA0A6 !important; border-color: #C9CDD2 !important; }
  .es-pd-share .es-ss-ic, .es-pp-share .es-ss-ic { display: inline-flex; flex: none; }
  .es-pd-share .es-ss-ic svg, .es-pp-share .es-ss-ic svg { width: 20px; height: 20px; }
  .es-pd-share .es-ss-t, .es-pp-share .es-ss-t { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 599px) { .es-home .es-market > .es-more { margin-bottom: 0 !important; } .es-home .es-subbox { margin-top: 6px !important; } }   /* list or [더 보기] -> share button: 8 + 6 = 14px either way */
/* 2026-11-28 phone: the big card's chart box is 422px once the canvas chart is in (370 + 96 lower pane + 26 dates - 70, chart.js fitH);
   the server picture before it was 412px, so everything below jumped 10px down. Same height from the first paint. */
@media (max-width: 599px) { .es-home .es-feat .es-feat-chart:not(.es-fc-on) { height: 422px !important; min-height: 422px !important; } }

/* 2026-11-28 phone [더 보기]: the arrow only (26px chevron), the whole width, 44px tall, on the boxes' 12px line; PC keeps its text button.
   Hidden when there is nothing more (template: only rendered when cards are hidden; gone after the tap). */
.es-more-ic { display: none; }
@media (max-width: 599px) {
  .es-home .es-market > .es-more { display: flex !important; align-items: center; justify-content: center; width: calc(100% - 24px) !important;
    height: 44px !important; min-height: 44px; margin: 8px 12px 0 !important; padding: 0 !important; background: #fff !important; border: 0 !important;
    border-radius: 12px !important; box-shadow: none !important; color: #374151 !important; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  .es-home .es-market > .es-more:active { background: #F1F3F5 !important; }
  .es-home .es-market > .es-more .es-more-t { display: none; }
  .es-home .es-market > .es-more .es-more-ic { display: block; width: 26px; height: 26px; flex: none; }
  .es-home .es-market > .es-more.es-more-m { display: none !important; }
}

/* 2026-11-29 (owner): phone home card - the people row ("avatars + 165명 ▲33% 예측") sits under the chart: chart → 1px divider → people
   row → [예측하기] button, 12px apart (chart.js moves the row here on phones; sizes and text unchanged). */
@media (max-width: 599px) {
  .es-home .es-feat .es-feat-people.es-feat-pplb { position: static !important; display: flex !important; align-items: center; gap: 8px; min-width: 0; white-space: nowrap;
    margin: 12px 0 0 !important; padding: 12px 0 0 !important; border-top: 1px solid #E4E6EB; }
  .es-home .es-feat > .es-market > .es-feat-btns { margin-top: 12px !important; padding-top: 0 !important; }
}

/* 2026-11-29 (owner): phone home [더 보기] = an arrow link (→) to the predict page's stock list (this country tab selected), 44px, on the
   boxes' 12px line. The PC keeps its text button (.es-more-pc). */
.es-more-go { display: none; }
@media (max-width: 599px) {
  .es-home .es-market > .es-more-pc { display: none !important; }
  .es-home .es-market > a.es-more-go { display: flex !important; text-decoration: none; }
  .es-home .es-market > a.es-more-go svg { width: 26px; height: 26px; flex: none; }
}

/* 2026-11-29 (owner): on the phone the 정확도 note line is drawn inside the chart (chart.js _noteDraw, bottom-left of the price area);
   the page's line under the chart is hidden, so the avatar row moves up by its height. PC unchanged. */
@media (max-width: 599px) {
  .es-acc-note { display: none !important; }
}
