/* Stock heatmap, ranking, sector mover, and related home market visual styles. */

.mvp-chart-panel {
        margin-bottom: 12px;
        border: 0.5px solid rgba(255, 176, 32, 0.18);
        border-left: 2px solid rgba(255, 176, 32, 0.56);
        background:
          linear-gradient(180deg, rgba(12, 17, 24, 0.96), rgba(7, 10, 15, 0.96)),
          repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 72px);
        padding: 12px;
      }

.mvp-chart-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 10px;
      }

.mvp-chart-head h2 {
        margin: 2px 0 0;
        color: var(--text);
        font-size: 18px;
        font-weight: 950;
        letter-spacing: 0;
      }

.mvp-chart-head p {
        margin: 4px 0 0;
        color: rgba(232, 237, 248, 0.48);
        font-size: 11px;
        font-weight: 750;
      }

.market-data-status {
        display: inline-flex;
        align-items: center;
        min-height: 24px;
        border: 0.5px solid rgba(112, 128, 148, 0.28);
        background: rgba(20, 28, 39, 0.78);
        color: rgba(219, 231, 245, 0.88);
        padding: 3px 8px;
        font-family: "Roboto Mono", "Pretendard", Consolas, monospace;
        font-size: 10px;
        font-weight: 900;
        white-space: nowrap;
      }

.market-data-status[data-status="loading"] {
        border-color: rgba(76, 179, 255, 0.42);
        background: rgba(22, 67, 105, 0.42);
        color: #b9ddff;
      }

.market-data-status[data-status="success"] {
        border-color: rgba(53, 227, 140, 0.38);
        background: rgba(19, 84, 52, 0.42);
        color: #c9f8df;
      }

.market-data-status[data-status="fallback"],
.market-data-status[data-status="sample-held"] {
        border-color: rgba(255, 212, 90, 0.42);
        background: rgba(110, 75, 20, 0.42);
        color: #ffe7b0;
      }

.market-data-status[data-status="empty"],
.market-data-status[data-status="error"] {
        border-color: rgba(255, 77, 109, 0.42);
        background: rgba(102, 31, 45, 0.46);
        color: #ffc4ce;
      }

.new-main-chart-controls {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 7px;
        min-height: 34px;
        margin-bottom: 10px;
        border: 0.5px solid rgba(112, 128, 148, 0.24);
        background: rgba(4, 7, 11, 0.78);
        padding: 6px 8px;
      }

.new-main-chart-mode-label {
        flex: 0 0 auto;
        color: rgba(217, 236, 255, 0.82);
        font-family: "Roboto Mono", "Pretendard", Consolas, monospace;
        font-size: 10px;
        font-weight: 900;
      }

.new-main-chart-controls button {
        height: 24px;
        border: 0.5px solid rgba(231, 237, 245, 0.22);
        background: #0a1018;
        color: rgba(255, 255, 255, 0.72);
        cursor: pointer;
        padding: 0 8px;
        font-family: "Roboto Mono", "Pretendard", Consolas, monospace;
        font-size: 10px;
        font-weight: 900;
      }

.new-main-chart-controls button.is-active {
        border-color: rgba(76, 179, 255, 0.58);
        background: #112235;
        color: #d9ecff;
      }

.new-main-chart-controls button:hover {
        border-color: rgba(255, 255, 255, 0.58);
      }

.new-main-chart-container {
        position: relative;
        width: 100%;
        height: clamp(420px, 48vh, 560px);
        min-height: 420px;
        overflow: hidden;
        border: 0.5px solid rgba(255, 255, 255, 0.09);
        background: #0c1016;
      }

.new-main-chart-container[hidden] {
        display: none;
      }

.new-main-chart-container .chart-engine-canvas {
        display: block;
        width: 100%;
        height: 100%;
        background: #0c1016;
      }

@media (max-width: 980px) {
        .mvp-chart-head {
          display: grid;
        }

        .new-main-chart-container {
          height: 380px;
          min-height: 380px;
        }
      }

.home-heatmap {
        padding: 10px;
        margin-bottom: 0;
      }

.sector-legend {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: rgba(232, 237, 248, 0.54);
        font-size: 10px;
        font-weight: 800;
      }

.sector-legend span {
        display: inline-flex;
        align-items: center;
        gap: 4px;
      }

.sector-legend i {
        width: 9px;
        height: 5px;
        display: inline-block;
      }

