@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700;800&family=Syne:wght@600;700;800&display=swap");
.mal-stock-host, .stock-slide, .stock-zoom {
  --ink: #080a09;
  --paper: #eeeee8;
  --acid: #d9fe52;
  --muted: #a8aaa4;
  --line: rgba(238, 238, 232, 0.22);
  --display: "Syne", sans-serif;
  --body: "Manrope", sans-serif;
  --mal-gold: #f0d78a;
  --mal-gold-deep: #c9a24a;
  --mal-gold-soft: #fff1c8;
  --r-xl: 22px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 10px;
}
.mal-stock-host {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  font-family: var(--body);
}
.mal-stock-host[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}
.mal-stock-host .stock-slide {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.menu-panel-root:has(> .mal-stock-host):not(:has(> .mal-stock-host[hidden])) {
  padding: 0 !important;
  place-items: stretch !important;
}
.menu-panel-root:has(> .mal-stock-host):not(:has(> .mal-stock-host[hidden])) .menu-panel-wealth,
.menu-panel-root:has(> .mal-stock-host):not(:has(> .mal-stock-host[hidden])) .menu-panel-wealth-veil {
  display: none;
}
.menu-panel-root:has(> .mal-stock-host):not(:has(> .mal-stock-host[hidden])) .menu-panel-card {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  border-radius: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  background: #080a07 !important;
  box-shadow: none !important;
}
.menu-panel-root:has(> .mal-stock-host):not(:has(> .mal-stock-host[hidden])) .menu-panel-head {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 8;
  margin: 0 !important;
}
.menu-panel-root:has(> .mal-stock-host):not(:has(> .mal-stock-host[hidden])) .menu-panel-body,
.menu-panel-root:has(> .mal-stock-host):not(:has(> .mal-stock-host[hidden])) .dash-holdings {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.menu-panel-root:has(> .mal-stock-host):not(:has(> .mal-stock-host[hidden])) .dash-holdings > * {
  display: none !important;
}

.mal-stock-host .stock-body[hidden] {
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.mal-stock-host .stock-band--watch {
  min-height: 0;
}
.mal-stock-host .stock-band--positions,
.mal-stock-host .stock-band--positions[hidden] {
  display: flex !important;
  flex-direction: column;
}

/* STOCK — ink / gold / cash-desk atmosphere matching hero money tiles */
.stock-slide {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  gap: 6px;
  padding: calc(64px + 0.6vw) 5vw 1.1vw;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(195deg, rgba(8, 9, 7, 0.78) 0%, rgba(6, 8, 6, 0.86) 38%, rgba(3, 5, 4, 0.94) 100%),
    radial-gradient(ellipse 58% 46% at 82% 8%, rgba(232, 199, 107, 0.16), transparent 58%),
    radial-gradient(ellipse 48% 40% at 10% 72%, rgba(40, 130, 95, 0.12), transparent 56%),
    radial-gradient(ellipse 36% 30% at 48% 100%, rgba(180, 70, 55, 0.07), transparent 52%),
    url("/assets/stock/stock-bg.jpg?v=20260805s8") center 36% / cover no-repeat,
    linear-gradient(180deg, #080a07 0%, #0d120e 48%, #050605 100%);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.stock-slide input,
.stock-slide textarea,
.stock-slide [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

.stock-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(232, 199, 107, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 130, 0.04) 1px, transparent 1px);
  background-size: 100% 30px, 52px 100%;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 90%);
}

.stock-slide > * {
  position: relative;
  z-index: 1;
}

.stock-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 8;
  pointer-events: auto;
}

.stock-back {
  flex: 0 0 auto;
  pointer-events: auto;
  z-index: 10;
  min-height: 34px;
  padding: 6px 12px;
  letter-spacing: 0.08em;
}

.stock-head__copy {
  min-width: 0;
  flex: 0 1 auto;
  pointer-events: none;
}

.stock-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
  position: relative;
  z-index: 9;
  pointer-events: auto;
}

.stock-head__actions .stock-btn,
.stock-head__actions .stock-watch-form--head,
.stock-head__actions .stock-orders-dock,
.stock-head__actions input {
  position: relative;
  z-index: 1;
  pointer-events: auto !important;
  touch-action: manipulation;
}

/* 거래내역 dock next to 종목 추가 */
.stock-orders-dock {
  position: relative;
  flex: 0 0 auto;
  z-index: 40;
}

.stock-orders-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: min(520px, calc(100vw - 48px));
  max-height: min(48vh, 360px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(240, 215, 138, 0.35);
  border-radius: 4px;
  background:
    linear-gradient(165deg, rgba(16, 18, 16, 0.98) 0%, rgba(6, 8, 7, 0.98) 100%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

.stock-orders-panel[hidden] {
  display: none !important;
}

.stock-orders-dock.is-open .stock-orders-panel {
  display: flex !important;
}

.stock-orders-dock.is-open [data-stock-orders-toggle] {
  border-color: rgba(110, 200, 255, 0.55);
  background: rgba(56, 150, 220, 0.18);
  color: #b8e0ff;
}

.stock-orders-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.stock-orders-panel__head strong {
  color: var(--mal-gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stock-orders-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
}

.stock-orders-panel__close:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--paper);
}

.stock-orders-panel .stock-table-wrap--orders {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(36vh, 280px);
  height: auto !important;
  overflow: auto;
  border: 1px solid rgba(240, 215, 138, 0.18);
  background: rgba(0, 0, 0, 0.32);
}

.stock-orders-panel__empty {
  margin: 0;
  padding: 14px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.stock-orders-panel__empty[hidden] {
  display: none !important;
}

.stock-head .section-label {
  margin-bottom: 4px;
  width: 100%;
}

.stock-head h2 {
  margin: 0;
  color: var(--paper);
  font-family: var(--display);
  font-size: clamp(1.28rem, 2.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.stock-head__lead {
  display: none !important;
}

/* 종목 추가 — 새로고침 옆 (헤더 액션 바) */
.stock-watch-form--head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 200px;
  min-width: min(200px, 100%);
  max-width: 320px;
  margin: 0;
}

.stock-watch-form--head input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.32);
  color: var(--paper);
  font: inherit;
  font-size: 0.82rem;
}

.stock-watch-form--head input:focus {
  outline: none;
  border-color: rgba(110, 200, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 150, 220, 0.12);
}

.stock-watch-form--head .stock-btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 12px;
}

.stock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid rgba(232, 199, 107, 0.32);
  border-radius: 0;
  background: rgba(232, 199, 107, 0.08);
  color: #e8c76b;
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.stock-btn:hover {
  border-color: rgba(232, 199, 107, 0.65);
  background: rgba(232, 199, 107, 0.16);
}

.stock-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stock-btn.is-busy {
  opacity: 0.85;
  cursor: wait;
}

.stock-btn--primary {
  border-color: rgba(110, 200, 255, 0.45);
  background: rgba(56, 150, 220, 0.16);
  color: #b8e0ff;
}

.stock-btn--primary:hover {
  border-color: rgba(140, 210, 255, 0.75);
  background: rgba(56, 150, 220, 0.26);
}

.stock-btn--ghost {
  border-color: rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.stock-btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.04);
}

