/* 관심 종목 (menu 03). Stock-app look on the site's dark theme: Korean colours (상승 red, 하락 blue),
   tabular figures, sticky tabs, rows that become cards on a phone. */
.wl { --wl-up: #ff5a5f; --wl-down: #4c8dff; --wl-flat: #9aa59f; --wl-row: #141a17; --wl-row-hover: #1a221e;
  --wl-line: #232b27; display: flex; flex-direction: column; gap: 14px; font-variant-numeric: tabular-nums; }
.wl .up { color: var(--wl-up); }
.wl .down { color: var(--wl-down); }
.wl .flat { color: var(--wl-flat); }

.wl-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.wl-head h1 { margin: 2px 0 6px; font-size: 28px; letter-spacing: -0.02em; }
.wl-sub { margin: 0; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wl-key { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  border: 1px solid var(--line); }
.wl-key.live { color: var(--green); border-color: rgba(184, 255, 95, .35); background: rgba(184, 255, 95, .08); }
.wl-key.paper { color: var(--amber); border-color: rgba(255, 203, 102, .35); background: rgba(255, 203, 102, .08); }
.wl-head-actions { display: flex; gap: 10px; align-items: center; }
.wl-live { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.wl-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(184, 255, 95, .6);
  animation: wl-pulse 2s infinite; }
@keyframes wl-pulse { 0% { box-shadow: 0 0 0 0 rgba(184, 255, 95, .55); } 70% { box-shadow: 0 0 0 8px rgba(184, 255, 95, 0); } 100% { box-shadow: 0 0 0 0 rgba(184, 255, 95, 0); } }
@media (prefers-reduced-motion: reduce) { .wl-live i { animation: none; } }

.wl-tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px 10px;
  background: linear-gradient(var(--bg) 80%, transparent); scrollbar-width: thin; }
.wl-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s; }
.wl-tab:hover { color: var(--ink); border-color: #3a453f; }
.wl-tab.active { background: var(--ink); color: #0b0e0d; border-color: var(--ink); }
.wl-tab.pinned .wl-star { color: #ffcb66; }
.wl-tab.active.pinned .wl-star { color: #b88600; }
.wl-tab.ghost { border-style: dashed; background: transparent; }
.wl-count { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.08); }
.wl-tab.active .wl-count { background: rgba(0,0,0,.12); }

.wl-panel { display: flex; flex-direction: column; gap: 12px; }
.wl-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wl-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  overflow-x: auto; max-width: 100%; }
.wl-seg button { flex: none; border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 9px;
  font-weight: 600; font-size: 13px; cursor: pointer; }
.wl-seg button.on { background: #242d29; color: var(--ink); box-shadow: inset 0 0 0 1px #34403a; }
.wl-seg.small button { padding: 7px 10px; }
.wl-search { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; min-width: 180px; padding: 0 12px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); }
.wl-search span { color: var(--muted); font-size: 16px; }
.wl-search input { flex: 1; border: 0; background: transparent; color: var(--ink); padding: 10px 0; font-size: 14px; outline: none; min-width: 0; }
.wl-search:focus-within { border-color: var(--green-dim); }
.wl-search.big input { padding: 13px 0; font-size: 16px; }
.wl-sort { display: flex; gap: 6px; }
.wl-sort select, .wl-field select, .wl-field input { background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 10px; font-size: 13px; }
.wl-dir { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 10px; padding: 0 12px; font-size: 13px; cursor: pointer; }
.wl-group-actions { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }

.wl-list { display: flex; flex-direction: column; border: 1px solid var(--wl-line); border-radius: 16px; overflow: hidden; background: var(--wl-row); }
.wl-row { display: grid; grid-template-columns: minmax(170px, 1.6fr) 1fr 0.8fr 0.9fr 0.9fr auto; gap: 12px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--wl-line); transition: background .12s; }
.wl-list.with-metric .wl-row { grid-template-columns: minmax(170px, 1.6fr) 1fr 0.8fr 0.9fr 0.9fr 1fr auto; }
.wl-row:last-child { border-bottom: 0; }
.wl-row:hover { background: var(--wl-row-hover); }
.wl-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wl-name > div { min-width: 0; }
.wl-name strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-name small, .wl-num small, .wl-price small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.wl-rank { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: #202824; color: var(--muted); }
.wl-rank.top { background: rgba(184, 255, 95, .14); color: var(--green); }
.wl-badge { display: inline-block; padding: 0 6px; margin-left: 4px; border-radius: 5px; font-size: 10px; font-weight: 700;
  background: #222a26; color: var(--muted); vertical-align: 1px; }
.wl-badge.kospi { color: #9fc2ff; }
.wl-badge.kosdaq { color: #c7a6ff; }
.wl-price { text-align: right; }
.wl-price strong { font-size: 16px; }
.wl-price.up strong, .wl-price.up small { color: var(--wl-up); }
.wl-price.down strong, .wl-price.down small { color: var(--wl-down); }
.wl-rate { text-align: right; }
.wl-chip { display: inline-block; min-width: 76px; text-align: center; padding: 6px 8px; border-radius: 9px; font-weight: 800; font-size: 13.5px; }
.wl-chip.up { background: rgba(255, 90, 95, .14); color: var(--wl-up); }
.wl-chip.down { background: rgba(76, 141, 255, .14); color: var(--wl-down); }
.wl-chip.flat { background: #202824; color: var(--wl-flat); }
.wl-num { text-align: right; }
.wl-num strong { font-size: 13.5px; }
.wl-num.held strong { font-size: 14px; }
.wl-num.muted strong { color: var(--faint); }
.wl-actions { display: flex; gap: 4px; justify-content: flex-end; }
.wl-icon { width: 30px; height: 30px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 15px; cursor: pointer; display: grid; place-items: center; }
.wl-icon:hover:not(:disabled) { background: #222a26; color: var(--ink); }
.wl-icon.on { color: #ffcb66; }
.wl-icon.remove:hover { color: var(--wl-up); }
.wl-icon:disabled { opacity: .25; cursor: default; }

.wl-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.wl-theme { padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; transition: transform .12s, border-color .12s, background .12s; }
.wl-theme:hover { transform: translateY(-1px); border-color: #3a453f; }
.wl-theme.open { border-color: var(--green); background: #151c18; }
.wl-theme:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.wl-theme-top { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.wl-theme-top .wl-star { color: #ffcb66; }
.wl-theme-rate { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.wl-theme-meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.wl-theme small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-theme-banner { display: flex; align-items: baseline; gap: 12px; padding: 14px 18px; border-radius: 16px; background: var(--panel);
  border: 1px solid var(--line); }
.wl-theme-banner span { color: var(--muted); font-size: 13px; }
.wl-theme-banner strong { font-size: 26px; font-weight: 800; }
.wl-theme-banner.up strong { color: var(--wl-up); }
.wl-theme-banner.down strong { color: var(--wl-down); }
.wl-theme-banner small { color: var(--muted); }
.wl-detail { display: flex; flex-direction: column; gap: 10px; }
.wl-detail > header { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.wl-detail h2 { margin: 0; font-size: 20px; }
.wl-detail p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.wl-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 44px 20px;
  border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.wl-empty strong { color: var(--ink); font-size: 16px; }
.wl-empty p { margin: 0; max-width: 520px; line-height: 1.6; }
.wl-empty-icon { font-size: 30px; }
.wl-loading { padding: 40px; text-align: center; color: var(--muted); }
.wl-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.wl-notice { padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(255, 203, 102, .3); background: rgba(255, 203, 102, .07);
  color: #ffe2a6; font-size: 13px; }
.wl-link { border: 0; background: none; color: var(--green); cursor: pointer; padding: 0; font: inherit; }

.wl-add { display: flex; flex-direction: column; gap: 12px; min-width: min(520px, 80vw); }
.wl-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.wl-results { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; border-radius: 12px; }
.wl-result { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.wl-result strong { display: block; font-size: 15px; }
.wl-result small { color: var(--muted); font-size: 12px; }
.wl-added { color: var(--green); font-size: 13px; font-weight: 700; }
.wl-add-one strong { font-size: 18px; }

@media (max-width: 760px) {
  .wl-head h1 { font-size: 24px; }
  .wl-group-actions { margin-left: 0; }
  .wl-row, .wl-list.with-metric .wl-row { grid-template-columns: 1fr auto auto; grid-template-areas: "name price rate" "nums nums actions";
    row-gap: 6px; padding: 12px; }
  .wl-name { grid-area: name; }
  .wl-price { grid-area: price; }
  .wl-rate { grid-area: rate; }
  .wl-chip { min-width: 64px; font-size: 12.5px; }
  .wl-num { display: none; }
  .wl-list.with-metric .wl-num.held, .wl-list.with-metric .wl-num:nth-last-child(2) { display: block; grid-area: nums; text-align: left; }
  .wl-actions { grid-area: actions; }
  .wl-themes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wl-theme-rate { font-size: 19px; }
}
.wl-wait { color: var(--faint); font-size: 12px; font-weight: 500; }
/* A price that changed since the last read flashes once, like a stock app's list. */
.wl-row.flash-up .wl-price strong, .wl-row.flash-up .wl-chip { animation: wl-flash-up 1s ease-out; }
.wl-row.flash-down .wl-price strong, .wl-row.flash-down .wl-chip { animation: wl-flash-down 1s ease-out; }
@keyframes wl-flash-up { 0% { background: rgba(255, 90, 95, .45); border-radius: 6px; } 100% { background: transparent; } }
@keyframes wl-flash-down { 0% { background: rgba(76, 141, 255, .45); border-radius: 6px; } 100% { background: transparent; } }
.wl-live.realtime { color: var(--wl-up); font-weight: 700; }
.wl-live.realtime i { background: var(--wl-up); }

/* 관심종목 추가 dialog (2026-09-22 redesign): one-line search bar, fixed-height result list that
   never jumps while typing, and each result with price, move and traded value. The site's modal
   styles make every <label> a large field, so this dialog uses plain containers. */
.wl-add { min-width: min(640px, 86vw); gap: 12px; }
.wl-add-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wl-add-search { flex: 1 1 280px; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 12px;
  background: #131a17; border: 1px solid #2c3631; }
.wl-add-search:focus-within { border-color: #7fb34a; }
.wl-add-search span { color: #7d8a82; font-size: 16px; }
.wl-add .wl-add-search input { flex: 1; min-width: 0; height: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important;
  color: #f2f5f0; font-size: 15px; padding: 0 !important; outline: none; }
.wl-add-group { display: flex; align-items: center; gap: 8px; color: #8f9c94; font-size: 13px; }
.wl-add .wl-add-group select { height: 44px; min-width: 130px; padding: 0 10px; border-radius: 12px; background: #131a17; color: #f2f5f0;
  border: 1px solid #2c3631; font-size: 14px; }
.wl-results { height: min(420px, 52vh); overflow-y: auto; border: 1px solid #222b27; border-radius: 14px; background: #0f1412; padding: 4px 0; }
.wl-results-title { margin: 8px 14px 4px; font-size: 12px; font-weight: 700; color: #8f9c94; }
.wl-results-note { padding: 10px 14px; }
.wl-result { display: grid; grid-template-columns: minmax(0, 1fr) 110px 90px 64px; gap: 10px; align-items: center; padding: 9px 14px;
  border-bottom: 1px solid #1c2320; }
.wl-result:last-of-type { border-bottom: 0; }
.wl-result:hover { background: #151c19; }
.wl-r-name { min-width: 0; }
.wl-r-name strong { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-r-name small { color: #7d8a82; font-size: 11.5px; }
.wl-r-price, .wl-r-value { text-align: right; font-variant-numeric: tabular-nums; }
.wl-r-price strong, .wl-r-value strong { display: block; font-size: 14px; }
.wl-r-price small, .wl-r-value small { display: block; font-size: 11.5px; color: #8f9c94; }
.wl-r-price.up strong, .wl-r-price.up small { color: var(--wl-up, #ff5a5f); }
.wl-r-price.down strong, .wl-r-price.down small { color: var(--wl-down, #4c8dff); }
.wl-result .button.small, .wl-result .wl-added { justify-self: end; }
.wl-skel { display: block; height: 10px; margin: 3px 0 3px auto; width: 70px; border-radius: 4px; background: linear-gradient(90deg, #1b2320, #26302b, #1b2320);
  background-size: 200% 100%; animation: wl-skel 1.2s linear infinite; }
.wl-skel.short { width: 44px; }
@keyframes wl-skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .wl-skel { animation: none; } }
.wl-add-one .wl-result { border: 1px solid #222b27; border-radius: 12px; }
@media (max-width: 640px) {
  .wl-add { min-width: 0; }
  .wl-result { grid-template-columns: minmax(0, 1fr) 90px 60px; }
  .wl-r-value { display: none; }
}
.wl-add-group span { white-space: nowrap; }