.sector-legend i.kospi {
        background: #19aee6;
      }

.sector-legend i.kosdaq {
        background: #ffe600;
      }

.news-digest-list,
      .sector-mover-list {
        display: grid;
        gap: 7px;
      }

.news-action-card:last-child,
      .sector-mover-row:last-child {
        border-bottom: 0;
      }

.sector-mover-row {
        display: grid;
        grid-template-columns: 58px minmax(130px, 1fr) 74px;
        gap: 8px;
        min-height: 58px;
        border-bottom: 0.5px solid rgba(255, 255, 255, 0.045);
        padding: 7px 0;
      }

.sector-mover-name {
        min-width: 0;
        color: var(--text);
        font-size: 12px;
        font-weight: 800;
      }

.sector-mover-name small {
        display: block;
        margin-top: 3px;
        overflow: hidden;
        color: var(--faint);
        font-size: 10px;
        font-weight: 600;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

.sector-bars {
        display: grid;
        align-content: center;
        gap: 5px;
        min-width: 0;
      }

.sector-bar-line {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr);
        align-items: center;
        gap: 6px;
      }

.sector-bar-value {
        font-size: 10px;
        font-variant-numeric: tabular-nums;
        font-weight: 900;
        line-height: 1;
        text-align: right;
        white-space: nowrap;
      }

.sector-bar-value.kospi {
        color: #19aee6;
      }

.sector-bar-value.kosdaq {
        color: #ffe600;
      }

.sector-bar-track {
        height: 7px;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.045);
      }

.sector-bar {
        height: 100%;
        min-width: 2px;
      }

.sector-bar.kospi {
        background: #19aee6;
      }

.sector-bar.kosdaq {
        background: #ffe600;
      }

.market-map-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 3px 3px 9px;
      }

.market-map-title {
        color: var(--text);
        font-size: 13px;
        font-weight: 600;
      }

.market-map-title span {
        margin-left: 7px;
        color: var(--faint);
        font-size: 10px;
        font-weight: 400;
      }

.market-map-legend {
        display: grid;
        grid-template-columns: repeat(7, 36px);
        overflow: hidden;
        border-radius: 6px;
        color: #fff;
        text-align: center;
        font-size: 10px;
        line-height: 20px;
      }

.market-map {
        position: relative;
        height: clamp(520px, 56vw, 680px);
        min-height: 520px;
        overflow: hidden;
        border: 0.5px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        background: #0f1219;
      }

.market-map-canvas {
        position: absolute;
        top: 0;
        left: 0;
        transform: translate3d(0, 0, 0);
      }

.map-sector {
        position: absolute;
        overflow: hidden;
        background: #141923;
        border: 0.5px solid rgba(255, 255, 255, 0.12);
      }

.map-grid {
        position: absolute;
        inset: 18px 0 0;
        overflow: hidden;
      }

.map-tile {
        position: absolute;
        padding: 3px;
        border: 0.5px solid rgba(10, 12, 16, 0.82);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        text-align: center;
        cursor: crosshair;
      }

.map-tile:hover,
      .map-tile:focus-visible {
        z-index: 3;
        border-color: rgba(255, 232, 185, 0.95);
        box-shadow:
          inset 0 0 0 1px rgba(255, 176, 32, 0.72),
          0 0 0 1px rgba(0, 0, 0, 0.65);
      }

.heatmap-tooltip {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 120;
        width: 246px;
        border: 0.5px solid rgba(255, 176, 32, 0.36);
        background: rgba(7, 10, 15, 0.94);
        box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
        color: var(--text);
        opacity: 0;
        pointer-events: none;
        transform: translate3d(-9999px, -9999px, 0);
        transition: opacity 90ms ease;
      }

.heatmap-tooltip.visible {
        opacity: 1;
      }

.heatmap-tooltip-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        border-bottom: 0.5px solid rgba(255, 176, 32, 0.18);
        padding: 9px 10px 7px;
      }

.heatmap-tooltip-name {
        color: #fff;
        font-size: 16px;
        font-weight: 900;
        line-height: 1.05;
      }

.heatmap-tooltip-sector {
        margin-top: 4px;
        color: rgba(232, 237, 248, 0.48);
        font-size: 10px;
        font-weight: 800;
      }

.heatmap-tooltip-change {
        font-size: 16px;
        font-weight: 900;
        text-align: right;
        white-space: nowrap;
      }