.stock-btn--link {
  border-color: rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--acid);
}

.stock-connect {
  flex-shrink: 0;
  padding: 14px 16px;
  border: 1px solid rgba(240, 215, 138, 0.22);
  border-radius: var(--r-md);
  background:
    linear-gradient(125deg, rgba(240, 215, 138, 0.08) 0%, rgba(8, 10, 9, 0.92) 48%, rgba(5, 7, 6, 0.98) 100%);
}

.stock-connect[hidden],
.stock-body[hidden],
.stock-orders[hidden] {
  display: none !important;
}

.stock-slide.is-configured .stock-connect {
  display: none !important;
}

.stock-slide:not(.is-configured) .stock-body {
  display: none !important;
}

.stock-connect__hint {
  margin: 0 0 12px;
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.stock-connect__hint strong {
  color: var(--paper);
  font-weight: 600;
}

.stock-connect__fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stock-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.stock-field span {
  color: var(--mal-gold);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stock-field input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.35);
  color: var(--paper);
  font: inherit;
  font-size: 0.86rem;
}

.stock-field input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.stock-field input:focus {
  outline: none;
  border-color: rgba(110, 200, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 150, 220, 0.12);
}

.stock-connect__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.stock-connect__status {
  color: var(--muted);
  font-size: 0.8rem;
}

.stock-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(10px, 1.4vh, 16px);
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  /* 6종목 고정 · USD 2줄(원화+달러) 여유 포함 · 스크롤 없음 */
  --stock-row-h: 46px;
  --stock-thead-h: 26px;
  --stock-pos-max: 6;
  --stock-holds-h: calc(var(--stock-thead-h) + var(--stock-pos-max) * var(--stock-row-h) + 4px);
}

.stock-slide.is-configured .stock-body:not([hidden]) {
  display: flex;
}

.stock-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 8px 12px;
  flex: 0 0 auto;
  flex-shrink: 0;
  padding: 10px 14px;
  border: 1px solid rgba(240, 215, 138, 0.28);
  border-radius: var(--r-md);
  background:
    linear-gradient(125deg, rgba(240, 215, 138, 0.12) 0%, rgba(8, 10, 9, 0.92) 48%, rgba(5, 7, 6, 0.98) 100%);
}

.stock-hero--split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 10px;
  align-items: stretch;
  overflow: hidden;
}

.stock-hero__eval,
.stock-hero__holds {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 2px;
}

.stock-hero__eval {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 10px 6px 2px;
  border-right: 1px solid rgba(240, 215, 138, 0.18);
}

.stock-hero__holds {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 2px 6px 6px;
}

.stock-hero__media,
.stock-hero__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.stock-hero__media {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.04);
  filter: saturate(1.05) contrast(1.04);
}

.stock-hero__media--krw {
  background-image: url("/assets/stock/hero-krw.jpg?v=20260805s7");
}

.stock-hero__media--swing {
  background-image: url("/assets/stock/hero-holds-cash.jpg?v=20260805s7");
}

.stock-hero__shade {
  background:
    linear-gradient(155deg, rgba(6, 8, 10, 0.55) 0%, rgba(5, 7, 9, 0.78) 46%, rgba(3, 5, 7, 0.9) 100%);
}

.stock-hero__shade--swing {
  background:
    linear-gradient(155deg, rgba(4, 10, 14, 0.5) 0%, rgba(4, 8, 12, 0.76) 48%, rgba(3, 5, 8, 0.9) 100%);
}

.stock-hero__eval > :not(.stock-hero__media):not(.stock-hero__shade),
.stock-hero__holds > :not(.stock-hero__media):not(.stock-hero__shade) {
  position: relative;
  z-index: 1;
}

.stock-hero--split .stock-hero__parts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stock-hero__holds-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.stock-hero__holds-head .stock-hero__label {
  margin-bottom: 0;
}

