* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border-color: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-green: #3fb950;
    --accent-red: #f85149;
    --accent-blue: #58a6ff;
    --accent-yellow: #d29922;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

.terminal {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}

.header-market {
    display: flex;
    align-items: center;
}

.ibex-widget {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.9rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
}

.ibex-label {
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
}

.ibex-price {
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.ibex-change {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ibex-change.positive {
    color: var(--accent-green);
}

.ibex-change.negative {
    color: var(--accent-red);
}

.company-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

.site-brand { display: inline-flex; font-size: clamp(1.25rem, 4vw, 1.75rem); letter-spacing: -.04em; text-decoration: none; white-space: nowrap; border-radius: 3px; }
.brand-info { color: var(--accent-blue); }
.brand-nextil { color: #fff; }
.brand-tech { color: #a5d6ff; }

.company-details {
    display: flex;
    gap: 1rem;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ticker, .exchange, .isin {
    padding: 0.125rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-indicator.disconnected .dot {
    background: var(--accent-red);
}

.terminal-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1rem;
}

@media (max-width: 1000px) {
    .terminal-main {
        grid-template-columns: 1fr;
    }
}

.quote-panel, .chart-panel, .orderbook-panel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.quote-header, .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.quote-header h2, .chart-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.last-update {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: inherit;
}

.price-display {
    margin-bottom: 1.5rem;
}

.current-price {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.current-price.positive { color: var(--accent-green); }
.current-price.negative { color: var(--accent-red); }

.price-change {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-top: 0.5rem;
}

.change-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.change-value.positive { color: var(--accent-green); }
.change-value.negative { color: var(--accent-red); }

.change-percent {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.quote-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.chart-container {
    position: relative;
    height: 280px;
}

.chart-container #tv-chart {
    width: 100%;
    height: 100%;
}

.chart-provider {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.terminal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    border-top: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.15s ease;
}

.nav-link:hover {
    color: var(--accent-blue);
}

.version {
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .terminal {
        padding: 0.5rem;
    }
    .terminal-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .company-details {
        justify-content: center;
    }
    .current-price {
        font-size: 2.5rem;
    }
    .quote-details {
        grid-template-columns: 1fr;
    }
    .terminal-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    .sources-comparison {
        grid-template-columns: 1fr;
    }
    .quote-controls {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* Dual Source Comparison Styles */
.quote-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.refresh-indicator {
    font-size: 0.7rem;
    color: var(--accent-yellow);
    background: rgba(210, 153, 34, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--accent-yellow);
}

.sources-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 800px) {
    .sources-comparison {
        grid-template-columns: 1fr;
    }
}

.source-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.source-card.yahoo-card {
    border-left: 3px solid var(--accent-blue);
}

.source-card.bme-card {
    border-left: 3px solid var(--accent-yellow);
}

.source-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.source-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.source-badge.yahoo {
    background: var(--accent-blue);
    color: var(--bg-primary);
}

.source-badge.bme {
    background: var(--accent-yellow);
    color: var(--bg-primary);
}

.source-symbol {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: inherit;
}

.source-price {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.source-price.positive { color: var(--accent-green); }
.source-price.negative { color: var(--accent-red); }

.source-change {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.source-timestamp {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 600px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}
/* ===================== NEWS SECTION ===================== */

.news-controls, .cnmv-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.news-count, .cnmv-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.25rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.filter-select {
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--accent-blue);
}

.news-list, .cnmv-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.news-card, .cnmv-card {
    display: flex;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    animation: newsFadeIn 0.35s ease both;
}

.news-card:hover, .cnmv-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-blue);
    box-shadow: 0 6px 20px var(--shadow);
}

@keyframes newsFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.news-thumb, .cnmv-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.news-monogram, .cnmv-monogram {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border: 1px solid transparent;
    border-radius: 11px;
}

.news-body, .cnmv-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.news-meta, .cnmv-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.78rem;
}

.news-source {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.72rem;
}

.news-meta-sep {
    color: var(--text-muted);
}

.news-datetime {
    color: var(--text-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 0.15rem 0.55rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-transform: capitalize;
}

.news-relative {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-style: italic;
}

.news-title, .cnmv-title {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    transition: color 0.15s;
}

.news-card:hover .news-title, .cnmv-card:hover .cnmv-title {
    color: var(--accent-blue);
}

.news-desc {
    font-size: 0.83rem;
    color: var(--text-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-footer, .cnmv-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.25rem;
}

.news-link, .cnmv-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: gap 0.15s, color 0.15s;
}

.news-link:hover, .cnmv-link:hover {
    color: var(--text-primary);
    gap: 0.6rem;
}

.news-link-arrow {
    transition: transform 0.15s;
}

.news-domain, .cnmv-registry {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 45%;
    font-variant-numeric: tabular-nums;
}

/* loading / empty states */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    border-radius: 10px;
}

.empty-state.error {
    color: var(--accent-red);
    border-color: var(--accent-red);
}

@media (max-width: 640px) {
    .news-card, .cnmv-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .news-footer, .cnmv-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }
    .news-domain, .cnmv-registry {
        max-width: 100%;
    }
}

/* ===================== CNMV SECTION ===================== */

.cnmv-type {
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.page-btn {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.45rem 1rem;
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#page-info {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ===================== ORDER BOOK ===================== */

.orderbook-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 2fr;
    gap: 1rem;
}

.bidask-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center;
}

.bidask-side {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
}

.bid-side {
    border-left: 3px solid var(--accent-green);
}

.ask-side {
    border-left: 3px solid var(--accent-red);
}

.bidask-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
}

.bidask-price {
    font-size: 1.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.bidask-source {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.bidask-spread {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.spread-label {
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
}

.spread-value {
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.spread-pct {
    padding: 0.1rem 0.45rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}

.trades-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    min-width: 0;
}

.trades-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trades-source {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--bg-primary);
    background: var(--accent-yellow);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.trades-table-wrap {
    max-height: 320px;
    overflow-y: auto;
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.trades-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    text-align: right;
    padding: 0.5rem 0.75rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.trades-table thead th:first-child {
    text-align: left;
}

.trades-table tbody td {
    padding: 0.45rem 0.75rem;
    text-align: right;
    border-bottom: 1px solid var(--bg-tertiary);
    color: var(--text-secondary);
}

.trades-table tbody td:first-child {
    text-align: left;
    color: var(--text-muted);
}

.trades-table tbody tr:hover td {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.trade-price.positive {
    color: var(--accent-green);
    font-weight: 600;
}

.trade-price.negative {
    color: var(--accent-red);
    font-weight: 600;
}

.trades-empty {
    text-align: center !important;
    color: var(--text-muted) !important;
    padding: 2rem !important;
}

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

.side-badge {
    display: inline-block;
    padding: 0.12rem 0.5rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.side-buy {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(63, 185, 80, 0.4);
}

.side-sell {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(248, 81, 73, 0.4);
}

.side-neutral {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* Consolidated market view */
.notices-main { place-items: center; padding: clamp(1rem, 4vw, 3rem); }
.notices-card { position: relative; width: 100%; max-width: 720px; padding: clamp(2rem, 6vw, 4rem) 1.5rem 2rem; text-align: center; border: 1px solid #58a6ff35; border-radius: 20px; background: radial-gradient(ellipse at 50% 0%, #58a6ff16, transparent 65%), var(--bg-primary); box-shadow: 0 20px 60px #0003; }
.notices-emblem { position: relative; display: grid; place-items: center; width: 88px; height: 88px; margin: 0 auto 1.75rem; border: 1px solid #58a6ff55; border-radius: 24px; background: #58a6ff0d; color: var(--accent-blue); box-shadow: 0 0 35px #58a6ff12; }
.notices-emblem svg { width: 46px; height: 46px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.notices-dot { position: absolute; top: 13px; right: 14px; width: 9px; height: 9px; border: 2px solid var(--bg-primary); border-radius: 50%; background: var(--accent-blue); }
.notices-label { margin-bottom: .8rem; color: var(--accent-blue); font-size: .8rem; font-weight: 500; text-transform: uppercase; letter-spacing: .22em; }
.notices-card h2 { font-size: clamp(1.8rem, 6vw, 3rem); letter-spacing: -.06em; line-height: 1.15; }
.notices-card h2 > span { color: var(--accent-blue); }
.notices-card > p { margin: 1rem auto 1.5rem; font-size: .85rem; color: var(--text-secondary); }
.notices-badge { display: inline-flex; align-items: center; gap: .6rem; padding: .4rem .75rem; border: 1px solid var(--border-color); border-radius: 30px; color: var(--text-secondary); font-size: .7rem; }
.notices-badge > span { width: 6px; height: 6px; background: var(--accent-blue); border-radius: 50%; }
.notices-actions { margin-top: 2.5rem; }
.notice-sound-button { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: .6rem; border: 1px solid #58a6ff66; border-radius: 8px; padding: .75rem 1rem; font: inherit; font-size: .8rem; background: #58a6ff10; color: var(--text-primary); cursor: pointer; }
.notice-sound-button:hover { background: #58a6ff22; }
.notice-sound-button:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 4px; }
.notice-sound-button:disabled { cursor: wait; opacity: .65; }
.notice-sound-button svg { width: 18px; height: 18px; stroke: var(--accent-blue); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.notice-sound-button > span { border-left: 1px solid var(--border-color); padding-left: .6rem; color: var(--text-secondary); font-size: .7rem; }
.notice-sound-status { min-height: 1.4rem; max-width: 420px; margin: .75rem auto 0; font-size: .7rem; color: var(--text-secondary); }
.is-playing .notices-emblem svg { animation: notice-ring 1s ease-in-out; transform-origin: 50% 15%; }
@keyframes notice-ring { 0%, 100% { transform: rotate(0); } 15%, 45% { transform: rotate(12deg); } 30%, 60% { transform: rotate(-12deg); } 75% { transform: rotate(5deg); } }
.page-intro { padding: .5rem .25rem; }
.page-intro h1, .page-intro h2 { font-size: 1.15rem; margin-bottom: .5rem; }
.page-intro p { max-width: 1050px; color: var(--text-secondary); font-size: .8rem; line-height: 1.8; }
.page-intro a, .resource-links a { color: var(--accent-blue); }
.resources-main { align-content: start; }
.resource-section { padding: 1.25rem; }
.resource-section h2 { font-size: .95rem; margin-bottom: 1rem; }
.resource-links { display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; list-style: none; font-size: .85rem; }
.resource-links a { text-decoration: none; overflow-wrap: anywhere; }
.resource-links a:hover { text-decoration: underline; }
.resource-links a:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.privacy-links { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 1rem; padding-top: .8rem; font-size: .75rem; }
.privacy-links a, .privacy-links button { color: var(--text-secondary); }
.privacy-links button { font: inherit; background: none; border: none; padding: 0; text-decoration: underline; cursor: pointer; }
.terminal-footer { flex-wrap: wrap; gap: .5rem; }
.privacy-banner { position: fixed; z-index: 1000; bottom: 0; left: 0; right: 0; padding: 1.25rem; background: var(--bg-secondary); border-top: 1px solid var(--border-color); box-shadow: 0 -5px 30px var(--shadow); display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.privacy-banner-copy { flex: 1; min-width: 240px; max-width: 900px; font-size: .85rem; }
.privacy-banner p { margin-top: .4rem; }
.privacy-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.privacy-actions button { font: inherit; padding: .65rem .9rem; border: 1px solid var(--accent-blue); border-radius: 6px; background: var(--bg-tertiary); color: var(--text-primary); cursor: pointer; }
.privacy-banner a, .privacy-dialog a, .legal-content a { color: var(--accent-blue); }
.privacy-dialog { max-width: 620px; width: calc(100% - 2rem); padding: 1.5rem; margin: auto; border: 1px solid var(--border-color); border-radius: 10px; color: var(--text-primary); background: var(--bg-secondary); }
.privacy-dialog::backdrop { background: rgba(0,0,0,.65); }
.privacy-dialog h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.privacy-dialog p { margin: .75rem 0; font-size: .85rem; }
.privacy-option { display: flex; align-items: flex-start; gap: .6rem; margin: 1rem 0; font-size: .85rem; }
.privacy-close { display: block; margin-top: 1rem; font: inherit; background: none; border: 0; color: var(--text-secondary); text-decoration: underline; cursor: pointer; }
.chart-consent-placeholder { height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1rem; padding: 1rem; text-align: center; color: var(--text-secondary); }
.legal-content h2 { margin-top: 1.5rem; font-size: 1rem; }
.legal-content p, .legal-content li, .legal-content dd { margin: .75rem 0; font-size: .85rem; line-height: 1.8; }
.legal-content ul { padding-left: 1.25rem; }
.legal-content dt { font-weight: bold; }
.legal-table-wrap { overflow-x: auto; }
.legal-table { width: 100%; border-collapse: collapse; min-width: 600px; font-size: .8rem; margin: 1rem 0; }
.legal-table th, .legal-table td { padding: .75rem; text-align: left; border: 1px solid var(--border-color); }
.legal-draft { padding: .8rem; border: 1px solid var(--accent-yellow); border-radius: 6px; color: var(--accent-yellow); }
.documents-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.documents-controls label { display: flex; flex-direction: column; gap: .4rem; font-size: .8rem; color: var(--text-secondary); max-width: 100%; }
.documents-controls select { max-width: 100%; }
.documents-search { flex: 1; min-width: 180px; }
.documents-search input { font: inherit; color: var(--text-primary); background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 6px; padding: .5rem .75rem; width: 100%; }
.documents-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; font-size: .75rem; color: var(--text-secondary); }
.document-kind { flex-shrink: 0; color: var(--accent-blue); background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 8px; padding: .6rem; align-self: flex-start; font-size: .8rem; }
.document-origin { color: var(--text-secondary); font-size: .72rem; text-decoration: none; margin-top: .25rem; }
.panel-note a { color: var(--accent-blue); }
.chart-container.tradingview-chart { height: 480px; }
@media (max-width: 640px) { .chart-container.tradingview-chart { height: 400px; } }
.positive { color: var(--accent-green); }
.negative { color: var(--accent-red); }
.top-nav {
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
    padding: .9rem 1.5rem; background: var(--bg-secondary);
    border: 1px solid var(--border-color); border-bottom: none;
}
.top-nav a { position: relative; color: var(--text-secondary); font-size: .85rem; text-decoration: none; padding: .3rem 0; white-space: nowrap; }
.top-nav a:not(:last-of-type)::after {
    content: ''; position: absolute; right: -.75rem; top: 50%;
    width: 1px; height: 1rem; background: var(--border-color); transform: translateY(-50%);
}
.top-nav a[aria-current], .top-nav a:hover { color: var(--accent-blue); }
.top-nav a, .nav-links a { display: inline-flex; align-items: center; gap: .45rem; }
.nav-source {
    display: inline-block; white-space: nowrap; font-size: .62rem; line-height: 1.4;
    padding: .15rem .4rem; border: 1px solid var(--border-color); border-radius: 4px;
    background: var(--bg-primary); color: var(--text-secondary); letter-spacing: .025em;
}
.environment-label { margin-left: auto; color: var(--text-muted); font-size: .7rem; }
.market-summary {
    display: flex; align-items: center; flex-wrap: wrap; gap: 1.5rem;
    padding: 1.5rem; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 8px;
}
.eyebrow { color: var(--text-secondary); font-size: .75rem; letter-spacing: .08em; }
.hero-price { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-change { font-size: 1.5rem; }
.summary-change small { display: block; color: var(--text-secondary); font-size: .75rem; }
.market-summary button { margin-left: auto; }
.data-notice { flex-basis: 100%; padding-top: .8rem; border-top: 1px solid var(--border-color); font-size: .8rem; color: var(--text-secondary); }
.data-notice.stale { color: var(--accent-yellow); }
.panel-note { color: var(--text-secondary); font-size: .75rem; line-height: 1.6; margin: .75rem 0; overflow-wrap: anywhere; }
.chart-container { height: auto; min-height: 180px; }
.quote-details { display: block; }
.quote-details h3 { font-size: .9rem; margin: 1.2rem 0 .8rem; }
.detail-row { gap: 1rem; align-items: center; }
.detail-label { text-transform: none; color: var(--text-secondary); }
.source-timestamp { line-height: 1.7; }
.quote-header, .chart-header { gap: 1rem; flex-wrap: wrap; }
.news-controls, .cnmv-controls { flex-wrap: wrap; }
.trades-table-wrap { overflow-x: auto; }
.trades-table { min-width: 600px; }
.page-btn:disabled { cursor: default; }
a:focus-visible, button:focus-visible, select:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 4px; }
@media (max-width: 640px) {
    .top-nav { gap: 1rem; padding: .75rem; }
    .top-nav a:not(:last-of-type)::after { right: -.5rem; }
    .environment-label { flex-basis: 100%; margin: 0; }
    .quote-panel, .chart-panel, .orderbook-panel, .market-summary { padding: 1rem; min-width: 0; }
    .terminal-main { padding: .6rem; }
    .company-details { flex-wrap: wrap; gap: .4rem; }
    .news-controls, .cnmv-controls { gap: .6rem; width: 100%; }
    .last-update { overflow-wrap: anywhere; }
    .quote-header { align-items: flex-start; }
    .trades-title { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
