:root {
    color-scheme: dark;
    --left-ratio: 0.3;
    --middle-ratio: 0.35;
    --right-ratio: 0.35;
    --comparison-height: 340px;
    --gutter-width: 1px;
    --gutter-hit-area: 12px;
    --divider-color: rgba(120, 188, 255, 0.55);
    --divider-color-active: rgba(159, 217, 255, 0.95);
    --bg: #091018;
    --panel: rgba(12, 22, 34, 0.88);
    --panel-strong: rgba(16, 28, 43, 0.96);
    --line: rgba(113, 181, 255, 0.18);
    --text: #edf6ff;
    --muted: #88a0b9;
    --accent: #59c7ff;
    --accent-strong: #24f0c7;
    --warm: #ffc06b;
    --danger: #ff7a7a;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
    --mono: "Consolas", "SFMono-Regular", "Courier New", monospace;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    min-height: 100vh;
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(36, 240, 199, 0.14), transparent 28%),
        radial-gradient(circle at top right, rgba(89, 199, 255, 0.18), transparent 24%),
        linear-gradient(180deg, #0b121b 0%, #081018 100%);
    color: var(--text);
    overflow-y: hidden;
    overflow-x: hidden;
}

.app-shell {
    width: 100vw;
    max-width: none;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar,
.result-panel,
.detail-panel {
    border: 1px solid var(--line);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 0;
    align-items: start;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    background: rgba(8, 16, 24, 0.96);
    flex: 0 0 auto;
}

.eyebrow {
    margin: 0 0 2px;
    color: var(--accent-strong);
    letter-spacing: 0.18em;
    font-size: 10px;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-size: 18px;
    line-height: 1;
}

.subtitle {
    margin-top: 4px;
    max-width: 520px;
    color: var(--muted);
    font-size: 11px;
}

.topbar-left {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex-wrap: wrap;
}

.market-sentiment-strip {
    min-width: 0;
    flex: 1 1 720px;
    display: flex;
    align-items: stretch;
    align-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    overflow: visible;
    white-space: normal;
}

.market-sentiment-item {
    min-width: 0;
    flex: 0 1 auto;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 3px;
    padding: 4px 8px 5px;
    border-radius: 10px;
    border: 1px solid rgba(89, 199, 255, 0.14);
    background: linear-gradient(180deg, rgba(11, 21, 32, 0.92), rgba(7, 14, 22, 0.92));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    font-size: 10px;
    line-height: 1.2;
}

.market-sentiment-item-market {
    flex: 1.2 1 280px;
    border-color: rgba(89, 199, 255, 0.24);
    background: linear-gradient(180deg, rgba(8, 28, 40, 0.94), rgba(6, 17, 28, 0.94));
}

.market-sentiment-item-limit {
    flex: 1.55 1 360px;
    border-color: rgba(255, 192, 107, 0.3);
    background: linear-gradient(180deg, rgba(41, 24, 7, 0.94), rgba(23, 13, 4, 0.94));
}

.market-sentiment-item-fund {
    flex: 0.82 1 190px;
    border-color: rgba(36, 240, 199, 0.24);
    background: linear-gradient(180deg, rgba(7, 35, 28, 0.94), rgba(5, 18, 16, 0.94));
}

.market-sentiment-item-index {
    flex: 1 1 260px;
    border-color: rgba(177, 148, 255, 0.28);
    background: linear-gradient(180deg, rgba(22, 18, 44, 0.94), rgba(12, 10, 24, 0.94));
}

.market-sentiment-item-etf-bond {
    border-color: rgba(255, 122, 122, 0.24);
    background: linear-gradient(180deg, rgba(44, 17, 17, 0.94), rgba(24, 10, 10, 0.94));
}

.market-sentiment-value {
    min-width: 0;
    color: #d6e8f8;
    display: flex;
    flex-wrap: wrap;
    gap: 3px 5px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.market-sentiment-metric {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.market-sentiment-metric-label {
    color: rgba(214, 232, 248, 0.72);
}

.market-sentiment-metric-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.market-sentiment-metric-positive {
    background: rgba(255, 95, 109, 0.12);
    border-color: rgba(255, 95, 109, 0.2);
}

.market-sentiment-metric-positive .market-sentiment-metric-value {
    color: #ff8a96;
}

.market-sentiment-metric-negative {
    background: rgba(67, 205, 128, 0.12);
    border-color: rgba(67, 205, 128, 0.2);
}

.market-sentiment-metric-negative .market-sentiment-metric-value {
    color: #71e09b;
}

.market-sentiment-metric-neutral {
    background: rgba(89, 199, 255, 0.1);
    border-color: rgba(89, 199, 255, 0.16);
}

.market-sentiment-metric-neutral .market-sentiment-metric-value {
    color: #9ddcff;
}

.market-sentiment-empty {
    color: var(--muted);
    font-size: 10px;
}

.status-strip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
    min-width: 0;
    width: 320px;
    max-width: 100%;
}

.status-chip {
    min-width: 0;
    width: 100%;
    padding: 1px 5px;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(15, 26, 38, 0.86), rgba(9, 18, 27, 0.86));
    border: 1px solid rgba(89, 199, 255, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.control-status-chip {
    justify-content: flex-start;
}

.status-pair {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
}

.status-divider {
    width: 1px;
    height: 12px;
    background: rgba(89, 199, 255, 0.18);
}

.hover-chart-toggle-chip {
    min-width: 74px;
}

.hover-chart-toggle-button {
    width: auto;
    min-width: 0;
    padding: 2px 6px;
    font-size: 10px;
    line-height: 1.1;
}

.membership-status-pair {
    margin-left: auto;
    gap: 4px;
}

.status-label {
    display: inline-block;
    color: var(--muted);
    font-size: 8px;
    margin-bottom: 0;
    line-height: 1;
    letter-spacing: 0.02em;
}

.status-chip strong {
    font-size: 10px;
    line-height: 1;
}

.tool-button,
.secondary-button {
    border: 1px solid rgba(89, 199, 255, 0.22);
    background: rgba(8, 16, 24, 0.92);
    color: var(--text);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.tool-button.active {
    border-color: rgba(36, 240, 199, 0.55);
    background: linear-gradient(180deg, rgba(20, 49, 58, 0.95), rgba(7, 20, 27, 0.95));
}

.tool-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.result-panel,
.detail-panel {
    padding: 8px 10px;
    border-radius: 0;
    min-height: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 4px;
}

.panel-subtitle {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(89, 199, 255, 0.12);
    color: var(--accent);
    font-size: 11px;
}

.pill.ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.result-list {
    display: grid;
    gap: 10px;
    max-height: 740px;
    overflow: auto;
    padding-right: 4px;
}

.result-item {
    border: 1px solid rgba(89, 199, 255, 0.12);
    border-radius: 18px;
    padding: 16px;
    background: rgba(10, 18, 28, 0.92);
    cursor: pointer;
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.result-item:hover {
    transform: translateY(-1px);
    border-color: rgba(89, 199, 255, 0.38);
    background: rgba(11, 22, 36, 0.96);
}

.result-item.active {
    border-color: rgba(36, 240, 199, 0.55);
    background: linear-gradient(180deg, rgba(12, 30, 38, 0.96), rgba(7, 17, 25, 0.96));
}

.code-row,
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
}

.code-row strong {
    font-size: 17px;
}

.code-tag {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    font-family: var(--mono);
    font-size: 12px;
    color: var(--warm);
}

.pair-arrow {
    color: var(--accent-strong);
}

.meta-row {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.detail-card {
    border: 1px solid rgba(89, 199, 255, 0.12);
    border-radius: 24px;
    background: var(--panel-strong);
    padding: 22px;
}

.detail-card.empty {
    color: var(--muted);
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

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

.detail-title h3 {
    font-size: 24px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.field span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.field strong {
    font-size: 15px;
    word-break: break-all;
}

.future-tools {
    margin-top: 20px;
}

.future-tools h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.future-grid {
    display: grid;
    gap: 12px;
}

.future-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px dashed rgba(89, 199, 255, 0.18);
    background: rgba(255, 255, 255, 0.02);
}

.future-card strong {
    display: block;
    margin-bottom: 8px;
}

.future-card p {
    color: var(--muted);
    font-size: 13px;
}

.empty-list {
    padding: 30px 16px;
    border-radius: 18px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed rgba(89, 199, 255, 0.14);
}

.table-panel {
    margin-top: 0;
}

.workspace-grid {
    display: grid;
    grid-template-columns:
        minmax(0px, calc((100% - (var(--gutter-width) * 2)) * var(--left-ratio)))
        var(--gutter-width)
        minmax(0px, calc((100% - (var(--gutter-width) * 2)) * var(--middle-ratio)))
        var(--gutter-width)
        minmax(0px, calc((100% - (var(--gutter-width) * 2)) * var(--right-ratio)));
    gap: 0;
    margin-top: 0;
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
    overflow: hidden;
}

.comparison-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 0 0 var(--comparison-height);
    min-height: 260px;
    padding: 6px 10px 8px;
    border: 1px solid var(--line);
    border-left: 0;
    border-right: 0;
    background:
        linear-gradient(180deg, rgba(8, 14, 22, 0.98), rgba(4, 8, 12, 0.98)),
        radial-gradient(circle at top right, rgba(61, 130, 214, 0.08), transparent 28%);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.horizontal-resize-gutter {
    position: relative;
    height: var(--gutter-hit-area);
    flex: 0 0 var(--gutter-hit-area);
    cursor: row-resize;
    user-select: none;
    touch-action: none;
    background: transparent;
    z-index: 5;
}

.horizontal-resize-gutter::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: var(--gutter-width);
    transform: translateY(-50%);
    background: var(--divider-color);
    box-shadow: 0 0 0 transparent;
    transition: background-color 80ms ease, box-shadow 80ms ease, opacity 80ms ease;
}

.horizontal-resize-gutter:hover,
.horizontal-resize-gutter.is-hovering,
.horizontal-resize-gutter.is-dragging {
    background: rgba(159, 217, 255, 0.08);
}

.horizontal-resize-gutter:hover::before,
.horizontal-resize-gutter.is-hovering::before,
.horizontal-resize-gutter.is-dragging::before {
    background: var(--divider-color-active);
    box-shadow: 0 0 12px rgba(159, 217, 255, 0.48);
}

.comparison-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.comparison-panel-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.comparison-panel-subtitle {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comparison-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(89, 199, 255, 0.14);
    background: rgba(89, 199, 255, 0.08);
    color: #a9e8ff;
    font-size: 11px;
    white-space: nowrap;
}

.comparison-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
}

.comparison-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 4px;
    border: 1px solid rgba(89, 199, 255, 0.18);
    border-radius: 10px;
    background: rgba(4, 9, 14, 0.98);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.comparison-card-chart-only {
    padding: 0;
    overflow: hidden;
}

.comparison-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.comparison-card-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.comparison-card-subtitle {
    color: var(--muted);
    font-size: 10px;
}

.comparison-card-meta {
    min-width: 0;
    max-width: 58%;
    color: #d8f6ff;
    font-size: 10px;
    line-height: 1.35;
    text-align: right;
}

.comparison-chart-panel {
    flex: 1 1 auto;
    min-height: 0;
    border: 0;
    border-radius: 9px;
    overflow: hidden;
    background:
        linear-gradient(180deg, #060b11 0%, #04080d 100%);
    position: relative;
}

.comparison-chart-panel canvas {
    display: block;
}

.embed-panel,
.stock-panel,
.bond-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.embed-panel {
    background: rgba(10, 22, 19, 0.96);
    border-left: 0;
    border-right: 0;
}

.stock-panel {
    background: rgba(22, 31, 16, 0.96);
    border-left: 0;
    border-right: 0;
}

.bond-panel {
    background: rgba(12, 23, 35, 0.96);
    border-left: 0;
    border-right: 0;
}

.resize-gutter {
    position: relative;
    width: var(--gutter-hit-area);
    min-height: 0;
    cursor: col-resize;
    user-select: none;
    touch-action: none;
    border-radius: 0;
    justify-self: center;
    margin-left: calc((var(--gutter-hit-area) - var(--gutter-width)) / -2);
    margin-right: calc((var(--gutter-hit-area) - var(--gutter-width)) / -2);
    background: transparent;
    z-index: 5;
}

.resize-gutter::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: var(--gutter-width);
    transform: translateX(-50%);
    background: var(--divider-color);
    box-shadow: 0 0 0 transparent;
    transition: background-color 80ms ease, box-shadow 80ms ease, opacity 80ms ease;
}

.resize-gutter:hover,
.resize-gutter.is-hovering,
.resize-gutter.is-dragging {
    background: rgba(159, 217, 255, 0.08);
}

.resize-gutter:hover::before,
.resize-gutter.is-hovering::before,
.resize-gutter.is-dragging::before {
    background: var(--divider-color-active);
    box-shadow: 0 0 12px rgba(159, 217, 255, 0.48);
}

body.is-resizing {
    cursor: col-resize;
    user-select: none;
}

body.is-resizing-vertical {
    cursor: row-resize;
    user-select: none;
}

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 12px;
}

.panel-title-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.panel-refresh-button {
    min-width: 52px;
    padding: 4px 8px;
    font-size: 11px;
}

.panel-updated-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(89, 199, 255, 0.14);
    background: rgba(89, 199, 255, 0.05);
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
}

.filter-search-field {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.filter-search-input {
    width: 140px;
    height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(89, 199, 255, 0.18);
    border-radius: 999px;
    background: rgba(8, 16, 24, 0.92);
    color: var(--text);
    font-size: 11px;
    outline: none;
}

.filter-search-input::placeholder {
    color: var(--muted);
}

.filter-search-input:focus {
    border-color: rgba(89, 199, 255, 0.5);
    box-shadow: 0 0 0 1px rgba(89, 199, 255, 0.16);
}

.panel-subtitle-text {
    color: var(--muted);
    font-size: 10px;
}

.filter-status-badge {
    display: inline-flex;
    align-items: center;
    max-width: 240px;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    border: 1px solid rgba(89, 199, 255, 0.18);
    background: rgba(89, 199, 255, 0.08);
    color: #a9e8ff;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-clear-button {
    padding: 4px 9px;
    font-size: 11px;
    white-space: nowrap;
}

.is-hidden {
    display: none !important;
}

.iframe-wrap {
    flex: 1;
    min-height: 0;
    border: 1px solid rgba(89, 199, 255, 0.12);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(7, 15, 23, 0.96);
}

.tool-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #081018;
}

.table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    border: 1px solid rgba(89, 199, 255, 0.14);
    border-radius: 8px;
    flex: 1;
    min-height: 0;
    max-height: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scrollbar-color: rgba(120, 188, 255, 0.72) rgba(20, 34, 48, 0.35);
}

.table-wrap::-webkit-scrollbar {
    width: 0;
    height: 6px;
}

.table-wrap::-webkit-scrollbar-track {
    background: rgba(20, 34, 48, 0.35);
    border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: rgba(120, 188, 255, 0.72);
    border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(159, 217, 255, 0.9);
}

.mapping-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 10px;
}