.stock-hero__holds-head em {
  color: var(--mal-gold);
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.stock-hold-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 0;
  max-height: 72px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

/* 가야할 길 — L→R 3카드, 세로 스크롤 없음 */
.stock-hero__holds[data-stock-signal-panel] {
  font-family: var(--path);
}

.stock-hero__label--path {
  font-family: var(--path);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: none;
  font-size: 0.78rem;
}

.stock-hero__holds[data-stock-signal-panel] .stock-hero__holds-head em {
  font-family: var(--path);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 0.78rem;
}

.stock-hold-list--alloc {
  flex-direction: row;
  align-items: stretch;
  gap: 5px;
  max-height: none;
  overflow: hidden;
  padding-right: 0;
  flex: 1 1 auto;
  min-height: 0;
  font-family: var(--path);
}

.stock-hold-list__empty {
  margin: 0;
  padding: 10px 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.stock-hold-list--alloc .stock-hold-list__empty {
  flex: 1 1 auto;
  text-align: center;
  font-family: var(--path);
}

.stock-hold-chip {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) auto;
  gap: 4px 8px;
  align-items: center;
  width: 100%;
  padding: 4px 7px;
  border: 1px solid rgba(240, 215, 138, 0.32);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.42);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  backdrop-filter: blur(2px);
}

.stock-hold-chip--alloc {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2px;
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  padding: 5px 6px 6px;
  grid-template-columns: none;
  font-family: var(--path);
  position: relative;
  overflow: hidden;
}

.stock-hold-chip--alloc strong {
  width: 100%;
  font-family: var(--path);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.stock-hold-chip--alloc em {
  justify-self: start;
  font-family: var(--path);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.stock-hold-chip--alloc span {
  width: 100%;
  font-family: var(--path);
  font-size: 0.62rem;
  font-weight: 500;
  opacity: 0.9;
  letter-spacing: -0.02em;
}

.stock-hold-chip__bar {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  font-style: normal;
}

.stock-hold-chip__fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(232, 199, 107, 0.85), rgba(120, 200, 150, 0.95));
  transition: width 220ms ease;
}

.stock-hold-chip--alloc.is-short {
  border-color: rgba(255, 150, 150, 0.35);
}

.stock-hold-chip--alloc.is-done {
  border-color: rgba(120, 220, 160, 0.5);
  background: rgba(30, 90, 60, 0.28);
}

.stock-hold-chip--alloc.is-done strong {
  color: #c8f0d8;
}

.stock-hold-chip--alloc.is-buy-dip {
  border-color: rgba(120, 220, 160, 0.65);
  box-shadow: inset 0 0 0 1px rgba(120, 220, 160, 0.18);
}

.stock-hold-chip__buy {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  pointer-events: none;
  font-family: var(--path);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  color: #d8ffe8;
  text-shadow:
    0 0 12px rgba(40, 160, 100, 0.85),
    0 1px 3px rgba(0, 0, 0, 0.75);
  background:
    radial-gradient(ellipse 70% 55% at 50% 50%, rgba(20, 90, 55, 0.55) 0%, rgba(4, 10, 8, 0.12) 70%, transparent 100%);
  animation: stock-buy-pulse 1.6s ease-in-out infinite;
}