.heatmap-tooltip-change.green {
        color: var(--green);
      }

.heatmap-tooltip-change.red {
        color: var(--red);
      }

.heatmap-tooltip-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1px;
        background: rgba(255, 255, 255, 0.045);
      }

.heatmap-tooltip-grid span,
      .heatmap-tooltip-news {
        background: rgba(0, 0, 0, 0.18);
        padding: 7px 8px;
      }

.heatmap-tooltip-grid small,
      .heatmap-tooltip-news small {
        display: block;
        margin-bottom: 4px;
        color: rgba(232, 237, 248, 0.42);
        font-size: 9px;
        font-weight: 900;
      }

.heatmap-tooltip-grid b,
      .heatmap-tooltip-news b {
        color: rgba(232, 237, 248, 0.86);
        font-size: 11px;
        font-weight: 850;
      }

.heatmap-tooltip-news {
        border-top: 0.5px solid rgba(255, 255, 255, 0.055);
      }

.map-ticker {
        max-width: 100%;
        color: #fff;
        font-size: 11px;
        font-weight: 800;
        line-height: 1.05;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

.map-change {
        margin-top: 3px;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        line-height: 1.05;
      }

.map-tile.compact .map-ticker,
      .map-tile.micro .map-ticker,
      .map-tile.micro .map-change {
        display: none;
      }

.map-tile.compact .map-change {
        margin-top: 0;
        font-size: 9px !important;
        font-weight: 900;
      }

.ranking-panel {
        padding: 14px;
        margin-bottom: 22px;
      }

.home-market-column .ranking-panel {
        margin-bottom: 0;
      }

.ranking-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
      }

.ranking-title {
        color: var(--text);
        font-size: 13px;
        font-weight: 600;
      }

.ranking-title span {
        margin-left: 7px;
        color: var(--faint);
        font-size: 10px;
        font-weight: 400;
      }

.ranking-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
      }

.ranking-group {
        min-width: 0;
        border: 0.5px solid rgba(255, 255, 255, 0.07);
        border-radius: 8px;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.018);
      }

.ranking-group-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 32px;
        padding: 0 10px;
        border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
        color: rgba(221, 225, 236, 0.72);
        font-size: 11px;
        font-weight: 700;
      }

.ranking-group-title span {
        color: var(--faint);
        font-size: 10px;
        font-weight: 500;
      }

.ranking-list {
        display: grid;
      }

.ranking-row {
        position: relative;
        display: grid;
        grid-template-columns: minmax(64px, 1fr) 74px minmax(58px, auto) minmax(52px, auto) minmax(42px, auto);
        align-items: center;
        gap: 6px;
        min-height: 42px;
        padding: 8px;
        border-bottom: 0.5px solid rgba(255, 255, 255, 0.045);
        will-change: transform;
      }

.ranking-row.rank-shuffling {
        z-index: 2;
        box-shadow: inset 3px 0 0 rgba(255, 176, 32, 0.5);
      }

.ranking-row.tick-flash {
        animation: tickFlash 520ms ease;
      }

@keyframes tickFlash {
        0% {
          background: rgba(255, 176, 32, 0.13);
        }
        100% {
          background: transparent;
        }
      }

.ranking-row:last-child {
        border-bottom: 0;
      }

.ranking-name {
        min-width: 0;
        color: var(--text);
        font-size: 12px;
        font-weight: 700;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

.ranking-chart {
        width: 74px;
        height: 24px;
      }

.ranking-price {
        color: rgba(221, 225, 236, 0.78);
        font-size: 11px;
        font-weight: 700;
        text-align: right;
        white-space: nowrap;
      }

.ranking-change {
        font-size: 11px;
        font-weight: 800;
        text-align: right;
        white-space: nowrap;
      }

.ranking-sentiment {
        justify-self: end;
        padding: 3px 7px;
        border-radius: 5px;
        font-size: 10px;
        font-weight: 700;
        white-space: nowrap;
      }

.ranking-sentiment.positive {
        background: rgba(43, 196, 138, 0.12);
        color: var(--green);
      }

.ranking-sentiment.negative {
        background: rgba(224, 82, 82, 0.12);
        color: var(--red);
      }

.ranking-sentiment.neutral {
        background: rgba(91, 156, 246, 0.12);
        color: var(--blue);
      }