.mapping-table thead th {
    position: static;
    background: rgba(7, 15, 23, 0.98);
    color: var(--text);
    border-bottom: 1px solid rgba(89, 199, 255, 0.18);
    padding: 2px 1px;
    text-align: left;
    white-space: nowrap;
    font-size: 10px;
    line-height: 1.02;
}

.mapping-table thead th[data-sort-key] {
    cursor: pointer;
    user-select: none;
}

.mapping-table thead th.is-column-draggable {
    position: relative;
    padding-right: 12px;
}

.mapping-table thead th.is-column-draggable::after {
    content: "⋮⋮";
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(137, 186, 225, 0.7);
    font-size: 8px;
    letter-spacing: -1px;
    pointer-events: none;
}

.mapping-table thead th.is-column-dragging {
    opacity: 0.45;
}

.mapping-table thead th.is-column-drop-target {
    box-shadow: inset 0 -2px 0 rgba(89, 199, 255, 0.9);
}

.mapping-table thead tr.group-row th {
    position: static;
    top: auto;
    z-index: 1;
    background: linear-gradient(180deg, rgba(11, 30, 37, 0.98), rgba(8, 15, 24, 0.98));
    color: var(--accent-strong);
    text-align: center;
    font-size: 10px;
    letter-spacing: 0.08em;
    padding: 3px 1px;
}

