.brief-main {
    width: min(100%, 1760px);
    margin: 0 auto;
    padding: 1.25rem 1.25rem 2.5rem;
}

.brief-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.35rem 0 1.15rem;
    overflow: hidden;
}

.brief-hero::after {
    content: '';
    position: absolute;
    right: 10%;
    bottom: 0;
    width: 32%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.hero-kicker,
.market-eyebrow {
    display: block;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.brief-hero h2 {
    margin-top: 0.35rem;
    font-size: clamp(1.55rem, 2.5vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.045em;
}

.brief-hero p {
    max-width: 700px;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.65;
}

.hero-actions,
.update-schedule {
    display: flex;
    align-items: center;
}

.hero-actions { gap: 0.7rem; }

.update-schedule {
    gap: 0.9rem;
    padding: 0.52rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--control-radius);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    white-space: nowrap;
}

.update-schedule b { color: var(--text-primary); font-weight: 700; }
.update-schedule .schedule-label {
    padding-right: .9rem;
    border-right: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-weight: 700;
}

.refresh-button {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    min-height: 36px;
    padding: 0 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--control-radius);
    background: var(--bg-card);
    color: var(--text-secondary);
    font: 600 0.72rem var(--font-family);
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.refresh-button:hover { border-color: var(--border-glow); color: var(--text-primary); background: var(--bg-card-hover); }
.refresh-button:disabled { opacity: .55; cursor: wait; }
.refresh-button svg { width: 14px; height: 14px; }
.refresh-button.loading svg { animation: spin .8s linear infinite; }

.market-view-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 420px);
    margin: 0 auto .85rem;
    padding: .24rem;
    border: 1px solid var(--border-color);
    border-radius: 11px;
    background: var(--bg-card);
}

.market-view-tab {
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font: 700 .75rem var(--font-family);
    letter-spacing: .02em;
    cursor: pointer;
    transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}

.market-view-tab:hover { color: var(--text-secondary); background: var(--bg-card-hover); }
.market-view-tab.active { color: var(--accent-contrast); background: var(--accent-gradient); }
.market-view-tab:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

.market-view { min-width: 0; }

.market-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.85rem;
    align-items: stretch;
}

.heatmap-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.15rem;
    align-items: stretch;
}

.heatmap-panel {
    width: 100%;
    min-height: 0;
}
.heatmap-panel .market-panel-header { flex: 0 0 auto; }

.heatmap-widget {
    flex: 1;
    height: clamp(620px, 58vw, 820px) !important;
    min-height: 620px;
    background: var(--bg-secondary);
}

.custom-heatmap-widget {
    display: flex;
    overflow: hidden;
    flex-direction: column;
}

.custom-heatmap-status {
    display: flex;
    min-height: 32px;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    padding: .45rem .65rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    background: var(--bg-primary);
    font-size: .67rem;
    font-weight: 700;
}

.custom-heatmap-status.warning { color: #f59e0b; }

.heatmap-breadcrumb {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: .35rem;
}

.heatmap-breadcrumb-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font: 700 .68rem var(--font-family);
    cursor: pointer;
}

.heatmap-breadcrumb-button:hover,
.heatmap-breadcrumb-button:focus-visible,
.heatmap-breadcrumb-button.active { color: var(--text-primary); }
.heatmap-breadcrumb-button:focus-visible { outline: 1px solid var(--market-accent); outline-offset: 3px; }
.heatmap-breadcrumb-button:disabled { color: var(--text-muted); cursor: default; }
.heatmap-breadcrumb-separator { color: var(--text-muted); }
.heatmap-basis { flex: 0 0 auto; }

.custom-stock-treemap {
    display: block;
    width: 100%;
    min-height: 0;
    flex: 1;
    background: var(--bg-secondary);
}

.custom-stock-treemap.wheel-zoomed { cursor: grab; user-select: none; }
.custom-stock-treemap.wheel-zoomed .treemap-sector-zoom,
.custom-stock-treemap.wheel-zoomed .treemap-tile { cursor: grab; }
.custom-stock-treemap.panning,
.custom-stock-treemap.panning .treemap-sector-zoom,
.custom-stock-treemap.panning .treemap-tile { cursor: grabbing; }

.treemap-sector-border {
    fill: rgba(15, 23, 42, .34);
    stroke: var(--border-color);
    stroke-width: 2;
}

[data-theme="light"] .treemap-sector-border { fill: rgba(226, 232, 240, .72); }

.treemap-sector-label {
    fill: var(--text-primary);
    font-size: 12px;
    font-weight: 800;
    pointer-events: none;
}

.treemap-sector-zoom { cursor: zoom-in; outline: none; }
.treemap-sector-zoom.zoomed { cursor: zoom-out; }
.treemap-sector-zoom-hit { fill: transparent; }
.treemap-sector-zoom:hover .treemap-sector-zoom-hit,
.treemap-sector-zoom:focus .treemap-sector-zoom-hit { fill: var(--market-accent-muted); }

