* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0; padding: 0; background: #f9f9fb; color: #333;
}
.sh-topbar {
    background: #fff;
    border-bottom: 1px solid var(--tr-line);
    padding: 0 40px;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.sh-nav-area { display: flex; align-items: center; gap: 40px; height: 100%; }
.sh-brand { font-family: Georgia, serif; font-size: 18px; font-weight: bold; color: var(--tr-ink); }
.sh-nav-links { display: flex; height: 100%; gap: 24px; }
.sh-nav-link {
    color: var(--tr-muted); text-decoration: none; font-size: 14px; font-weight: 500;
    display: flex; align-items: center; height: 100%; position: relative;
    border-bottom: 2px solid transparent; padding: 0 4px;
}
.sh-nav-link:hover { color: var(--tr-ink); }
.sh-nav-link.active { color: var(--tr-accent); border-bottom-color: var(--tr-accent); }

.sh-filters { display: flex; align-items: center; gap: 12px; }
.sh-capsule {
    display: inline-flex; align-items: center; gap: 6px; height: 32px;
    padding: 0 12px; border-radius: 8px; background: var(--tr-surface);
    border: 1px solid var(--tr-line); font-size: 13px; color: var(--tr-ink);
    cursor: pointer; position: relative; user-select: none;
}
.sh-capsule:hover { background: var(--tr-bg); }
.sh-icon { width: 14px; height: 14px; fill: var(--tr-muted); }
.sh-chevron { width: 14px; height: 14px; fill: var(--tr-faint); margin-left: 2px; }
.sh-hidden-select { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer;}
.sh-toggle-capsule { cursor: pointer; }
.sh-checkbox { display: none; }
.sh-checkbox-box {
    width: 14px; height: 14px; border: 1px solid var(--tr-faint); border-radius: 3px;
    display: inline-flex; align-items: center; justify-content: center; background: #fff;
}
.sh-checkbox:checked + .sh-checkbox-box { background: var(--tr-accent); border-color: var(--tr-accent); }
.sh-checkbox:checked + .sh-checkbox-box::after { content: ''; width: 4px; height: 8px; border: solid white; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin-bottom: 2px; }
.sh-window-wrapper { position: relative; }
.sh-window-panel {
    position: absolute; top: calc(100% + 4px); right: 0; width: 280px;
    background: #fff; border: 1px solid var(--tr-line); border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 101; font-size: 13px;
}
.sh-panel-head { padding: 12px 16px 8px; font-weight: 500; color: var(--tr-faint); font-size: 12px; }
.sh-window-item {
    padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; cursor: pointer;
}
.sh-window-item:hover { background: var(--tr-bg); }
.sh-window-item.selected { background: var(--tr-accent-soft); }
.sh-window-item.selected .w-label { color: var(--tr-accent); font-weight: 500; }
.sh-window-item.selected::after { content: '✓'; color: var(--tr-accent); font-weight: bold; }
.w-desc { color: var(--tr-faint); font-size: 12px; }
.sh-divider { height: 1px; background: var(--tr-line); margin: 4px 0; }
.sh-panel-custom { padding: 10px 16px; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--tr-muted); }
.sh-panel-custom:hover { background: var(--tr-bg); color: var(--tr-ink); }
.sh-custom-inputs { padding: 12px 16px; background: var(--tr-bg); border-top: 1px solid var(--tr-line); border-radius: 0 0 8px 8px; display: flex; align-items: center; gap: 8px; }
.sh-date-input { border: 1px solid var(--tr-line); border-radius: 4px; padding: 4px 6px; font-size: 12px; font-family: inherit; width: 100px; }
.sh-btn-apply { background: var(--tr-accent); color: #fff; border: none; border-radius: 4px; padding: 4px 10px; cursor: pointer; font-size: 12px; }
.sh-compare-dates { font-size: 13px; color: var(--tr-ink); align-items: center; display: inline-flex; gap: 8px; height: 32px; flex-shrink: 0; white-space: nowrap; }

.sh-unsynced-banner {
    background: #FFF7E8; border: 1px solid #F0D9A8; padding: 12px 20px; border-radius: 10px;
    margin-bottom: 24px; display: flex; align-items: center; gap: 12px; font-size: 13px; color: #8F6A00;
}
.sh-banner-icon { width: 16px; height: 16px; fill: #D9A000; }
.sh-banner-action { color: var(--tr-accent); }
.sh-banner-text { flex: 1; }
.sh-banner-action { font-weight: 600; cursor: pointer; text-decoration: underline; }

.hint { color: #888; margin-left: 4px; font-size: 12px; }

.page-container { padding: 40px; max-width: 1440px; margin: 0 auto; }
.overview-top { display: flex; gap: 16px; margin-bottom: 24px; }

.kpi-value { font-size: 26px; font-weight: bold; color: var(--tr-ink); }
.kpi-compare { font-size: 13px; margin-top: 10px; display: flex; align-items: center; gap: 4px; }
.compare-up { color: var(--tr-up); }
.compare-up-icon { fill: var(--tr-up); width: 14px; height: 14px; }
.compare-down { color: var(--tr-down); }
.compare-down-icon { fill: var(--tr-down); width: 14px; height: 14px; }

/* Bar Chart */
.bar-chart-container { display: flex; flex-direction: column; gap: 16px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-label { width: 60px; font-size: 14px; text-align: right; color: #555; }
.bar-track { flex: 1; height: 24px; display: flex; background: #f0f0f0; border-radius: 4px; overflow: hidden; }
.bar { height: 100%; transition: flex-basis 0.3s ease; }
.campaign-bar { background: #5c8deb; }
.flow-bar { background: #3ab582; }
.bar-val { width: 100px; font-size: 14px; color: #333; text-align: right; }
.legend { display: flex; gap: 16px; justify-content: center; margin-top: 8px; }
.leg-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #555; }
.box { width: 12px; height: 12px; border-radius: 2px; }
.box.campaign { background: #5c8deb; }
.box.flow { background: #3ab582; }

/* Funnel */
.funnel-container {
    display: flex; align-items: center; justify-content: space-between; padding: 10px 20px;
}
.funnel-step {
    text-align: center; flex: 1; background: #fafafa; padding: 15px; border-radius: 6px;
    border: 1px solid #eaeaea;
}
.f-name { font-size: 13px; color: #666; margin-bottom: 8px; }
.f-val { font-size: 18px; font-weight: 600; color: #222; }
.funnel-arrow {
    flex: 0 0 60px; text-align: center; font-size: 12px; color: #888; position: relative;
}
.funnel-arrow::after {
    content: "→"; display: block; font-size: 18px; color: #ccc; margin-top: 4px;
}

/* Data Table */
.sh-data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }

/* Flow Grids */
.flow-layout { display: flex; flex-direction: column; gap: 24px; margin-bottom: 24px; }

.site-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.site-card { border: 1px solid #e0e0e0; border-radius: 6px; padding: 12px; }
.site-card h4 { margin: 0 0 12px 0; font-size: 15px; text-transform: uppercase; border-bottom: 1px solid #eee; padding-bottom: 6px; }
.site-metric { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.site-metric .m-lbl { color: #666; }
.site-metric .m-val { font-weight: 500; }
.flow-list { margin-top: 12px; font-size: 13px; border-top: 1px solid #eee; padding-top: 8px; }
.flow-item {
    display: block; padding: 6px; margin-bottom: 4px; background: #f8f9fa; border-radius: 4px;
    cursor: pointer; text-decoration: none; color: #0052cc;
}
.flow-item:hover { background: #eef2f7; text-decoration: underline; }

/* Messages Nodes */

#close-msg-view { background: #f0f0f0; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; float: right;}
.nodes-container { display: flex; align-items: flex-start; overflow-x: auto; padding: 20px 0; gap: 40px; position: relative;}
.node-wrapper { display: flex; align-items: center; position: relative; }
.node { background: #fff; border: 1px solid #d0d0d0; border-radius: 6px; padding: 12px; width: 220px; position: relative; z-index: 2; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.node-title { font-size: 13px; font-weight: bold; margin-bottom: 8px; word-break: break-all; }
.node-stats { font-size: 12px; color: #555; }
.node-stats div { display: flex; justify-content: space-between; margin-bottom: 4px; }
.corner-badge { position: absolute; top: 0; right: 0; background: #eee; color: #888; font-size: 10px; padding: 2px 4px; border-bottom-left-radius: 4px; }
.node-connector { position: absolute; right: -40px; width: 40px; height: 2px; background: #ccc; top: 50%; z-index: 1;}
.node-connector.dashed { background: transparent; border-top: 2px dashed #ccc; }
.connector-label { position: absolute; left: 50%; transform: translateX(-50%); top: -18px; font-size: 11px; color: #d93d42; white-space: nowrap; font-weight: bold; }
.inferred-notice { font-size: 12px; color: #888; margin-bottom: -10px; text-align: left; background: #f8f9fa; display: inline-block; padding: 4px 8px; border-radius: 4px;}

/* Data States */
/* 1. Unsynced */
.state-unsynced {
    background: repeating-linear-gradient(45deg, #f0f0f0, #f0f0f0 10px, #f8f8f8 10px, #f8f8f8 20px) !important;
    color: #666 !important; text-align: center; border: 1px solid #ddd; padding: 10px;
}
.unsynced-label { font-weight: bold; font-size: 13px; }
.unsynced-desc { font-size: 11px; color: #888; display: block; margin-top: 4px; }
.sync-cmd { background: #fff; border: 1px solid #ccc; font-family: monospace; font-size: 11px; padding: 4px; margin-top: 6px; display: block; user-select: all; }

/* 2. Synced no data */
.state-nodata {
    color: #b0b0b0 !important; cursor: help;
}

/* 3. Low Volume */
.state-lowvol {
    color: #888 !important; font-size: 0.9em !important; cursor: help;
}
.lowvol-star { font-size: 10px; vertical-align: top; color: #aaa; margin-left: 2px; }

/* Layout & Cards */
.overview-section, .flow-categories, .flow-details, .flow-message-view, .kpi-card, .sh-data-table-wrap {
    background: var(--tr-surface);
    outline: 1px solid var(--tr-line);
    outline-offset: -0.5px;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: none;
    border: none;
}
.overview-section h3, .flow-categories h3, .flow-details h3, .flow-message-view h3, .kpi-card h3 {
    font-size: 14px; font-weight: 600; color: var(--tr-ink); margin: 0 0 16px 0;
}
.kpi-card h3 { font-size: 12px; color: var(--tr-muted); font-weight: normal; margin: 0 0 12px 0; }

/* Table Styles - Override sh-data-table */
.sh-data-table-wrap { overflow: hidden; margin-bottom: 24px; padding: 0 !important; }
.overview-section.sh-data-table-wrap { padding: 0 !important; } /* In case */
.sh-data-table-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 10px 18px; }
.sh-data-table-head .title { font-size: 14px; font-weight: 600; color: var(--tr-ink); }
.sh-data-table-head .hint { font-size: 11.5px; color: var(--tr-faint); margin: 0; }

.sh-data-table { border: none !important; width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.sh-data-table thead { background: var(--tr-bg); }
.sh-data-table th { padding: 9px 18px; font-size: 11px; font-weight: 600; color: var(--tr-faint); border: none !important; }
.sh-data-table td { padding: 10px 18px; border-bottom: none; border-top: 1px solid var(--tr-line); }
.sh-data-table tbody tr { transition: background 0.2s; }
.sh-data-table tbody tr:hover { background: var(--tr-bg); }
.sh-data-table tbody tr.selected { background: var(--tr-accent-soft); }
.sh-data-table tbody tr.selected td:first-child { position: relative; }
.sh-data-table tbody tr.selected td:first-child::after {
    content: ""; display: inline-block; width: 13px; height: 13px;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><path d="M5.09619 2.93945q-0.25293 0.08545-0.37939 0.30762-0.04102 0.08545-0.04102 0.25293 0 0.16748 0.04102 0.25293 0.04443 0.08203 1.62353 1.66455l1.58252 1.58252-1.58252 1.58252q-1.5791 1.58252-1.62353 1.66797-0.04102 0.08203-0.04102 0.23584 0 0.15381 0.03418 0.23926 0.0376 0.08203 0.1333 0.18115 0.09912 0.0957 0.18115 0.1333 0.08545 0.03418 0.23926 0.03418 0.15381 0 0.24268-0.04785 0.09229-0.05127 1.90381-1.8628 1.81494-1.81494 1.86279-1.9038 0.05127-0.09229 0.05127-0.25977 0-0.16748-0.04443-0.24951-0.04102-0.08545-1.85938-1.90723l-1.44238-1.42871q-0.33496-0.33496-0.46143-0.41699-0.09912-0.07178-0.19824-0.07178l-0.04102 0q-0.14014 0-0.18115 0.01367z" fill="%237B1E3C"/></svg>') no-repeat right center;
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
}
.sh-data-table tbody tr:has(.state-unsynced) td { color: var(--tr-faint) !important; }

/* Hint Styles */
.hint-panel { background: var(--tr-surface); outline: 1px solid var(--tr-line); outline-offset: -0.5px; border-radius: 12px; padding: 16px 18px; margin-bottom: 24px; display: flex; flex-direction: column; gap: 10px; box-shadow: none; border: none; }
.hint-header { display: flex; align-items: center; gap: 8px; margin: 0; }
.hint-header h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--tr-ink); line-height: normal; }
.hint-header small { color: var(--tr-faint); font-size: 11.5px; margin: 0; font-weight: 400; }
.hint-empty { color: var(--tr-faint); font-size: 12.5px; }
.hint-list { display: flex; flex-direction: column; gap: 10px; }
.hint-item { padding: 11px 14px; background: var(--tr-bg); border-radius: 0 8px 8px 0; border: none; border-left: 3px solid transparent; margin: 0 0 0 -1.5px; gap: 4px; display: flex; flex-direction: column; box-sizing: content-box; }
.hint-warn { border-left-color: var(--tr-down); }
.hint-info { border-left-color: var(--tr-up); }
.hint-clickable { cursor: pointer; transition: background 0.2s; }
.hint-clickable:hover { background: #E9E8E6; }
.hint-title { font-weight: 600; font-size: 13px; color: var(--tr-ink); }
.hint-detail { font-size: 12.5px; color: var(--tr-muted); line-height: 20px; margin: 0; }
.hint-suggestion { font-size: 12px; color: var(--tr-faint); margin: 0; }
.hint-toggle { margin-top: 6px; font-size: 12px; color: var(--tr-accent); cursor: pointer; font-weight: 500; text-align: left; }

/* Bar charts */
.pg-bar-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.pg-bar-top { display: flex; justify-content: space-between; }
.pg-bar-lbl { font-size: 12.5px; color: var(--tr-muted); }
.pg-bar-val { font-size: 12.5px; font-weight: 600; color: var(--tr-ink); }
.pg-bar-track { background: var(--tr-bg); border-radius: 999px; height: 8px; overflow: hidden; width: 100%; }
.pg-bar-fill { height: 100%; border-radius: 999px; transition: width 0.3s; }
.pg-camp { background: var(--tr-accent); }
.pg-flow { background: var(--tr-up); }

/* Funnel */
.funnel-container {
    display: flex; align-items: center; justify-content: space-between; padding: 0;
}
.funnel-step { text-align: center; flex: 1; background: var(--tr-bg); padding: 15px; border-radius: 12px; border: none; }
.f-name { font-size: 12.5px; color: var(--tr-muted); margin-bottom: 4px; }
.f-val { font-size: 16px; font-weight: 600; color: var(--tr-ink); }
.funnel-arrow::after { color: var(--tr-faint); }

/* BA Block */
.ba-container { background: var(--tr-surface); outline: 1px solid var(--tr-line); outline-offset: -0.5px; border-radius: 12px; padding: 16px 18px; margin-top: 20px; }
.ba-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ba-title { font-size: 14px; font-weight: 600; color: var(--tr-ink); }
.ba-note { font-size: 11.5px; color: var(--tr-faint); }
.ba-col-before { background: var(--tr-bg); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.ba-col-after { background: var(--tr-up-soft); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.ba-lbl { font-size: 11.5px; color: var(--tr-faint); }
.ba-lbl-after { color: var(--tr-up); }
.ba-val { font-size: 13px; font-weight: 600; color: var(--tr-ink); }
.ba-val-sub { font-size: 13px; color: var(--tr-muted); }
.ba-split { display: flex; gap: 12px; width: 100%; }

/* Inputs matching capsules */
input.sh-capsule { outline: none; box-shadow: none; font-family: inherit; }
input.sh-capsule::placeholder { color: var(--tr-faint); }
.camp-pager button { background: var(--tr-surface); border: 1px solid var(--tr-line); border-radius: 8px; padding: 6px 12px; font-size: 12px; cursor: pointer; color: var(--tr-ink); }
.camp-pager button:hover:not(:disabled) { background: var(--tr-bg); }

/* Utility */
.empty-placeholder { color: #b0b0b0; }

/* Content destination share bars (width = share of total) */
.dest-chart { display: flex; flex-direction: column; gap: 10px; }
.dest-row { display: flex; align-items: center; gap: 12px; }
.dest-label {
    width: 96px; flex: 0 0 96px; font-size: 13px; text-align: right; color: #555;
}
.dest-track {
    flex: 1; height: 20px; background: #f0f0f0; border-radius: 4px; overflow: hidden;
    min-width: 0;
}
.dest-bar { height: 100%; background: #4ade80; }
.dest-val {
    width: 56px; flex: 0 0 56px; font-size: 13px; text-align: right; color: #333;
}

/* Campaign monthly timeline (row of columns, height = value) */
.timeline-chart {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-around;
    gap: 8px;
    height: 160px;
    padding: 8px 4px 0;
}
.timeline-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}
.timeline-bar {
    width: 60%;
    max-width: 36px;
    min-width: 8px;
    background: #60a5fa;
    border-radius: 3px 3px 0 0;
}
.timeline-label {
    font-size: 11px;
    color: #666;
    margin-top: 6px;
    margin-bottom: 2px;
    white-space: nowrap;
}

.camp-list-total { margin-left: 12px; font-size: 13px; color: #555; }
.camp-pager { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.camp-pager button { padding: 4px 10px; }
.camp-pager button:disabled { opacity: 0.45; cursor: default; }
/* Hints CSS */
.hint-panel { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.hint-header { margin-bottom: 16px; display: flex; align-items: baseline; gap: 8px; }
.hint-header h3 { margin: 0; font-size: 16px; color: #111; }
.hint-header small { color: #888; font-size: 12px; }
.hint-empty { color: #b0b0b0; font-size: 14px; }
.hint-list { display: flex; flex-direction: column; gap: 12px; }
.hint-item { padding: 12px; background: #fbfbfb; border-radius: 0 6px 6px 0; border: 1px solid #f0f0f0; border-left-width: 4px; border-left-style: solid; transition: background 0.2s; }
.hint-warn { border-left-color: #d93d42; }
.hint-info { border-left-color: #3ab582; }
.hint-clickable { cursor: pointer; }
.hint-clickable:hover { background: #f4f6fa; }
.hint-title { font-weight: bold; font-size: 14px; margin-bottom: 6px; color: #222; }
.hint-detail { font-size: 13px; color: #444; margin-bottom: 6px; }
.hint-suggestion { font-size: 12px; color: #777; }
.hint-toggle { margin-top: 16px; font-size: 13px; color: #0052cc; cursor: pointer; text-align: center; }

.topic-low-sample {
    color: #999;
}
.topic-sample-hint {
    font-size: 10px;
}
.cand-name {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 2px;
}
.cand-sub {
    color: #666;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Trends Page */
.trend-card { background: #fff; padding: 16px; border: 1px solid #eee; border-radius: 6px; margin-bottom: 12px; }
.trend-card h4 { margin: 0 0 8px 0; font-size: 15px; }
.trend-card-field { font-size: 13px; margin-bottom: 6px; color: #444; }
.trend-card-field strong { color: #222; }
.trend-tag { display: inline-block; background: #e3efff; color: #0052cc; padding: 2px 6px; border-radius: 4px; font-size: 11px; margin-right: 6px; margin-bottom: 4px; }
.trend-ref-item { font-size: 12px; padding: 8px; background: #f8f9fa; border-radius: 4px; margin-top: 6px; }
.trend-ref-item a { color: #333; font-weight: bold; text-decoration: none; }
.trend-ref-item a:hover { text-decoration: underline; }
.trend-link { color: #0052cc; text-decoration: none; }
.trend-link:hover { text-decoration: underline; }
.trend-low-signal { color: #999 !important; }
.trend-low-signal a, .trend-low-signal span { color: #999 !important; }
.trend-category-row th { background: #f4f6fa; color: #222; font-weight: 600; }
.trend-date { white-space: nowrap; }

/* Trend Radar New Design */
:root {
    --tr-bg: #F6F5F3;
    --tr-surface: #FFFFFF;
    --tr-ink: #17181C;
    --tr-muted: #6F7280;
    --tr-faint: #9CA0A8;
    --tr-line: #E7E5E1;
    --tr-accent: #7B1E3C;
    --tr-accent-soft: #F6EBEF;
    --tr-up: #1F7A4D;
    --tr-up-soft: #E9F4EE;
    --tr-down: #B3261E;
}

#trends-page {
    font-family: system-ui, -apple-system, 'PingFang SC', sans-serif;
    color: var(--tr-ink);
    padding: 28px 40px 48px;
    max-width: 1440px;
    margin: 0 auto;
}

#trends-page a {
    color: inherit;
    text-decoration: none;
}
#trends-page a:hover {
    text-decoration: none;
}

.tr-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
}
.tr-header-col { display: flex; flex-direction: column; gap: 6px; }
.tr-title { font-family: Georgia, 'Times New Roman', serif; font-size: 34px; line-height: 37px; }
.tr-subtitle { font-size: 13px; color: var(--tr-muted); }
.tr-meta-row { display: flex; align-items: center; gap: 8px; }
.tr-generated { font-size: 12px; color: var(--tr-faint); }
.tr-badge { background: var(--tr-accent-soft); border-radius: 999px; padding: 4px 10px; color: var(--tr-accent); font-size: 12px; }

#trends-week-list .w-desc { margin-left: auto; }
#trends-week-list .sh-window-item.selected::after { margin-left: 8px; }

.tr-stats-grid { display: flex; gap: 12px; margin-bottom: 24px; }
.tr-stat-card {
    flex: 1; display: flex; flex-direction: column; gap: 2px;
    background: var(--tr-surface); border-radius: 10px; padding: 14px 16px;
    outline: 1px solid var(--tr-line); outline-offset: -0.5px;
}
.tr-stat-val { font-size: 22px; font-weight: 600; }
.tr-stat-lbl { font-size: 12px; color: var(--tr-muted); }

.tr-section { margin-bottom: 24px; }
.tr-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tr-section-title { font-size: 16px; font-weight: 600; }
.tr-section-hint { font-size: 12px; color: var(--tr-faint); }

.tr-dir-list { display: flex; flex-direction: column; gap: 12px; }
.tr-card {
    background: var(--tr-surface);
    border-radius: 12px;
    outline: 1px solid var(--tr-line);
    outline-offset: -0.5px;
    padding: 18px 20px 16px;
}

.tr-dir-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.tr-dir-idx { color: var(--tr-accent); font-size: 12px; font-weight: 600; }
.tr-dir-title { font-size: 17px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-dir-ev { font-size: 12px; color: var(--tr-faint); white-space: nowrap; }

.tr-dir-cols { display: flex; gap: 28px; margin-bottom: 14px; }
.tr-dir-col { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tr-dir-col-lbl { font-size: 11px; font-weight: 600; color: var(--tr-faint); text-transform: uppercase; letter-spacing: 0.6px; }
.tr-dir-col-txt { font-size: 13px; line-height: 1.65; }

.tr-dir-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tr-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--tr-bg); border-radius: 999px; padding: 5px 10px;
    outline: 1px solid var(--tr-line); outline-offset: -0.5px; text-decoration: none !important;
}
.tr-chip:hover { background: #EFEFEF; }
.tr-chip-kw { font-size: 12px; color: var(--tr-ink); }
.tr-chip-val { font-size: 12px; font-weight: 600; color: var(--tr-up); }
.tr-chip-icon { width: 12px; height: 12px; fill: var(--tr-faint); margin-left: auto; }

.tr-ref-box { background: var(--tr-bg); border-radius: 10px; padding: 10px 0 6px; }
.tr-ref-head { font-size: 11px; font-weight: 600; color: var(--tr-faint); text-transform: uppercase; letter-spacing: 0.6px; padding: 0 14px; margin-bottom: 4px; }
.tr-ref-row { display: flex; align-items: center; gap: 12px; padding: 8px 14px; }
.tr-ref-subj { font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-ref-date { font-size: 12px; color: var(--tr-faint); white-space: nowrap; }
.tr-ref-del { font-size: 12px; color: var(--tr-muted); white-space: nowrap; }
.tr-ref-open { background: var(--tr-up-soft); color: var(--tr-up); font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 8px; white-space: nowrap; }

.tr-layout { display: flex; gap: 16px; align-items: flex-start; }
.tr-layout-left { flex: 1; min-width: 0; }
.tr-layout-right { width: 440px; flex-shrink: 0; }

.tr-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.tr-table th, .tr-table td { padding: 10px 12px; border-bottom: 1px solid var(--tr-line); }
.tr-table tbody tr:last-child td { border-bottom: none; }

.tr-mom-tb th { color: var(--tr-muted); font-size: 12px; font-weight: normal; background: var(--tr-bg); padding: 8px 12px; }
.tr-mom-tb th:nth-child(2), .tr-mom-tb td:nth-child(2), .tr-mom-tb td:nth-child(3), .tr-mom-tb th:nth-child(3), .tr-mom-tb th:nth-child(4), .tr-mom-tb td:nth-child(4) { text-align: right; }
.tr-mom-tb th:nth-child(2) { width: 64px; }
.tr-mom-tb th:nth-child(3) { width: 78px; }
.tr-mom-tb th:nth-child(4) { width: 70px; }
.tr-cat-row th { background: transparent !important; color: var(--tr-accent); font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--tr-line) !important; padding-top: 16px; padding-bottom: 8px; text-align: left !important; }
.tr-mom-tb td.tr-low-sig a { color: var(--tr-faint) !important; }
.tr-low-lbl { background: var(--tr-bg); color: var(--tr-muted); font-size: 10px; padding: 2px 4px; border-radius: 4px; margin-left: 6px; }

.tr-seed-head { margin-bottom: 14px; }
.tr-seed-used-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tr-seed-chip { background: var(--tr-up-soft); color: var(--tr-up); font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.tr-seed-unused-row { display: flex; align-items: baseline; gap: 12px; font-size: 13px; margin-top: 8px; }
.tr-seed-unused-kw { width: 170px; flex-shrink: 0; color: var(--tr-muted); }
.tr-seed-unused-rs { color: var(--tr-ink); }

.tr-up { color: var(--tr-up); }
.tr-down { color: var(--tr-down); }

.tr-hot-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tr-hot-row:last-child { margin-bottom: 0; }
.tr-hot-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tr-hot-tag { font-size: 11px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.tr-hot-kw { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.tr-hot-right { display: flex; align-items: center; gap: 12px; font-size: 13px; text-align: right; }
.tr-hot-vol { color: var(--tr-muted); width: 60px; }
.tr-hot-inc { color: var(--tr-up); width: 60px; font-weight: 600; }

.tr-rising-sect { margin-bottom: 16px; }
.tr-rising-title { font-size: 11px; font-weight: 600; color: var(--tr-faint); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px; }
.tr-rising-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 10px; }
.tr-rising-row:last-child { margin-bottom: 0; }
.tr-rising-kw { color: var(--tr-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 12px; }
.tr-rising-pill { background: var(--tr-up-soft); color: var(--tr-up); padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tr-rising-breakout { background: var(--tr-accent-soft); color: var(--tr-accent); }

.tr-footer-text { margin-top: 24px; font-size: 12px; color: var(--tr-faint); text-align: center; }

/* Global overrides for trends page only */
#trends-page { background: var(--tr-bg); }