@keyframes stock-buy-pulse {
  0%,
  100% {
    opacity: 0.88;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stock-hold-chip__buy {
    animation: none;
  }
}

.stock-hero__holds-head em.is-done {
  color: #8fe0b8;
}

.stock-hold-chip:hover {
  border-color: rgba(240, 215, 138, 0.65);
  background: rgba(240, 215, 138, 0.08);
}

.stock-hold-chip strong {
  color: var(--paper);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-hold-chip span {
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-hold-chip em {
  justify-self: end;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
}

.stock-hold-chip em.is-up {
  color: #8fe0b8;
}

.stock-hold-chip em.is-down {
  color: #ff9aa6;
}

.stock-hold-chip.is-signal {
  border-color: rgba(120, 220, 160, 0.55);
  background: rgba(40, 120, 80, 0.28);
}

.stock-hold-chip.is-signal strong {
  color: #c8f0d8;
}

.stock-hero__label {
  display: block;
  margin-bottom: 4px;
  color: var(--mal-gold);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.stock-hero__value-row {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.stock-hero__value {
  color: var(--paper);
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55);
}

.stock-hero__pct {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.stock-hero__meta {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.stock-hero__parts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
  align-content: center;
}

.stock-hero__part {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 0 0 0 12px;
  border-left: 1px solid rgba(240, 215, 138, 0.18);
}

.stock-hero__part span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stock-hero__part strong {
  color: var(--paper);
  font-family: var(--display);
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stock-hero__part strong.is-up {
  color: #7ddea8;
}

.stock-hero__part strong.is-down {
  color: #ff9b9b;
}

.stock-hero__part em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.72rem;
}

.stock-status-line {
  margin: 0;
  min-height: 0;
  color: var(--muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.stock-status-line:empty {
  display: none;
}

.stock-hero--compact {
  padding: 5px 10px;
  gap: 4px 10px;
}

.stock-hero--compact .stock-hero__eval {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr);
  grid-template-rows: auto;
  align-items: center;
  gap: 6px 10px;
  padding: 4px 8px 4px 2px;
}

.stock-hero--compact .stock-hero__main {
  min-width: 0;
}

.stock-hero--compact .stock-hero__label {
  margin-bottom: 1px;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
}

.stock-hero--compact .stock-hero__value {
  font-size: clamp(1rem, 1.7vw, 1.28rem);
}

.stock-hero--compact .stock-hero__pct {
  font-size: 0.72rem;
}

.stock-hero--compact .stock-hero__part {
  padding-left: 8px;
  gap: 1px;
}

.stock-hero--compact .stock-hero__part span {
  font-size: 0.56rem;
}

.stock-hero--compact .stock-hero__part strong {
  font-size: clamp(0.74rem, 1.05vw, 0.9rem);
}

.stock-hero--compact .stock-hero__part em {
  font-size: 0.64rem;
}

.stock-hero--compact .stock-hero__meta {
  margin-top: 1px;
  font-size: 0.66rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-hero--compact .stock-hero__parts {
  gap: 2px 6px;
  margin: 0;
}

.stock-band {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  flex-shrink: 0;
}

.stock-band--watch {
  flex: 1 1 auto;
  min-height: clamp(160px, 28vh, 320px);
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stock-band--market {
  flex: 0 0 auto;
  margin-top: 0;
  max-height: none;
  overflow: visible;
}

.stock-band--positions {
  flex: 0 0 auto;
  flex-shrink: 0;
  height: var(--stock-holds-h);
  min-height: var(--stock-holds-h);
  max-height: var(--stock-holds-h);
  margin-top: auto;
  overflow: hidden;
}

.stock-band--positions[hidden] {
  display: none !important;
}

.stock-band__head {
  display: none !important;
}

.stock-band__kicker,
.stock-band__head h3,
.stock-band__head > div > span {
  display: none !important;
}

.stock-watch-form--inline {
  display: none !important;
}

.stock-tiles {
  display: grid;
  grid-template-columns: repeat(var(--watch-cols, 3), minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  overflow: visible;
  padding: 0;
  align-content: stretch;
}

/* Touch shell paint tips — no layout size changes */
@media (max-width: 1180px) {
  .stock-body {
    contain: layout style;
    /* 보유 6행 · USD 2줄 · 스크롤 없음 (폰·태블릿 공통) */
    --stock-row-h: 44px;
    --stock-thead-h: 24px;
    --stock-pos-max: 6;
    --stock-holds-h: calc(var(--stock-thead-h) + var(--stock-pos-max) * var(--stock-row-h) + 4px);
  }

  .stock-tile,
  .stock-market {
    contain: layout style;
  }

  .stock-band--positions {
    height: var(--stock-holds-h);
    min-height: var(--stock-holds-h);
    max-height: var(--stock-holds-h);
    overflow: hidden;
  }

  .stock-table-wrap.stock-table-wrap--seed,
  .stock-table-wrap--seed {
    height: var(--stock-holds-h);
    min-height: var(--stock-holds-h);
    max-height: var(--stock-holds-h);
    overflow: hidden !important;
    overflow-y: hidden !important;
  }

  /* SOLDOUT · 매수 · 게이지 — 작은 칸에서도 내용 보이게 */
  .stock-tile.is-soldout > *:not(.stock-tile__soldout):not(.stock-tile__media):not(.stock-tile__shade):not(.stock-tile__gauge) {
    filter: saturate(0.88) brightness(0.97);
    opacity: 0.94;
  }

  .stock-tile.is-soldout .stock-tile__media {
    filter: grayscale(0.12) brightness(0.9);
    opacity: 0.88;
  }

  .stock-tile.is-soldout::after {
    background: rgba(10, 12, 14, 0.2) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .stock-tile__soldout {
    z-index: 7;
    font-size: clamp(0.78rem, 2.4vw, 1.15rem);
    letter-spacing: 0.18em;
    text-indent: 0.18em;
    padding: 0.22em 0.42em;
  }

  .stock-tile__buy-signal {
    z-index: 7;
    top: 46%;
    padding: 4px 9px;
    font-size: clamp(0.72rem, 2.2vw, 0.95rem);
    letter-spacing: 0.12em;
    border-width: 1.5px;
  }

  .stock-tile__gauge {
    z-index: 5;
  }

  .stock-tile__gauge-track {
    height: 8px;
  }

  .stock-tile.has-dca-gauge {
    padding-bottom: 10px;
  }

  main.is-sliding {
    pointer-events: none;
  }
}

.stock-tiles--watch {
  --watch-cols: 3;
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
}

.stock-tiles--watch .stock-tile {
  min-height: clamp(120px, 16vh, 180px);
  height: 100%;
  max-height: none;
  padding: 10px 11px 8px;
}

.stock-tiles--watch.is-few .stock-tile {
  min-height: clamp(140px, 18vh, 200px);
}

.stock-tiles--watch.is-many .stock-tile {
  min-height: clamp(110px, 14vh, 160px);
}

.stock-tiles--watch .stock-tile__chart {
  min-height: 52px;
  flex: 1 1 auto;
  max-height: none;
}

.stock-tiles--watch.is-few .stock-tile__chart {
  min-height: 64px;
}

.stock-tiles--pos {
  --pos-cols: 3;
  grid-template-columns: repeat(var(--pos-cols, 3), minmax(0, 1fr));
  max-height: min(32vh, 280px);
  flex: 1 1 auto;
  width: 100%;
}

.stock-markets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  min-height: 0;
}

.stock-market.is-pending .stock-market__price {
  color: var(--muted);
}

.stock-market.is-pending .stock-market__chg {
  color: rgba(180, 190, 200, 0.55);
  font-weight: 600;
}

.stock-market {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1px;
  min-height: clamp(72px, 10vh, 100px);
  height: 100%;
  max-height: none;
  padding: 8px 10px 8px;
  border: 1px solid rgba(240, 215, 138, 0.18);
  border-radius: var(--r-md);
  background:
    linear-gradient(160deg, rgba(232, 199, 107, 0.1) 0%, rgba(8, 10, 14, 0.94) 48%, rgba(4, 6, 10, 0.98) 100%);
  overflow: hidden;
}

.stock-market__media,
.stock-market__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stock-market__media {
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.03);
  filter: saturate(1.06) contrast(1.04);
  transition: transform 360ms ease;
}

.stock-market__shade {
  z-index: 0;
  background:
    linear-gradient(165deg, rgba(4, 8, 12, 0.48) 0%, rgba(4, 7, 10, 0.78) 52%, rgba(3, 5, 8, 0.92) 100%);
}

.stock-market.has-art {
  border-color: rgba(232, 199, 107, 0.22);
  background: rgba(4, 7, 10, 0.9);
}

.stock-market:hover .stock-market__media {
  transform: scale(1.07);
}

.stock-market > :not(.stock-market__media):not(.stock-market__shade) {
  position: relative;
  z-index: 1;
}

.stock-market.is-fx {
  border-color: rgba(110, 200, 255, 0.28);
}

.stock-market.has-art.is-fx {
  border-color: rgba(110, 200, 255, 0.38);
}

.stock-market.is-up .stock-market__chg {
  color: #8fe0b8;
}

.stock-market.is-down .stock-market__chg {
  color: #ff9aa6;
}

.stock-market__label {
  margin: 0;
  color: var(--paper);
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.stock-market__sub {
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stock-market__price {
  margin-top: auto;
  padding-top: 4px;
  color: var(--paper);
  font-family: var(--display);
  font-size: clamp(0.82rem, 1.15vw, 1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.stock-market__chg {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stock-market.is-loading {
  opacity: 0.72;
}

.stock-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 120px;
  padding: 10px 11px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-md);
  background:
    linear-gradient(165deg, rgba(56, 150, 220, 0.09) 0%, rgba(8, 10, 12, 0.94) 52%, rgba(4, 6, 8, 0.98) 100%);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.stock-tile__media,
.stock-tile__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stock-tile__media {
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.04);
  filter: saturate(1.08) contrast(1.05);
  transition: transform 420ms ease, filter 240ms ease;
}

.stock-tile__shade {
  z-index: 0;
  background:
    linear-gradient(165deg, rgba(4, 8, 12, 0.42) 0%, rgba(4, 7, 10, 0.72) 48%, rgba(3, 5, 8, 0.9) 100%);
}

.stock-tile.has-art {
  border-color: rgba(232, 199, 107, 0.22);
  background: rgba(4, 7, 10, 0.88);
}

.stock-tile.has-art.is-held {
  border-color: rgba(240, 215, 138, 0.85);
}

.stock-tile.has-art:hover .stock-tile__media,
.stock-tile.has-art:focus-visible .stock-tile__media {
  transform: scale(1.08);
  filter: saturate(1.14) contrast(1.08);
}

.stock-tile > :not(.stock-tile__media):not(.stock-tile__shade):not(.stock-tile__soldout):not(.stock-tile__kr-closed):not(.stock-tile__gauge) {
  position: relative;
  z-index: 1;
}

.stock-tile:hover,
.stock-tile:focus-visible {
  border-color: rgba(110, 200, 255, 0.45);
  outline: none;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 24px rgba(0, 0, 0, 0.28);
}

.stock-tile.is-held {
  border: 1.5px solid rgba(240, 215, 138, 0.85);
  box-shadow:
    inset 0 0 0 1px rgba(240, 215, 138, 0.28),
    0 0 18px rgba(232, 199, 107, 0.12);
}

.stock-tile.is-held:hover,
.stock-tile.is-held:focus-visible {
  border-color: rgba(255, 224, 140, 0.95);
  box-shadow:
    inset 0 0 0 1px rgba(255, 224, 140, 0.35),
    0 10px 24px rgba(0, 0, 0, 0.28),
    0 0 22px rgba(232, 199, 107, 0.18);
}

.stock-tile__badge--hold {
  border-color: rgba(240, 215, 138, 0.7);
  color: #f0d78a;
  background: rgba(240, 215, 138, 0.14);
}

.stock-tile.is-usd {
  border-color: rgba(140, 200, 255, 0.28);
  background:
    linear-gradient(165deg, rgba(80, 160, 255, 0.14) 0%, rgba(8, 12, 18, 0.94) 48%, rgba(4, 6, 10, 0.98) 100%);
}

.stock-tile.is-held.is-usd {
  border-color: rgba(240, 215, 138, 0.85);
  background:
    linear-gradient(165deg, rgba(240, 215, 138, 0.12) 0%, rgba(8, 12, 18, 0.9) 52%, rgba(4, 6, 10, 0.98) 100%);
}

.stock-tile.is-position {
  min-height: 168px;
  border-color: rgba(240, 215, 138, 0.35);
  background:
    linear-gradient(165deg, rgba(240, 215, 138, 0.14) 0%, rgba(10, 12, 10, 0.94) 52%, rgba(5, 7, 6, 0.98) 100%);
}

.stock-tile.is-up .stock-tile__chg {
  color: #8fe0b8;
}

.stock-tile.is-down .stock-tile__chg {
  color: #ff9aa6;
}

.stock-tile__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.stock-tile__name {
  margin: 0;
  color: var(--paper);
  font-family: var(--display);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.stock-tile__sym {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.stock-tile__badges {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  max-width: 46%;
}

.stock-tile__target {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 200, 90, 0.55);
  background: rgba(20, 14, 4, 0.72);
  box-shadow: 0 0 12px rgba(232, 199, 107, 0.18);
  text-align: right;
}

.stock-tile__target-label {
  color: rgba(240, 215, 138, 0.78);
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.stock-tile__target-val {
  color: #ffe7a0;
  font-family: var(--display);
  font-size: clamp(0.78rem, 1.2vw, 0.95rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* ETF monthly DCA plan badge */
.stock-tile__dca {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  padding: 3px 7px;
  border: 1px solid rgba(120, 200, 255, 0.5);
  background: rgba(8, 18, 28, 0.78);
  box-shadow: 0 0 12px rgba(56, 150, 220, 0.2);
  text-align: right;
  cursor: pointer;
  touch-action: manipulation;
}

.stock-tile__dca-label {
  color: rgba(170, 220, 255, 0.82);
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stock-tile__dca-val {
  color: #c8ecff;
  font-family: var(--display);
  font-size: clamp(0.78rem, 1.2vw, 0.95rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.stock-tile.has-dca .stock-tile__dca {
  opacity: 1;
}

/* ETF 적립 게이지 — 칸 맨 아래, 두껍게 강조 */
.stock-tile__gauge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.stock-tile__gauge-track {
  display: block;
  width: 100%;
  height: 10px;
  margin: 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0 0 calc(var(--r-md) - 1px) calc(var(--r-md) - 1px);
  background: rgba(0, 0, 0, 0.42);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  font-style: normal;
}

.stock-tile__gauge-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8c76b 0%, #7ed6a0 100%);
  box-shadow:
    0 0 12px rgba(126, 214, 160, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: width 280ms ease;
}

.stock-tile__gauge.is-partial .stock-tile__gauge-fill {
  background: linear-gradient(90deg, #e8c76b 0%, #6ec0ff 100%);
  box-shadow:
    0 0 12px rgba(110, 192, 255, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.stock-tile__gauge.is-full .stock-tile__gauge-fill {
  background: linear-gradient(90deg, #5fd98a 0%, #b8f5cc 100%);
  box-shadow:
    0 0 14px rgba(95, 217, 138, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.stock-tile.has-dca-gauge {
  padding-bottom: 12px;
}

.stock-tile.is-soldout .stock-tile__gauge,
.stock-tile.is-kr-closed .stock-tile__gauge {
  opacity: 0.95;
}

.stock-tile__dca.is-done {
  border-color: rgba(160, 160, 160, 0.45);
  background: rgba(20, 20, 22, 0.75);
  box-shadow: none;
}

.stock-tile__dca.is-done .stock-tile__dca-label,
.stock-tile__dca.is-done .stock-tile__dca-val {
  color: rgba(200, 200, 200, 0.55);
}

/* 이번 달 적립 완료 — SOLDOUT 표시하되 칸 내용(가격·차트)은 읽히게 */
.stock-tile.is-soldout {
  position: relative;
}

.stock-tile.is-soldout > *:not(.stock-tile__soldout):not(.stock-tile__media):not(.stock-tile__shade):not(.stock-tile__gauge) {
  filter: saturate(0.85) brightness(0.96);
  opacity: 0.92;
}

.stock-tile.is-soldout .stock-tile__media {
  filter: grayscale(0.15) brightness(0.88);
  opacity: 0.85;
}

.stock-tile.is-soldout::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: inherit;
  background: rgba(10, 12, 14, 0.22);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.stock-tile__soldout {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0.28em 0.55em;
  border: 1px solid rgba(240, 215, 138, 0.45);
  border-radius: 4px;
  background: rgba(12, 10, 6, 0.42);
  color: rgba(245, 228, 170, 0.92);
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  font-weight: 800;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.75),
    0 0 12px rgba(0, 0, 0, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  user-select: none;
}

.stock-tile__soldout[hidden] {
  display: none !important;
}

/* 국내 3종 — 정규장 외 장마감 / 개장 시 문구·오버레이 제거 */
.stock-tile.is-kr-closed::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: inherit;
  background: rgba(6, 10, 16, 0.18);
}

.stock-tile.is-kr-closed.is-kr-hynix::after {
  background: rgba(12, 40, 72, 0.2);
}

.stock-tile.is-kr-closed.is-kr-samsung::after {
  background: rgba(10, 28, 72, 0.2);
}

.stock-tile.is-kr-closed.is-kr-naver::after {
  background: rgba(8, 42, 24, 0.2);
}

.stock-tile__kr-closed {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0.32em 0.65em;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: rgba(8, 12, 18, 0.5);
  color: rgba(245, 248, 255, 0.9);
  font-family: var(--display);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  line-height: 1.1;
  white-space: nowrap;
  pointer-events: none;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 14px rgba(0, 0, 0, 0.45);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  user-select: none;
}

/* 종목 칸 톤에 맞춘 장마감 글자색 */
.stock-tile__kr-closed--hynix {
  color: #9ed8ff;
  border-color: rgba(126, 200, 255, 0.5);
  background: rgba(8, 28, 48, 0.55);
  text-shadow:
    0 1px 2px rgba(0, 20, 40, 0.9),
    0 0 16px rgba(80, 160, 230, 0.35);
}

.stock-tile__kr-closed--samsung {
  color: #7eb0ff;
  border-color: rgba(77, 143, 255, 0.55);
  background: rgba(8, 20, 48, 0.55);
  text-shadow:
    0 1px 2px rgba(0, 12, 40, 0.9),
    0 0 16px rgba(60, 120, 240, 0.35);
}

.stock-tile__kr-closed--naver {
  color: #6ee29a;
  border-color: rgba(62, 207, 122, 0.5);
  background: rgba(6, 32, 18, 0.55);
  text-shadow:
    0 1px 2px rgba(0, 24, 12, 0.9),
    0 0 16px rgba(50, 180, 100, 0.35);
}

.stock-tile__kr-closed[hidden] {
  display: none !important;
}

.stock-tile__buy-signal {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 6;
  transform: translate(-50%, -50%);
  padding: 7px 14px;
  border: 2px solid rgba(255, 70, 90, 0.95);
  background: rgba(120, 8, 22, 0.9);
  color: #ffe9ec;
  font-family: var(--display);
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  box-shadow:
    0 0 0 1px rgba(255, 200, 80, 0.35),
    0 0 28px rgba(255, 50, 70, 0.55),
    0 0 48px rgba(255, 180, 40, 0.25);
  animation: stock-buy-pulse 1.05s ease-in-out infinite;
}

.stock-tile.is-buy-signal {
  border-color: rgba(255, 70, 90, 0.95) !important;
  box-shadow:
    inset 0 0 0 2px rgba(255, 80, 90, 0.55),
    0 0 0 1px rgba(255, 200, 80, 0.45),
    0 0 32px rgba(255, 40, 70, 0.45),
    0 0 52px rgba(255, 180, 50, 0.22) !important;
  animation: stock-buy-glow 1.2s ease-in-out infinite;
}

.stock-tile.is-buy-signal .stock-tile__price {
  color: #ffd0d6;
  text-shadow: 0 0 14px rgba(255, 80, 90, 0.55);
}

@keyframes stock-buy-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.06);
    opacity: 0.88;
  }
}

@keyframes stock-buy-glow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stock-tile__buy-signal,
  .stock-tile.is-buy-signal {
    animation: none;
  }
}

.stock-tile__badge {
  flex-shrink: 0;
  padding: 2px 6px;
  border: 1px solid rgba(240, 215, 138, 0.35);
  color: var(--mal-gold);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.stock-tile__badge--usd {
  border-color: rgba(120, 190, 255, 0.45);
  color: #9fd0ff;
  background: rgba(56, 150, 220, 0.12);
}

.stock-tile__price {
  margin: 7px 0 2px;
  color: var(--paper);
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

.stock-tile.is-usd .stock-tile__price {
  color: #d7ebff;
}

.stock-tile__chg {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stock-tile__pos {
  margin-top: 2px;
  color: rgba(232, 199, 107, 0.78);
  font-size: 0.68rem;
}

.stock-tile__chart {
  flex: 1 1 auto;
  min-height: 54px;
  margin-top: 6px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.2));
}

.stock-tile__chart svg,
.stock-tile__chart .stock-spark {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 48px;
  opacity: 0.85;
}

/* 관심 보유: 스파크 라인 덜 튀게 */
.stock-tiles--watch .stock-tile__chart {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.16));
}

.stock-tiles--watch .stock-tile__chart .stock-spark {
  opacity: 0.78;
  filter: saturate(0.72);
}

/* 타일 하단 고정/해제·삭제 제거 */
.stock-tile__actions,
.stock-tile__pin,
.stock-tile__del {
  display: none !important;
}

.stock-tile.is-loading .stock-tile__chart,
.stock-tile.is-loading .stock-market__chart {
  opacity: 0.45;
}

.stock-tiles__empty {
  grid-column: 1 / -1;
  padding: 22px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 0.86rem;
}

.stock-table-wrap--seed {
  flex: 0 0 auto;
  width: 100%;
  height: var(--stock-holds-h);
  max-height: var(--stock-holds-h);
  min-height: var(--stock-holds-h);
  overflow: hidden !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  overscroll-behavior: none;
  border: 1px solid rgba(240, 215, 138, 0.22);
  border-radius: 2px;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(18, 16, 10, 0.55) 0%, rgba(0, 0, 0, 0.38) 100%);
  box-shadow: inset 0 1px 0 rgba(240, 215, 138, 0.06);
  -webkit-overflow-scrolling: auto;
  touch-action: pan-y;
}

.stock-table--holds {
  width: 100%;
  height: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.stock-table--holds thead {
  display: table-header-group;
}

.stock-table--holds thead tr {
  height: var(--stock-thead-h);
  max-height: var(--stock-thead-h);
}

.stock-table--holds tbody {
  height: calc(var(--stock-pos-max) * var(--stock-row-h));
}

.stock-table--holds tbody tr {
  height: var(--stock-row-h);
  max-height: var(--stock-row-h);
}

.stock-table--holds .stock-col--name {
  width: 32%;
}

.stock-table--holds .stock-col--qty {
  width: 14%;
}

.stock-table--holds .stock-col--val {
  width: 27%;
}

.stock-table--holds .stock-col--pnl {
  width: 27%;
}

.stock-table--holds thead th {
  height: var(--stock-thead-h);
  max-height: var(--stock-thead-h);
  padding: 0 10px;
  line-height: var(--stock-thead-h);
  border-bottom: 1px solid rgba(240, 215, 138, 0.2);
  background: rgba(10, 12, 10, 0.92);
  color: var(--mal-gold);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  box-sizing: border-box;
  overflow: hidden;
}

.stock-table--holds thead th:not(:first-child) {
  text-align: right;
}

.stock-table--holds tbody td {
  height: var(--stock-row-h);
  max-height: var(--stock-row-h);
  padding: 3px 10px;
  line-height: 1.15;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
  overflow: hidden;
  box-sizing: border-box;
}

.stock-table--holds tbody tr:last-child td {
  border-bottom: 0;
}

.stock-hold-row__name {
  display: table-cell;
  min-width: 0;
}

.stock-hold-row__name strong {
  display: inline;
  color: var(--paper);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
}

/* 하단 보유 종목명 톤 */
.stock-hold-row__name strong.stock-hold-name--hynix {
  color: #7ec8ff; /* SK하이닉스 · 하늘 */
}

.stock-hold-row__name strong.stock-hold-name--samsung {
  color: #4d8fff; /* 삼성전자 · 파랑 */
}

.stock-hold-row__name strong.stock-hold-name--naver {
  color: #3ecf7a; /* 네이버 · 초록 */
}

.stock-hold-row__name strong.stock-hold-name--voo {
  color: #ff5c5c; /* VOO · 빨강 */
}

.stock-hold-row__name strong.stock-hold-name--qqqm {
  color: #ff9a3c; /* QQQM · 주황 */
}

.stock-hold-row__name strong.stock-hold-name--schd {
  color: #f0d24a; /* SCHD · 노랑 */
}

.stock-hold-row__name .stock-code {
  display: inline;
  margin-left: 6px;
  margin-top: 0;
  margin-right: 0;
  color: rgba(200, 200, 190, 0.5);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  vertical-align: baseline;
}

.stock-hold-row__name .stock-code--usd {
  margin-left: 5px;
  color: rgba(140, 200, 255, 0.75);
}

.stock-hold-row__num {
  color: var(--paper);
  font-size: 0.74rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.stock-hold-row__stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  max-width: 100%;
  line-height: 1.15;
}

.stock-hold-row__stack strong,
.stock-hold-row__stack span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-hold-row__val-krw {
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stock-hold-row__cost,
.stock-hold-row__val-usd {
  color: rgba(200, 200, 190, 0.55);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.stock-hold-row__pnl strong {
  font-size: 0.72rem;
  font-weight: 700;
}

.stock-hold-row__pnl .stock-hold-row__rate {
  margin: 0;
  color: inherit;
  opacity: 0.78;
  font-size: 0.58rem;
  font-weight: 600;
}

.stock-hold-row.is-up .stock-hold-row__pnl strong,
.stock-hold-row__pnl.is-up strong,
td.is-up.stock-hold-row__pnl strong {
  color: #8fe0b8;
}

.stock-hold-row.is-down .stock-hold-row__pnl strong,
.stock-hold-row__pnl.is-down strong,
td.is-down.stock-hold-row__pnl strong {
  color: #ff9aa6;
}

.stock-table--holds td.is-up {
  color: #8fe0b8;
}

.stock-table--holds td.is-down {
  color: #ff9aa6;
}

.stock-hold-row--slot td {
  color: rgba(255, 255, 255, 0.12);
  background:
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 6px,
      rgba(255, 255, 255, 0.012) 6px,
      rgba(255, 255, 255, 0.012) 12px
    );
}

.stock-hold-row--slot .stock-hold-row__dash {
  color: rgba(240, 215, 138, 0.18);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
}

.stock-table--compact {
  font-size: 0.7rem;
  table-layout: fixed;
}

.stock-table--compact th,
.stock-table--compact td {
  padding: 0 7px;
  height: var(--stock-row-h);
  line-height: var(--stock-row-h);
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-table--holds.stock-table--compact td {
  padding: 3px 10px;
  line-height: 1.15;
}

.stock-table--compact thead th {
  height: var(--stock-thead-h);
  line-height: var(--stock-thead-h);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

.stock-focus {
  display: none;
}

.stock-seed-mini {
  display: none;
}

@media (max-width: 1100px) {
  .stock-markets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .stock-band__head {
    flex-direction: column;
    align-items: stretch;
  }

  .stock-hero--split {
    grid-template-columns: 1fr;
  }

  .stock-hero--compact .stock-hero__eval {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .stock-hero__eval {
    padding: 8px 8px 10px;
    border-right: 0;
    border-bottom: 1px solid rgba(240, 215, 138, 0.18);
  }

  .stock-hero__holds {
    padding: 10px 8px 8px;
  }

  .stock-hold-list--alloc {
    max-height: none;
    flex-direction: row;
    overflow: hidden;
  }

  .stock-hold-list:not(.stock-hold-list--alloc) {
    max-height: 72px;
  }

  .stock-watch-form--inline {
    margin-left: 0;
    max-width: none;
  }

  .stock-tiles {
    grid-template-columns: repeat(var(--watch-cols, 3), minmax(0, 1fr));
    gap: 6px;
  }

  .stock-tiles--watch,
  .stock-tiles--pos {
    max-height: none;
    min-height: 0;
  }

  .stock-tiles--watch .stock-tile,
  .stock-tiles--watch.is-few .stock-tile {
    min-height: 0;
  }

  .stock-markets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Overlays outside main track — avoid transform-containing-block clipping */
body > .stock-zoom,
body > .care-panel,
body > .plan-panel,
body > .shop-modal,
body > .msg-gate,
body > [data-stock-zoom],
body > [data-care-panel],
body > [data-plan-panel] {
  position: fixed;
  z-index: 180;
}

body > .stock-zoom,
.stock-zoom {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  pointer-events: auto;
}

.stock-zoom[hidden] {
  display: none !important;
}

.stock-zoom__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 4, 8, 0.72);
  cursor: pointer;
}

.stock-zoom__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(920px, calc(100vw - 32px));
  max-width: 100%;
  max-height: min(86vh, 720px);
  margin: 0 auto;
  padding: 16px 18px 18px;
  border: 1px solid rgba(240, 215, 138, 0.28);
  border-radius: var(--r-md);
  background:
    linear-gradient(160deg, rgba(20, 24, 30, 0.98) 0%, rgba(6, 8, 12, 0.99) 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  overflow: hidden;
}

.stock-zoom__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  flex-shrink: 0;
}

.stock-zoom__tag {
  margin: 0 0 4px;
  color: var(--mal-gold);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.stock-zoom__head h3 {
  margin: 0;
  color: var(--paper);
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  letter-spacing: -0.04em;
}

.stock-zoom__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.stock-zoom__meta strong {
  color: var(--paper);
  font-family: var(--display);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.stock-zoom__meta span {
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stock-zoom__meta span.is-up {
  color: #7ddea8;
}

.stock-zoom__meta span.is-down {
  color: #ff9b9b;
}

.stock-zoom__chart {
  flex: 1 1 auto;
  min-height: 280px;
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.28);
  padding: 12px 14px;
  overflow: hidden;
  box-sizing: border-box;
}

.stock-zoom__chart svg,
.stock-zoom__chart .stock-spark {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 248px;
  max-width: 100%;
  overflow: visible;
}

.stock-zoom__chart .stock-spark.is-thick {
  opacity: 1;
  filter: none;
}

@media (max-width: 900px) {
  .stock-focus__head {
    flex-direction: column;
    align-items: stretch;
  }

  .stock-watch-form--inline {
    margin-left: 0;
    max-width: none;
  }

  .stock-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