.mapping-table thead tr:not(.group-row) th {
    position: sticky;
    top: 0;
    z-index: 3;
}

.mapping-table thead tr.group-row th:first-child {
    background: linear-gradient(180deg, rgba(32, 41, 26, 0.98), rgba(14, 22, 13, 0.98));
    color: #a5ef98;
}

.bond-table thead tr.group-row th:first-child {
    background: linear-gradient(180deg, rgba(25, 43, 58, 0.98), rgba(10, 21, 33, 0.98));
    color: #7fdcff;
}

.mapping-table tbody td {
    padding: 0 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    line-height: 1.02;
}

.mapping-table th,
.mapping-table td {
    width: auto;
    min-width: 0;
    max-width: none;
}

.mapping-table tbody tr:nth-child(odd) {
    background: rgba(8, 16, 24, 0.78);
}

.mapping-table tbody tr:nth-child(even) {
    background: rgba(10, 19, 29, 0.92);
}

.mapping-table tbody tr:hover {
    background: rgba(20, 38, 54, 0.95);
}

.mapping-table tbody tr.is-linked-hover {
    background: linear-gradient(180deg, rgba(22, 56, 76, 0.98), rgba(14, 34, 50, 0.98)) !important;
    box-shadow: inset 0 0 0 1px rgba(108, 212, 255, 0.6);
}

