/* /movers/ — built on the shared design system (assets/css/theme.css). */

.hkm-page .site-footer { margin-top: 48px; }
.hkm { padding-bottom: 8px; }
.hkm .page-head { margin-bottom: 16px; }
.hkm .page-head .subtitle { margin-top: 4px; font-size: 17px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.hkm .byline {
  margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  font-size: 12.5px; color: var(--muted);
}
.hkm .byline .num { color: var(--text-2); }
.hkm .byline .btn { margin-left: auto; }
.hkm .sh {
  border-top: 3px solid #000; padding-top: 8px; margin: 30px 0 12px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap;
}
.hkm .sh h2 { font: 700 15px/1.3 var(--font-sans); letter-spacing: 0.04em; }
.hkm .sh .aux { font-size: 12px; color: var(--muted); }
.hkm .badge-sample { height: auto; padding: 2px 7px; line-height: 1.3; letter-spacing: 0.06em; }
.hkm .badge-market { height: auto; padding: 2px 7px; line-height: 1.3; letter-spacing: 0.06em; }
.hkm .badge-stale { height: auto; padding: 2px 7px; line-height: 1.3; letter-spacing: 0.06em; color: #fff; background: #A50034; border-color: #A50034; }

.hkm-notices { display: grid; gap: 8px; }
.hkm-notices:not(:empty) { margin-bottom: 14px; }
.hkm .notice { align-items: center; }
.hkm .notice .badge { flex: none; }
.hkm .hkm-alert { flex-wrap: wrap; gap: 8px 10px; }
.hkm .hkm-alert > span:not(.badge) { flex: 1 1 260px; min-width: 0; }
.hkm .hkm-alert .btn { flex: none; }

/* ---------- view switch ---------- */
.hkm-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--text); margin: 4px 0 18px; }
.hkm-switch button {
  border: 0; background: #fff; color: var(--text-2); padding: 12px 14px; cursor: pointer; text-align: left;
  display: grid; gap: 2px; min-width: 0;
}
.hkm-switch button + button { border-left: 1px solid var(--text); }
.hkm-switch b { font: 700 16px/1.25 var(--font-sans); letter-spacing: 0.01em; overflow-wrap: anywhere; }
.hkm-switch small { font-size: 12px; color: var(--muted); }
.hkm-switch button[aria-selected='true'] { background: #000; color: #fff; }
.hkm-switch button[aria-selected='true'] small { color: #bdbdbd; }
.hkm-switch button:focus-visible { outline-offset: -4px; outline-color: var(--link); }
.hkm-switch button[aria-selected='true']:focus-visible { outline-color: #fff; }

/* ---------- stats ---------- */
.hkm-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.hkm-stat { padding: 14px 16px 12px 0; min-width: 0; }
.hkm-stat + .hkm-stat { border-left: 1px solid var(--line); padding-left: 16px; }
.hkm-stat .k { font: 700 10.5px/1.3 var(--font-sans); letter-spacing: 0.1em; color: var(--muted); }
.hkm-stat .v { font-size: 26px; font-weight: 600; line-height: 1.3; margin-top: 2px; overflow-wrap: anywhere; }
.hkm-stat .s { font-size: 12.5px; color: var(--muted); }
.hkm .flat { color: var(--muted); }
@media (max-width: 700px) {
  .hkm-stats { grid-template-columns: 1fr 1fr; }
  .hkm-stat:nth-child(3) { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .hkm-stat .v { font-size: 20px; }
}

/* ---------- advance / flat / decline bar (same look as the morning report's market breadth) ---------- */
.hkm-sb { margin: 0 0 20px; }
.hkm-sb-l { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; font-size: 12px; color: var(--text-2); }
.hkm-sb-l .nm { font-weight: 600; }
.hkm-sb-l .tot { font-size: 11px; color: var(--muted); white-space: nowrap; flex: none; }
.hkm-sb-bar { display: flex; gap: 2px; height: 28px; border-radius: 2px; overflow: hidden; background: #fff; }
.hkm-sb-bar span {
  display: flex; align-items: center; justify-content: center; flex: 1 1 0%; min-width: 30px; padding: 0 6px;
  font: 600 13px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: #fff; white-space: nowrap;
}
.hkm .hkm-sb-bar span { color: #fff; }
.hkm-sb-bar .up { justify-content: flex-start; padding-left: 9px; }
.hkm-sb-bar .down { justify-content: flex-end; padding-right: 9px; }
.hkm .hkm-sb-bar .empty { background: var(--line); color: var(--muted); font: 500 12px/1 var(--font-sans); }
.hkm-sb-leg { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; font-weight: 600; }
.hkm-sb-leg i { display: inline-block; width: 8px; height: 8px; border-radius: 1px; margin-right: 5px; }
.hkm-sb-leg .pct { font-weight: 500; }
.hkm-bt .flat { color: var(--muted); }

/* ---------- panels, toolbar ---------- */
.hkm-panel { margin-bottom: 16px; }
.hkm-panel .panel-head { padding-bottom: 2px; align-items: center; }
.hkm-inline { display: flex; align-items: center; gap: 8px; }
.hkm-hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.hkm-panel .hkm-hint { margin-bottom: 10px; }
.hkm-criteria {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; margin-bottom: 16px;
  background: var(--bg-2); border-left: 2px solid #000; font-size: 13px;
}
.hkm-tag {
  display: inline-block; font: 600 12.5px/1.3 var(--font-sans); padding: 3px 8px; border: 1px solid var(--line-2);
  background: #fff; border-radius: 2px;
}
.hkm-toolbar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; margin-bottom: 4px; }
.hkm-scope { display: inline-flex; align-items: center; gap: 8px; min-height: 31px; font-size: 13.5px; font-weight: 600; }
.hkm .seg { max-width: 100%; flex-wrap: wrap; }
.hkm .field-label { font: 700 10.5px/1.2 var(--font-sans); letter-spacing: 0.1em; color: var(--muted); }

/* ---------- sector strength chips ---------- */
.hkm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.hkm-chip {
  display: inline-flex; align-items: center; gap: 6px; font: 600 12.5px/1 var(--font-sans); padding: 7px 9px; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 2px; background: #fff; color: var(--text-2); max-width: 100%;
}
.hkm-chip .sw { width: 10px; height: 10px; border-radius: 1px; flex: none; }
.hkm-chip .num { font-size: 12px; }
.hkm-chip:hover { border-color: var(--text); }
.hkm-chip[aria-pressed='true'] { background: #000; border-color: #000; color: #fff; }
.hkm-chip[aria-pressed='true'] .up { color: #7ee2a0; }
.hkm-chip[aria-pressed='true'] .down { color: #ff9aa5; }

/* ---------- heat map ---------- */
.hkm-map { position: relative; width: 100%; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.hm-group { position: absolute; background: #fff; box-shadow: inset 0 0 0 1px #111; pointer-events: none; transition: opacity 0.2s; }
.hm-group.is-dim { opacity: 0.35; }
.hm-gl {
  position: absolute; z-index: 2; height: 18px; padding: 0 4px; border: 0; background: transparent; color: var(--text);
  font: 700 11px/18px var(--font-sans); text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hm-gl .num { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.hm-gl:hover { text-decoration: underline; text-underline-offset: 3px; }
.hm-gl.is-dim { opacity: 0.45; }
.hm-tile {
  position: absolute; z-index: 1; border: 0; padding: 2px 3px; margin: 0; cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1px;
  line-height: 1.2; transition: opacity 0.2s;
}
.hm-tile:hover { filter: brightness(0.93); }
.hm-tile.is-dim { opacity: 0.3; }
.hm-tile.is-selected { outline: 2px solid #000; outline-offset: -2px; z-index: 3; box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.85); }
.hm-tile:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; z-index: 3; }
.hm-tile .c { font-size: 11.5px; font-weight: 600; }
.hm-tile .n { font-size: 11px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-tile .p { font-size: 11px; font-weight: 600; opacity: 0.95; }
.hm-sector { align-items: flex-start; justify-content: flex-start; text-align: left; padding: 8px 10px; gap: 3px; }
.hm-sector .n { font: 700 13.5px/1.25 var(--font-sans); white-space: normal; }
.hm-sector .p { font-size: 18px; font-family: var(--font-mono); }
.hm-sector.compact { padding: 4px 5px; gap: 1px; }
.hm-sector.compact .n { font-size: 11.5px; }
.hm-sector.compact .p { font-size: 12.5px; }
.hm-sector.tiny .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hm-sector .b, .hm-sector .l { font-size: 11.5px; opacity: 0.92; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hkm-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.hkm-legend i { width: 22px; height: 10px; display: inline-block; border: 1px solid rgba(0, 0, 0, 0.08); }
.hkm-legend span { margin: 0 4px; }
.hkm-legend em { font-style: normal; margin-left: 10px; }

/* ---------- detail card ---------- */
.hkm-detail { margin: 0 0 16px; }
.hkm-sectors + .hkm-detail { margin-top: 16px; }
.hkm-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.hkm-detail h3 { font: 700 18px/1.3 var(--font-display); }
.hkm-detail .code, .hkm-table .code { font-size: 12px; color: var(--muted); font-weight: 500; }
.hkm-dl { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 16px; margin: 0 0 12px; }
.hkm-dl dt { font: 700 10.5px/1.3 var(--font-sans); letter-spacing: 0.1em; color: var(--muted); }
.hkm-dl dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; }
@media (max-width: 700px) { .hkm-dl { grid-template-columns: 1fr 1fr; } }

/* ---------- tables ---------- */
.hkm .table-wrap { overflow-x: visible; }
.hkm-list { margin-top: 18px; }
.hkm-list-h {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px;
  margin: 0; padding: 9px 12px; color: #fff; border-radius: 2px; font: 700 15px/1.35 var(--font-sans);
}
.hkm-list-h.is-up { background: #008259; }
.hkm-list-h.is-down { background: #A50034; }
.hkm-list-h .n { font-size: 12.5px; font-weight: 600; color: #fff; }
.hkm-note {
  margin: 0; padding: 8px 12px; font-size: 12.5px; line-height: 1.6; color: var(--text-2); background: var(--bg-2);
  border-left: 3px solid var(--line-2);
}
.hkm-list[data-dir='up'] .hkm-note.is-short { border-left-color: #008259; }
.hkm-list[data-dir='down'] .hkm-note.is-short { border-left-color: #A50034; }
.hkm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.hkm-table th {
  text-align: left; font: 700 10.5px/1.3 var(--font-sans); letter-spacing: 0.08em; color: var(--muted);
  padding: 10px 10px 8px 0; border-bottom: 1px solid #000; white-space: nowrap; vertical-align: bottom;
}
.hkm-table th small { display: block; font-size: 9.5px; font-weight: 500; letter-spacing: 0; }
.hkm-table th.r, .hkm-table td.r { text-align: right; }
.hkm-table td { padding: 10px 10px 10px 0; vertical-align: top; }
.hkm-table .c-rank { width: 28px; color: var(--muted); }
.hkm-table .c-stock b { display: block; font-weight: 600; }
.hkm-table .c-stock .code { margin-right: 8px; }
.hkm-table .c-stock .ind { font-size: 12px; color: var(--muted); }
.hkm-row td { border-top: 1px solid var(--line); padding-bottom: 4px; }
.hkm-table tbody tr.hkm-row:first-child td { border-top: 0; }
.hkm-news-row td { padding: 0 0 10px 28px; white-space: normal; }
.hkm-table tbody tr:hover td { background: transparent; }
.hkm-row:hover td, .hkm-row:hover + .hkm-news-row td { background: #fffbea !important; }
.hkm-sector-table td { border-top: 1px solid var(--line); }
.hkm-sector-table tbody tr:first-child td { border-top: 0; }
.hkm-sector-table tr.is-selected td { background: #fffbea; }
.hkm-sector-table .c-leader { max-width: 420px; }
.hkm-sector-table .c-leader .hkm-tag { margin: 0 4px 4px 0; font-size: 12px; }
.hkm-link {
  border: 0; background: none; padding: 0; cursor: pointer; font: 600 13.5px/1.4 var(--font-sans); color: var(--link);
  text-align: left; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
}
.hkm-link:hover, .hkm-link[aria-pressed='true'] { text-decoration-color: currentColor; }

.news { display: grid; gap: 1px; text-decoration: none; padding: 6px 10px; border-left: 2px solid var(--line-2); background: var(--bg-2); max-width: 760px; }
a.news:hover { border-left-color: #000; }
a.news:hover .news-t { text-decoration: underline; text-underline-offset: 3px; }
.news-t { font-size: 13px; line-height: 1.5; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.news-m { font-size: 11.5px; color: var(--muted); }
.news-empty { display: block; font-size: 12.5px; color: var(--faint); max-width: none; }
.hkm-detail .news { margin-top: 2px; }

.hkm-empty { padding: 36px 12px; text-align: center; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.hkm-empty b { display: block; font-size: 16px; color: var(--text-2); margin-bottom: 4px; }
.hkm-error .btn { margin-top: 12px; }
.hkm-loading { padding: 60px 0; text-align: center; color: var(--muted); }
.hkm-noscript { padding: 20px 0; color: var(--down); }

.hkm-method { margin-top: 34px; padding: 14px 16px; background: var(--bg-2); border-left: 2px solid #000; font-size: 13px; color: var(--text-2); line-height: 1.7; }
.hkm-method h2 { font: 700 13px/1.4 var(--font-sans); letter-spacing: 0.06em; margin-bottom: 6px; }
.hkm-method ul { padding-left: 18px; margin: 0; }
.hkm-method li { margin: 3px 0; }
.hkm-disc { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ---------- phones: tables become cards ---------- */
@media (max-width: 759px) {
  .hkm-switch b { font-size: 13px; }
  .hkm-switch small { font-size: 11px; }
  .hkm-switch button { padding: 10px 8px; }
  .hkm .panel-head { padding: 12px 12px 0; }
  .hkm .panel-body { padding: 10px 12px 14px; }

  .hkm-table:not(.hkm-members-table) thead { display: none; }
  .hkm-table:not(.hkm-members-table), .hkm-table:not(.hkm-members-table) tbody, .hkm-table:not(.hkm-members-table) tr, .hkm-table:not(.hkm-members-table) td { display: block; width: 100%; }
  .hkm-table:not(.hkm-members-table) td { padding: 0; border: 0 !important; background: none !important; }

  .hkm-row {
    display: grid !important; grid-template-columns: 1fr 1fr 1fr; gap: 8px 10px; padding: 12px 0 4px; border-top: 1px solid var(--line);
  }
  .hkm-table tbody tr.hkm-row:first-child { border-top: 0; }
  .hkm-row .c-rank { display: none; }
  .hkm-row .c-stock { grid-column: 1 / 3; }
  .hkm-row .c-chg { grid-column: 3 / 4; grid-row: 1; font-weight: 600; align-self: start; }
  .hkm-table .hkm-row td.r { text-align: left; font-size: 12.5px; }
  .hkm-table .hkm-row td.c-chg { text-align: right; font-size: 15px; }
  .hkm-row .c-imp { grid-column: 1 / -1; }
  .hkm-row td[data-l]::before {
    content: attr(data-l); display: block; font: 700 10px/1.3 var(--font-sans); letter-spacing: 0.08em; color: var(--faint);
  }
  .hkm-row td.c-chg[data-l]::before { display: none; }
  .hkm-news-row { padding: 6px 0 12px; }
  .hkm-news-row td { padding: 0; }

  .hkm-sector-table tr { padding: 12px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
  .hkm-sector-table tbody tr:first-child { border-top: 0; }
  .hkm-sector-table tr.is-selected { background: #fffbea; }
  .hkm-table.hkm-sector-table td { text-align: left; font-size: 13px; }
  .hkm-sector-table td[data-l]::before { content: attr(data-l); display: inline-block; min-width: 4.8em; margin-right: 8px; font: 700 10px/1.3 var(--font-sans); letter-spacing: 0.08em; color: var(--faint); }
  .hkm-sector-table .c-sector { grid-column: 1 / 2; }
  .hkm-sector-table td.c-sector[data-l]::before { display: none; }
  .hkm-table.hkm-sector-table td.c-chg { grid-column: 2 / 3; grid-row: 1; text-align: right; font-weight: 600; }
  .hkm-sector-table td.c-chg[data-l]::before { display: none; }
  .hkm-sector-table td:nth-child(n + 3) { grid-column: 1 / -1; }
  .hkm-sector-table .c-leader { max-width: none; }

  .hkm-dl dd { font-size: 14px; }
  .hkm-stat .s { font-size: 12px; }
}

/* ---------- index views: roster notice and the full constituents table ---------- */
.hkm-roster .hkm-hint { flex: 1 1 320px; }
.hkm-upcoming { flex: 1 0 100%; margin: 0; display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.6; color: var(--text-2); }
.hkm-pill {
  flex: none; font: 700 11px/1.4 var(--font-sans); letter-spacing: 0.04em; padding: 1px 8px; border: 1px solid #000;
  border-radius: 999px; background: #fff; color: #000; white-space: nowrap;
}

.hkm-members { margin-top: 30px; }
.hkm-members-hint { margin: 0 0 8px; }
.hkm .hkm-members-wrap { overflow-x: auto; max-width: 100%; border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.hkm .hkm-members-wrap:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.hkm-members-table { min-width: 800px; }
.hkm-members-table th, .hkm-members-table td { padding: 9px 14px 9px 0; white-space: nowrap; }
.hkm-members-table th.r { padding-bottom: 6px; }
.hkm-members-table tbody tr { border-top: 1px solid var(--line); }
.hkm-members-table tbody tr:first-child { border-top: 0; }
.hkm-members-table .m-stock {
  position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; min-width: 150px; max-width: 190px;
  white-space: normal; padding-right: 12px; box-shadow: 1px 0 0 var(--line);
}
.hkm-members-table thead .m-stock { z-index: 2; }
.hkm-members-table tbody th.m-stock { font: inherit; letter-spacing: 0; color: var(--text); vertical-align: top; border-bottom: 0; }
.hkm-members-table .m-stock b { display: block; font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.hkm-members-table .m-stock .code { font-size: 12px; color: var(--muted); font-weight: 500; margin-right: 6px; }
.hkm-tag-na { font-size: 11px; padding: 1px 6px; color: var(--muted); }
.hkm-members-table tr.is-na td, .hkm-members-table tr.is-na th.m-stock { background: var(--bg-2); }
.hkm-members-table .na { color: var(--faint); }
.hkm-members-table tbody tr:hover td, .hkm-members-table tbody tr:hover th.m-stock { background: #fffbea; }

.hkm-sortbtn {
  display: inline-grid; grid-template-columns: auto auto; align-items: baseline; justify-content: end; column-gap: 4px;
  border: 0; background: none; cursor: pointer; padding: 4px 0; min-height: 36px; font: inherit; color: inherit; text-align: right;
  letter-spacing: inherit; text-transform: none;
}
.hkm-sortbtn .lbl { grid-column: 1; grid-row: 1; font: 700 10.5px/1.3 var(--font-sans); letter-spacing: 0.08em; }
.hkm-sortbtn .arr { grid-column: 2; grid-row: 1; font-size: 10px; color: var(--faint); }
.hkm-sortbtn small { grid-column: 1 / -1; grid-row: 2; font-size: 9.5px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.hkm-sortbtn:hover .lbl { text-decoration: underline; text-underline-offset: 3px; }
.hkm-sortbtn.is-on { color: var(--text); }
.hkm-sortbtn.is-on .arr { color: #000; }
.hkm-sortbtn:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.hkm-refnote { margin-top: 10px; }
.hkm-members-window { margin-bottom: 8px; }
.hkm-members-bar { margin: 8px 0; }
.hkm-members-bar:empty { display: none; }
.hkm-members-toggle { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; text-align: left; white-space: normal; }
.hkm-members-toggle .arr { font-size: 10px; flex: none; }
@media (max-width: 759px) {
  .hkm-members-table { min-width: 760px; }
  .hkm-members-table .m-stock { min-width: 128px; max-width: 150px; }
  .hkm-upcoming { flex-direction: column; gap: 4px; }
}
