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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
}

/* Header */
header {
    padding: 12px 40px;
    background: #16213e;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #2a3555;
    position: sticky;
    top: 0;
    z-index: 50;
}

.back-link {
    color: #7ab648;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}
.back-link:hover { text-decoration: underline; }

h1 { font-size: 18px; font-weight: 700; }

.header-sub { font-size: 13px; color: #888; }

/* Main content */
main {
    max-width: 960px;
    margin: 0 auto;
    padding: 30px 40px 60px;
}

/* Hero row */
.hero-row {
    display: flex;
    gap: 24px;
    margin-bottom: 40px;
}

.hero-card {
    flex: 1;
    background: #16213e;
    border-radius: 8px;
    padding: 20px 24px;
    border: 1px solid #2a3555;
}

.hero-value {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.1;
    color: #e0e0e0;
}

.stat-red { color: #d9381e; }

.hero-label {
    font-size: 13px;
    color: #ccc;
    margin-top: 4px;
    font-weight: 600;
}

.hero-sub {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

/* Sections */
.section {
    margin-bottom: 36px;
}

h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #e0e0e0;
}

.section-sub {
    font-size: 12px;
    color: #888;
    margin-bottom: 16px;
}

/* Horizontal bar chart */
.hbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

.hbar-label {
    width: 200px;
    text-align: right;
    font-size: 12px;
    color: #ccc;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hbar-track {
    flex: 1;
    height: 20px;
    background: #0f1629;
    border-radius: 4px;
    overflow: hidden;
}

.hbar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s;
}

.hbar-score {
    width: 32px;
    text-align: right;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.hbar-meta {
    font-size: 11px;
    color: #888;
    width: 220px;
    flex-shrink: 0;
}

/* Timeline cards */
.timeline-row {
    display: flex;
    gap: 16px;
}

.tl-card {
    flex: 1;
    background: #16213e;
    border-radius: 8px;
    padding: 16px 20px;
    border: 1px solid #2a3555;
}

.tl-header {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #e0e0e0;
}

.tl-stat {
    font-size: 18px;
    font-weight: 700;
    color: #e0e0e0;
    margin-bottom: 4px;
}
.tl-stat span {
    font-size: 12px;
    font-weight: 400;
    color: #888;
}

.tl-top {
    font-size: 11px;
    color: #888;
    margin-top: 10px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tl-occ {
    font-size: 12px;
    color: #ccc;
    padding: 2px 0;
    display: flex;
    justify-content: space-between;
}
.tl-occ span {
    color: #888;
    flex-shrink: 0;
    margin-left: 8px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

thead th {
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    padding: 8px 10px;
    border-bottom: 1px solid #2a3555;
}

th.num, td.num { text-align: right; }

tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid #1e2d4d;
    color: #ccc;
}

tbody tr:hover { background: #1e2d4d; }

/* Sector split cards */
.sector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.sector-card {
    background: #16213e;
    border-radius: 8px;
    padding: 16px 18px;
    border: 1px solid #2a3555;
}

.sector-header {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid;
}

.sector-stat-row {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.sector-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sector-val {
    font-size: 20px;
    font-weight: 700;
    color: #e0e0e0;
    line-height: 1.2;
}

.sector-lbl {
    font-size: 10px;
    color: #888;
}

.sector-top {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 10px;
    margin-bottom: 4px;
}

.sector-occ {
    font-size: 11px;
    color: #ccc;
    padding: 2px 0;
    display: flex;
    justify-content: space-between;
}

.sector-occ span {
    color: #888;
    flex-shrink: 0;
    margin-left: 6px;
}

/* Scatter plot */
#scatter-chart {
    position: relative;
}

#scatter-chart svg {
    display: block;
}

.scatter-tip {
    position: absolute;
    background: rgba(22,33,62,0.95);
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: #e0e0e0;
    pointer-events: none;
    z-index: 10;
    max-width: 350px;
    line-height: 1.4;
}

/* Callout */
.callout {
    margin-top: 12px;
    padding: 12px 16px;
    background: #1e2d4d;
    border-left: 3px solid #d9381e;
    border-radius: 4px;
    font-size: 13px;
    color: #ccc;
}

/* Growth trajectory grid */
.trajectory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.traj-card {
    background: #16213e;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #2a3555;
}

.traj-title {
    font-size: 12px;
    font-weight: 600;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.traj-meta {
    font-size: 10px;
    color: #888;
    margin-bottom: 6px;
}

.traj-years {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #666;
    margin-top: 2px;
}

/* Moat vs Frontlines */
.moat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.moat-col {
    background: #16213e;
    border-radius: 8px;
    padding: 16px 20px;
    border: 1px solid #2a3555;
}

.moat-header {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid;
}

.moat-safe {
    color: #2d7d46;
    border-color: #2d7d46;
}

.moat-risk {
    color: #e8842a;
    border-color: #e8842a;
}

.moat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
}

.moat-label {
    width: 130px;
    font-size: 12px;
    color: #ccc;
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
}

.moat-bar-wrap {
    flex: 1;
    height: 18px;
    background: #0f1629;
    border-radius: 4px;
    overflow: hidden;
}

.moat-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s;
}

.moat-stats {
    width: 140px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex-shrink: 0;
}

.moat-count {
    font-size: 12px;
    font-weight: 700;
    color: #e0e0e0;
}

.moat-score {
    font-size: 10px;
    font-weight: 600;
}

/* Footer */
footer {
    margin-top: 48px;
    padding-top: 16px;
    border-top: 1px solid #2a3555;
    font-size: 12px;
    color: #999;
}

footer a {
    color: #7ab648;
    text-decoration: none;
}
footer a:hover { text-decoration: underline; }

.footer-sources {
    font-size: 9px;
    color: #666;
    margin-top: 6px;
    line-height: 1.4;
}