.mapping-table tbody tr.is-focused-target {
    background: linear-gradient(180deg, rgba(66, 56, 12, 0.98), rgba(42, 32, 8, 0.98)) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 196, 84, 0.72);
}

.mapping-table tbody tr.is-comparison-selected {
    background: linear-gradient(180deg, rgba(18, 49, 66, 0.98), rgba(10, 31, 44, 0.98)) !important;
    box-shadow: inset 0 0 0 1px rgba(89, 199, 255, 0.72);
}

.mapping-table tbody tr.is-comparison-selected .stock-link {
    color: #d8f6ff;
}

.stock-table tbody td {
    background: rgba(44, 58, 24, 0.14);
}

.bond-table tbody td {
    background: rgba(20, 40, 58, 0.14);
}

.mono-cell {
    font-family: var(--mono);
    color: var(--warm);
    font-size: 10px;
}

.name-cell {
    font-weight: 600;
}

.stock-link {
    color: inherit;
    text-decoration: none;
}

.stock-link:hover {
    text-decoration: underline;
}

.stock-link.is-linked-hover {
    color: #d8f6ff;
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(89, 199, 255, 0.35);
}

.stock-name-link {
    font-weight: 600;
}

.stock-code-link {
    color: var(--warm);
}

.up {
    color: #ff7f7f !important;
}