.treemap-tile { cursor: pointer; outline: none; }
.treemap-tile-rect { stroke: rgba(255, 255, 255, .28); stroke-width: 1; transition: filter .15s ease, stroke-width .15s ease; }
.treemap-tile:hover .treemap-tile-rect,
.treemap-tile:focus .treemap-tile-rect { filter: brightness(1.18); stroke: #fff; stroke-width: 2.4; }
.treemap-stock-name,
.treemap-stock-change {
    fill: #fff;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    paint-order: stroke;
    stroke: rgba(0, 0, 0, .24);
    stroke-width: 2px;
}
.treemap-stock-name { font-size: 12px; font-weight: 800; }
.treemap-stock-change { font-size: 11px; font-weight: 700; }

.heatmap-error {
    display: grid;
    min-height: 520px;
    place-items: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: .76rem;
    text-align: center;
}

.market-panel {
    --market-accent: #57a8ff;
    --market-accent-muted: rgba(87, 168, 255, .1);
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-card);
}

.overnight-panel {
    --market-accent: #a98bff;
    --market-accent-muted: rgba(169, 139, 255, .1);
}

.market-panel::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, var(--market-accent), transparent 72%);
}

.market-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.1rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(120deg, var(--market-accent-muted), transparent 46%);
}

.market-identity { display: flex; align-items: center; gap: 0.72rem; }

.market-panel-tools { display: grid; justify-items: end; gap: .45rem; }

.panel-copy-button {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 30px;
    padding: 0 .58rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font: 600 .64rem var(--font-family);
    cursor: pointer;
}
.panel-copy-button:hover { border-color: var(--border-glow); color: var(--text-primary); }
.panel-copy-button:disabled { opacity: .5; cursor: wait; }
.panel-copy-button.copied { border-color: rgba(47, 186, 132, .5); color: #2fba84; background: rgba(47, 186, 132, .08); }
.panel-copy-button svg { width: 13px; height: 13px; }

.market-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid color-mix(in srgb, var(--market-accent) 40%, transparent);
    border-radius: 10px;
    background: var(--market-accent-muted);
    color: var(--market-accent);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
}

.market-panel h3 { margin-top: 0.13rem; font-size: 1.2rem; letter-spacing: -0.03em; }
.market-eyebrow { color: var(--market-accent); font-size: .6rem; }

.market-date-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.fresh-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--market-accent); box-shadow: 0 0 10px var(--market-accent); }

.brief-section { padding: 1rem 1rem 0; }
.brief-section + .brief-section { margin-top: .2rem; }

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .58rem;
}

.section-heading h4,
.summary-heading h4 {
    font-size: .75rem;
    font-weight: 750;
    letter-spacing: .02em;
}

.section-heading > span {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .1em;
}

.quote-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.quote-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.quote-item {
    min-width: 0;
    padding: .72rem .75rem;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--bg-secondary);
}

