/* entity-links.css — 분석 자료의 종목·업종 링크(.el-ent)와 팝오버(.el-pop). templates/_entity_links.html 이 싣는다.
 * 색은 전부 tokens.css. 링크는 글자색을 바꾸지 않는 실선 밑줄(용어 사전의 점선과 구분) — 시세 숫자·제목 색(등락·상태색)을 그대로 두고
 * 읽는 흐름을 끊지 않게. 배포 순서: 이 파일은 merge 순간 살아나지만 클래스는 새 마크업에만 있어(.el-*·.ep-*) 옛 페이지에 영향이 없다. */

/* ---- 링크 — 글자처럼 보이는 <a> ---- */
.el-ent {
    color: inherit; text-decoration: underline solid var(--text-muted);
    text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; border-radius: 2px;
}
.el-ent:hover { text-decoration-color: var(--accent-text); }
.el-ent[aria-expanded="true"] { background: var(--accent-soft); }

/* ---- 팝오버 ---- */
.el-pop[hidden], .ep-scrim[hidden] { display: none; }
.ep-scrim { position: fixed; inset: 0; z-index: 800; background: var(--scrim); }
.el-pop {
    position: absolute; z-index: 810;
    width: min(380px, calc(100vw - 16px)); max-height: min(75vh, 600px); overflow-y: auto;
    padding: 14px 16px 12px;
    background: var(--bg-card); color: var(--text-primary);
    border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
    font-size: 14px; line-height: 1.6; text-align: left; word-break: keep-all; overflow-wrap: anywhere;
    outline: none;
}
.ep-head { display: flex; align-items: flex-start; gap: 8px; }
.ep-tt { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ep-title { margin: 0; font-size: 16px; line-height: 1.4; color: var(--text-strong); }
.ep-cat {
    padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap;
    background: var(--bg-inset); color: var(--text-secondary);
}
.ep-x {
    flex: none; width: 32px; height: 32px; margin: -4px -6px 0 0; border-radius: 6px; cursor: pointer;
    background: transparent; border: 0; color: var(--text-secondary); font-size: 14px; line-height: 1;
}
.ep-x:hover { background: var(--bg-hover); color: var(--text-primary); }
.ep-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.ep-price { font-size: 18px; font-weight: 700; color: var(--text-strong); }
.ep-up { color: var(--up-text); }
.ep-down { color: var(--down-text); }
.ep-flat { color: var(--text-secondary); }
.ep-muted { color: var(--text-muted); font-size: 12px; }
.ep-sec { margin-top: 10px; }
.ep-sec h3 { margin: 0 0 2px; font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.ep-sec p { margin: 0; font-size: 13px; color: var(--text-primary); }
.ep-sec p.ep-muted { color: var(--text-muted); }
.ep-note { margin-top: 2px; font-size: 11px; color: var(--text-muted); }
.ep-quoteline { margin-top: 2px; }
.ep-news { list-style: none; margin: 0; padding: 0; }
.ep-news li { padding: 4px 0; border-top: 1px solid var(--border-soft); font-size: 13px; }
.ep-news li:first-child { border-top: 0; }
.ep-news a { color: var(--accent-text); text-decoration: none; }
.ep-news a:hover { text-decoration: underline; }
.ep-src { display: block; font-size: 11px; color: var(--text-muted); }
.ep-analysis { padding: 8px 10px; border-radius: var(--radius); background: var(--bg-inset); }
.ep-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.ep-chip {
    padding: 2px 8px; border-radius: 999px; font-size: 12px; text-decoration: none;
    background: var(--bg-inset); color: var(--text-primary); border: 1px solid var(--border);
}
.ep-chip:hover { background: var(--bg-hover); }
.ep-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
    margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-soft);
}
.ep-more { font-size: 13px; font-weight: 600; color: var(--accent-text); text-decoration: none; }
.ep-more:hover { text-decoration: underline; }
.ep-watch {
    min-height: 32px; padding: 4px 12px; border-radius: 6px; cursor: pointer;
    background: var(--bg-inset); color: var(--text-primary); border: 1px solid var(--border);
    font-size: 12.5px; font-weight: 600;
}
.ep-watch:hover { background: var(--bg-hover); }
.ep-watch:disabled { opacity: .6; cursor: default; }
.ep-login { font-size: 12px; color: var(--text-secondary); }
.ep-status { margin: 6px 0 0; font-size: 12px; color: var(--warn); }
.ep-status:empty { display: none; }

/* ---- 폰: 화면 아래 시트 ---- */
body.ep-lock { overflow: hidden; }
.el-pop.ep-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto !important; left: 0 !important;
    width: 100%; max-height: 82vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: 0;
    padding: 16px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    font-size: 15px;
}
.el-pop.ep-sheet .ep-sec p, .el-pop.ep-sheet .ep-news li { font-size: 14px; }
.el-pop.ep-sheet .ep-x { width: 40px; height: 40px; }