.down {
    color: #48d597 !important;
}

.empty-cell {
    padding: 36px 16px !important;
    text-align: center;
    color: var(--muted) !important;
}

.stock-hover-chart-popup {
    position: fixed;
    left: 0;
    top: 0;
    width: 592px;
    padding: 8px;
    border: 1px solid rgba(89, 199, 255, 0.22);
    border-radius: 10px;
    background: rgba(6, 12, 18, 0.97);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
    z-index: 40;
    pointer-events: none;
}

.stock-hover-chart-popup.is-hidden {
    display: none;
}

.stock-hover-chart-popup .popup-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.stock-hover-chart-popup .popup-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.stock-hover-chart-popup .popup-meta {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--warm);
}

.stock-hover-chart-popup .popup-status {
    min-height: 16px;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--muted);
}

.stock-hover-chart-popup .chart-panel {
    min-height: 0;
    border: 1px solid rgba(89, 199, 255, 0.12);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(8, 15, 24, 0.98);
}

.stock-hover-chart-popup .chart-panel + .chart-panel {
    margin-top: 6px;
}

.chart-svg {
    display: block;
    width: 100%;
    height: auto;
}

.chart-image-shell {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: rgba(5, 11, 18, 0.96);
}

.chart-image-fallback {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: rgba(5, 11, 18, 0.96);
}

.chart-empty {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c8096;
    font-size: 12px;
    background: linear-gradient(180deg, #060b11 0%, #04080d 100%);
}

@media (max-width: 1080px) {
    .topbar {
        grid-template-columns: 1fr;
    }

    .status-strip {
        align-items: stretch;
    }

    .workspace-grid {
        gap: 0;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 900px) {
    .app-shell {
        overflow-y: auto;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
        flex: 0 0 auto;
        min-height: 0;
    }

    .comparison-panel {
        flex: 0 0 auto;
        min-height: 560px;
    }

    .resize-gutter {
        display: none;
    }

    .horizontal-resize-gutter {
        display: none;
    }

    .embed-panel,
    .stock-panel,
    .bond-panel {
        border-left: 0;
        border-right: 0;
    }

    .iframe-wrap,
    .table-wrap {
        min-height: 420px;
    }
}

@media (max-width: 760px) {
    .app-shell {
        width: 100vw;
        padding: 0;
    }

    h1 {
        font-size: 18px;
    }

    .status-strip {
        align-items: stretch;
    }

    .market-sentiment-strip {
        flex-basis: 100%;
    }

    .market-sentiment-item {
        flex-basis: 100%;
    }
}
