/* ===== Title block ===== */
.se-titleblock {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--se-line-strong);
    margin-bottom: 28px;
}
.se-titleblock h1 {
    font-family: "Special Elite", "Courier New", monospace;
    font-weight: 400;
    font-size: clamp(46px, 7.5vw, 74px);
    line-height: 0.92;
    letter-spacing: 0.01em;
    margin: 0;
    text-wrap: balance;
}
.se-platefields {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 4px 20px;
    text-align: right;
}
.se-platefield dt {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--se-ink-faint);
    margin: 0;
}
.se-platefield dd {
    font-family: "IBM Plex Mono", monospace;
    font-size: 13px;
    font-weight: 500;
    color: var(--se-ink);
    margin: 2px 0 0;
}
.se-platefield.status dd { color: var(--se-positive); }

/* ===== Bento grid ===== */
.se-bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}
.se-panel {
    position: relative;
    background: var(--se-surface);
    border: 1px solid var(--se-line);
    border-radius: 3px;
    box-shadow: var(--se-shadow);
    padding: 22px 24px 26px;
}
.se-panel::before, .se-panel::after,
.se-panel .tick-br, .se-panel .tick-bl {
    content: "";
    position: absolute;
    width: 9px;
    height: 9px;
    border: 1.5px solid var(--se-line-strong);
}
.se-panel::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.se-panel::after { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.se-panel .tick-bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.se-panel .tick-br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.se-panel-mortgage { grid-column: span 8; }
.se-panel-sentiment { grid-column: span 4; }
.se-panel-realestate { grid-column: span 8; }
.se-panel-segments { grid-column: span 4; }

@media (max-width: 860px) {
    .se-panel-mortgage, .se-panel-sentiment, .se-panel-realestate, .se-panel-segments {
        grid-column: span 12;
    }
    .se-titleblock { align-items: flex-start; }
    .se-platefields { text-align: left; }
}

.se-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 18px;
    gap: 12px;
    flex-wrap: wrap;
}
.se-panel-title {
    font-family: "Big Shoulders Display", sans-serif;
    font-weight: 600;
    font-size: 22px;
    letter-spacing: 0.01em;
    margin: 0;
}
.se-panel-sub {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--se-ink-faint);
    letter-spacing: 0.04em;
}

/* ===== Stat readouts ===== */
.se-readouts {
    display: flex;
    gap: 28px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.se-readout dt {
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--se-ink-faint);
    margin: 0 0 4px;
}
.se-readout dd {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 600;
    font-size: 26px;
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.se-delta { font-size: 12px; font-weight: 500; }
.se-delta.up { color: var(--se-negative); }
.se-delta.down { color: var(--se-positive); }

/* ===== Legend ===== */
.se-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 4px; }
.se-legend-item {
    display: flex; align-items: center; gap: 7px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11.5px;
    color: var(--se-ink-muted);
    cursor: pointer;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: 2px;
    transition: background 0.15s, opacity 0.15s;
}
.se-legend-item:hover { background: var(--se-line); }
.se-legend-item.dimmed { opacity: 0.4; }
.se-legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ===== Chart mechanics ===== */
.se-chart-area { position: relative; }
.se-chart-area svg { display: block; width: 100%; overflow: visible; }
.se-chart-line { fill: none; stroke-width: 2px; stroke-linecap: round; transition: stroke-width 0.15s, opacity 0.15s; }
.se-grid-line { stroke: var(--se-line); stroke-dasharray: 2,3; }
.se-axis text { font-family: "IBM Plex Mono", monospace; font-size: 10px; fill: var(--se-ink-faint); }
.se-axis path, .se-axis .tick line { display: none; }
.se-crosshair { stroke: var(--se-ink-faint); stroke-width: 1px; stroke-dasharray: 3,3; opacity: 0; }
.se-hover-dot { opacity: 0; }

.se-tooltip {
    position: fixed;
    pointer-events: none;
    background: var(--se-surface-raised);
    border: 1px solid var(--se-line-strong);
    border-radius: 3px;
    box-shadow: var(--se-shadow);
    padding: 10px 12px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--se-ink);
    opacity: 0;
    transition: opacity 0.1s;
    z-index: 40;
    white-space: nowrap;
}
.se-tooltip .tt-date {
    color: var(--se-ink-faint);
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 3px;
}
.se-tooltip .tt-row { display: flex; align-items: center; gap: 7px; }
.se-tooltip .tt-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.se-tooltip .tt-val { margin-left: auto; padding-left: 12px; font-weight: 600; }

/* ===== Real estate metro selector ===== */
.se-metro-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    border: 1px solid var(--se-line);
    border-radius: 3px;
    padding: 3px;
    width: fit-content;
}
.se-metro-tab {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 7px 14px;
    border: none;
    border-radius: 2px;
    background: transparent;
    color: var(--se-ink-muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.se-metro-tab:hover { color: var(--se-ink); }
.se-metro-tab.active { background: var(--se-brass); color: var(--se-surface); }
.se-metro-tab:focus-visible { outline: 2px solid var(--se-brass); outline-offset: 1px; }

/* ===== Market segments (diverging weekly-change bars) ===== */
.se-segment-bars { display: flex; flex-direction: column; gap: 15px; margin-top: 6px; }
.se-segment-row { display: grid; grid-template-columns: 96px 1fr 52px; align-items: center; gap: 10px; }
.se-segment-label {
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    color: var(--se-ink-muted);
    transition: color 0.15s;
}
.se-segment-row:hover .se-segment-label { color: var(--se-ink); }
.se-segment-track { position: relative; height: 16px; }
.se-segment-track::before {
    content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px;
    width: 1px; background: var(--se-line-strong);
}
.se-segment-bar { position: absolute; top: 1px; bottom: 1px; border-radius: 2px; transition: filter 0.15s; }
.se-segment-bar.positive { background: var(--se-positive); left: 50%; }
.se-segment-bar.negative { background: var(--se-negative); right: 50%; }
.se-segment-row:hover .se-segment-bar { filter: brightness(1.2); }
.se-segment-value { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; font-weight: 600; text-align: right; }
.se-segment-value.positive { color: var(--se-positive); }
.se-segment-value.negative { color: var(--se-negative); }

/* ===== Sentiment gauge (calibrating state) ===== */
.se-gauge-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 6px; }
.se-gauge-caption { font-size: 13.5px; color: var(--se-ink-muted); margin: 14px 0 0; max-width: 30ch; }
.se-gauge-status {
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--se-brass);
    margin-top: 10px;
}
.se-pulse { animation: se-pulse 2.4s ease-in-out infinite; }
@keyframes se-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .se-pulse { animation: none; } }

/* ===== Footer ===== */
.se-footer {
    margin-top: 32px;
    padding-top: 18px;
    border-top: 1px solid var(--se-line);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    color: var(--se-ink-faint);
    letter-spacing: 0.02em;
}
