/* ============================================================
   list.css — 리포트 목록(index.html) 전용
   ============================================================ */

.shell { max-width: 1280px; margin: 0 auto; padding: 0 22px 90px; }

/* ---------- 페이지 헤더 ---------- */
.masthead {
  padding: 38px 0 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.masthead__eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--accent);
  margin-bottom: 9px;
}
.masthead h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.025em;
}
.masthead p {
  color: var(--muted);
  font-size: 14.5px;
  max-width: 620px;
  margin: 9px 0 0;
}

/* ---------- 요약 스트립 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 15px 17px;
  box-shadow: var(--sh-1);
}
.stat__k { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.stat__v {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.stat__v small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat__dist { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.stat__dist .rate { font-size: 11px; padding: 2px 8px; }

/* ---------- 툴바 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search {
  position: relative;
  flex: 1 1 250px;
  max-width: 320px;
}
.search input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 10px 13px 10px 36px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search input::placeholder { color: var(--muted-2); }
.search__ico {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  font-size: 14px;
  pointer-events: none;
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--muted-2); }
.chip[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.chip__n { opacity: .6; margin-left: 5px; font-variant-numeric: tabular-nums; }

.toolbar__spacer { flex: 1; }
.sortwrap, .filterwrap { display: flex; align-items: center; gap: 7px; }
.sortwrap label, .filterwrap label { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.sortwrap select, .filterwrap select {
  width: 180px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 8px 30px 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface)
    url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' stroke='%236a7686' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
}
.sortwrap select:disabled, .filterwrap select:disabled {
  color: var(--muted-2);
  background-color: var(--surface-3);
  cursor: not-allowed;
  opacity: .8;
}
.sortwrap select:focus, .filterwrap select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- 리스트 ---------- */
.board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

.cols {
  --grid: minmax(230px, 1fr) 96px 96px 96px 144px 132px 88px 62px;
  display: grid;
  grid-template-columns: var(--grid);
  gap: 14px;
  align-items: center;
  padding: 11px 22px;
  background: var(--surface-3);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--muted);
}
.cols > *:not(:first-child) { text-align: right; }
.cols > .cols__rate { text-align: center; }

.row {
  --grid: minmax(230px, 1fr) 96px 96px 96px 144px 132px 88px 62px;
  display: grid;
  grid-template-columns: var(--grid);
  gap: 14px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background .13s;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* 데스크톱에서는 래퍼가 사라지고 자식들이 직접 행 그리드에 참여합니다.
   좁은 화면에서는 아래 미디어쿼리가 이 래퍼를 실제 그리드로 되살립니다. */
.row__figs { display: contents; }

.row__name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.row__code {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.row__head {
  font-size: 13.2px;
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row__tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-3);
  border-radius: var(--r-xs);
  padding: 2px 7px;
}

.row__rate { text-align: center; }
.cell {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.cell--sub { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cell--target { color: var(--navy); }

/* 수급 */
.supply-cell { text-align: right; min-width: 0; }
.supply-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 750;
  white-space: nowrap;
  color: var(--ink-2);
  background: var(--surface-3);
}
.supply--joint_accumulation, .supply--reversal { color: var(--pos); background: var(--pos-soft); }
.supply--foreign_led, .supply--institution_led, .supply--continuing { color: var(--accent); background: var(--accent-soft); }
.supply--slowing, .supply--neutral { color: var(--warn); background: var(--warn-soft); }
.supply--joint_exit, .supply--exiting { color: var(--down); background: rgba(21, 96, 189, .10); }
.supply--missing { color: var(--muted); }
.supply-cell__nums {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.supply-notice {
  margin-top: 10px;
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 12px;
}
.supply-notice.is-warn { color: var(--warn); background: var(--warn-soft); }
.supply-info {
  position: relative;
  display: inline-flex;
  margin-left: 5px;
  vertical-align: middle;
}
.supply-info__btn {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  font: 800 11px/16px inherit;
  text-align: center;
  cursor: pointer;
}
.supply-info__btn:hover,
.supply-info__btn:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.supply-info__pop {
  position: absolute;
  z-index: 20;
  top: 26px;
  right: 0;
  width: min(310px, calc(100vw - 44px));
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-2);
  color: var(--ink-2);
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.55;
}
.supply-info__pop[hidden] { display: none; }
.supply-info__pop b { display: block; color: var(--ink); font-size: 13px; margin-bottom: 7px; }
.supply-info__pop p { margin: 5px 0; }
.supply-info__pop small { display: block; color: var(--muted); margin-top: 8px; }
.cols { position: relative; z-index: 2; }

/* 상승여력 + 시나리오 레인지 */
.up-cell { text-align: right; }
.up-cell__v {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.range { margin-top: 6px; }
.range__track {
  position: relative;
  height: 5px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: visible;
}
.range__fill {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 3px;
  background: var(--line-2);
}
.range__fill.is-up { background: rgba(192, 57, 43, .32); }
.range__fill.is-down { background: rgba(21, 96, 189, .28); }
.range__now, .range__tgt {
  position: absolute;
  top: 50%;
  width: 2px; height: 12px;
  margin-left: -1px;
  transform: translateY(-50%);
  border-radius: 1px;
}
.range__now { background: var(--ink); }
.range__tgt {
  width: 9px; height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--accent);
}
.range__lbl {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.empty {
  padding: 60px 22px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.empty b { display: block; color: var(--ink-2); font-size: 15.5px; margin-bottom: 5px; }

/* ---------- 범례 / 푸터 ---------- */
.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}
.legend__i { display: inline-flex; align-items: center; gap: 6px; }
.legend__mk { width: 2px; height: 11px; background: var(--ink); border-radius: 1px; }
.legend__mk--t {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--accent);
}
.legend__mk--r { width: 22px; height: 5px; border-radius: 3px; background: var(--surface-3); }

.pagefoot {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12.2px;
  color: var(--muted);
  line-height: 1.7;
}
.pagefoot b { color: var(--ink-2); }
.pagefoot code {
  background: var(--surface-3);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11.5px;
}

/* ---------- 반응형: 카드형으로 전환 ---------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cols { display: none; }
  .row {
    display: block;
    padding: 17px 17px 15px;
    position: relative;
  }
  .row__stock { padding-right: 76px; }
  .row__rate {
    position: absolute;
    top: 17px; right: 17px;
    text-align: right;
  }
  .row__figs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 13px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
  }
  .cell, .up-cell, .supply-cell { text-align: left; }
  .supply-cell__nums { justify-content: flex-start; }
  .cell::before, .up-cell::before, .supply-cell::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 2px;
    letter-spacing: 0;
  }
  .row__date { display: none; }
}

@media (max-width: 640px) {
  .shell { padding: 0 15px 70px; }
  .masthead { padding: 26px 0 20px; }
  .masthead h1 { font-size: 24px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .stat { padding: 12px 13px; }
  .stat__v { font-size: 18px; }

  /* 검색은 한 줄 전체, 칩은 가로 스크롤, 정렬은 오른쪽 고정 */
  .toolbar { gap: 9px; }
  .toolbar__spacer { display: none; }
  .search { flex: 1 1 100%; max-width: none; }
  .chips {
    flex: 1 1 0;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .chips::-webkit-scrollbar { display: none; }
  .sortwrap { flex: none; }
  .sortwrap select, .filterwrap select { width: 164px; }
  .sortwrap label, .filterwrap label { display: none; }

  .row__figs { grid-template-columns: repeat(2, 1fr); }
}