.quote-top,
.quote-values { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.quote-values { flex-wrap: wrap; }
.quote-top { margin-bottom: .38rem; }
.quote-name { overflow: hidden; color: var(--text-secondary); font-size: .69rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.mobile-quote-name { display: none; }
.quote-code { color: var(--text-muted); font-family: var(--font-mono); font-size: .55rem; }
.quote-price { color: var(--text-primary); font-family: var(--font-mono); font-size: .98rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.quote-unit { margin-left: .16rem; color: var(--text-muted); font-family: var(--font-family); font-size: .58rem; font-weight: 500; }
.quote-change { margin-left: auto; font-family: var(--font-mono); font-size: .64rem; font-weight: 700; white-space: nowrap; }
.quote-change.up { color: #2fba84 !important; }
.quote-change.down { color: #ef5967 !important; }
.quote-change.neutral { color: var(--text-muted); }
.quote-price.quote-closed { color: var(--text-muted); }
.quote-trading-value { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-top: .45rem; padding-top: .4rem; border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: .6rem; }
.quote-trading-value strong { color: var(--text-secondary); font-family: var(--font-mono); font-size: .64rem; font-variant-numeric: tabular-nums; }

.mini-section-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: .2rem; }
.mini-section-grid.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mini-section-grid.three-up .quote-grid { grid-template-columns: 1fr; }

.flow-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.flow-card { min-width: 0; padding: .7rem .75rem; border: 1px solid var(--border-color); border-radius: 9px; background: var(--bg-secondary); }
.flow-card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; color: var(--text-primary); font-size: .69rem; font-weight: 700; }
.flow-card-name { min-width: 0; color: var(--text-primary); font: inherit; }
.flow-card-title > .flow-card-unit { color: var(--text-muted); font-family: var(--font-mono); font-size: .56rem; font-weight: 600; }
.flow-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .25rem 0; border-top: 1px solid var(--border-color); }
.flow-row:first-of-type { border-top: 0; }
.flow-label { color: var(--text-secondary); font-size: .63rem; }
.flow-value { font-family: var(--font-mono); font-size: .66rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.flow-value.up { color: #2fba84 !important; }
.flow-value.down { color: #ef5967 !important; }

.economic-calendar {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--bg-secondary);
}

.economic-calendar table {
    width: 100%;
    border-collapse: collapse;
    font-size: .64rem;
    text-align: right;
    white-space: nowrap;
}

.economic-calendar th,
.economic-calendar td {
    padding: .58rem .62rem;
    border-bottom: 1px solid var(--border-color);
    font-variant-numeric: tabular-nums;
}

.economic-calendar th {
    color: var(--text-muted);
    font-size: .57rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.economic-calendar td { color: var(--text-secondary); font-family: var(--font-mono); }
.economic-calendar th:nth-child(2),
.economic-calendar td:nth-child(2) { width: 100%; text-align: left; white-space: normal; }
.economic-calendar td:nth-child(2) { color: var(--text-primary); font-family: var(--font-family); font-weight: 650; }
.economic-calendar tbody tr:last-child td { border-bottom: 0; }
.economic-calendar .empty-state { display: grid; min-height: 74px; place-content: center; border: 0; }

.market-summary {
    margin: 1rem;
    padding: .85rem .9rem;
    border: 1px solid color-mix(in srgb, var(--market-accent) 22%, var(--border-color));
    border-radius: 10px;
    background: linear-gradient(135deg, var(--market-accent-muted), transparent 70%);
}

.checkpoint-section {
    margin-top: 0;
    border-color: var(--border-color);
    background: var(--bg-secondary);
}

.checkpoint-section .summary-icon {
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--market-accent) 35%, var(--border-color));
}

.summary-heading { display: flex; align-items: center; gap: .45rem; margin-bottom: .6rem; }
.summary-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--market-accent-muted); color: var(--market-accent); font-family: var(--font-mono); font-size: .75rem; font-weight: 800; }
.summary-list { display: grid; gap: .48rem; list-style: none; }
.summary-list li { position: relative; padding-left: .75rem; color: var(--text-secondary); font-size: .71rem; line-height: 1.55; }
.summary-list li::before { content: ''; position: absolute; top: .55em; left: 0; width: 3px; height: 3px; border-radius: 50%; background: var(--market-accent); }
.checkpoint-list li::before { width: 5px; height: 5px; border-radius: 1px; transform: rotate(45deg); }

.source-line { padding: 0 1rem 1rem; color: var(--text-muted); font-size: .58rem; text-align: right; }
.page-error { margin-bottom: .8rem; padding: .75rem .9rem; border: 1px solid rgba(239, 89, 103, .25); border-radius: 9px; background: rgba(239, 89, 103, .08); color: #ef5967; font-size: .76rem; }
.empty-state { grid-column: 1 / -1; padding: 1rem; border: 1px dashed var(--border-color); border-radius: 9px; color: var(--text-muted); font-size: .7rem; text-align: center; }
.market-closed-state { grid-column: 1 / -1; display: grid; min-height: 68px; place-items: center; }
.loading-grid:empty::before,
.loading-grid:empty::after { content: ''; min-height: 68px; border-radius: 9px; background: linear-gradient(100deg, var(--bg-secondary) 35%, var(--bg-card-hover) 50%, var(--bg-secondary) 65%); background-size: 300% 100%; animation: shimmer 1.4s ease infinite; }
.loading-list:empty::before { content: ''; display: block; width: 100%; height: 54px; border-radius: 7px; background: linear-gradient(100deg, var(--bg-secondary) 35%, var(--bg-card-hover) 50%, var(--bg-secondary) 65%); background-size: 300% 100%; animation: shimmer 1.4s ease infinite; }

@keyframes shimmer { to { background-position-x: -150%; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
    .mini-section-grid,
    .mini-section-grid.three-up { grid-template-columns: 1fr; }
    .mini-section-grid.three-up .quote-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .brief-main { padding: .8rem .6rem 2rem; }
    .brief-hero { align-items: flex-start; flex-direction: column; gap: 1rem; padding: .8rem .35rem 1rem; }
    .hero-actions { width: 100%; justify-content: space-between; }
    .market-split { grid-template-columns: 1fr; }
    .heatmap-panel { min-height: 520px; }
    .heatmap-widget { height: 520px !important; min-height: 520px; }
}

@media (max-width: 560px) {
    .desktop-quote-name { display: none; }
    .mobile-quote-name { display: inline; }
    .market-view-tabs { width: 100%; }
    .update-schedule { gap: .55rem; font-size: .62rem; }
    .update-schedule .schedule-label { padding-right: .55rem; }
    .refresh-button { width: 36px; padding: 0; justify-content: center; }
    .refresh-button span { display: none; }
    .brief-hero p { font-size: .8rem; }
    .market-panel-header { padding: .95rem .8rem .8rem; }
    .panel-copy-button { width: 32px; padding: 0; justify-content: center; }
    .panel-copy-button span { display: none; }
    .custom-heatmap-status { align-items: flex-start; flex-direction: column; gap: .25rem; }
    .heatmap-basis { flex: none; }
    .brief-section { padding: .85rem .7rem 0; }
    .quote-item { padding: .65rem; }
    .quote-price { font-size: .88rem; }
    .flow-grid { grid-template-columns: 1fr; }
    .market-summary { margin: .85rem .7rem; }
    .source-line { padding: 0 .7rem .8rem; }
}
