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

:root {
    --bg: #0d1117;
    --bg2: #161b22;
    --bg3: #1c2128;
    --border: #30363d;
    --text: #e6edf3;
    --text2: #8b949e;
    --green: #3fb950;
    --green-bg: #0d1f0d;
    --red: #f85149;
    --red-bg: #1f0d0d;
    --blue: #58a6ff;
    --yellow: #d29922;
    --yellow-bg: #2d1f0d;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Macro Bar */
.macro-bar {
    display: flex;
    gap: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    font-size: 0.8rem;
    padding: 0 1rem;
}
.macro-item {
    padding: 0.5rem 1rem;
    white-space: nowrap;
    border-right: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.macro-item:last-child { border-right: none; }
.macro-label { color: var(--text2); }
.macro-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.macro-change { font-size: 0.75rem; }

/* Nav */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
}
.nav-brand { font-weight: 700; font-size: 1.2rem; color: var(--green); }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--text2); font-size: 0.9rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }

/* Search */
.search-bar {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}
.search-bar input {
    flex: 1;
    padding: 0.5rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px 0 0 6px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
}
.search-bar input:focus { outline: none; border-color: var(--blue); }
.search-bar button {
    padding: 0.5rem 1rem;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

/* Main */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Cards */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.card h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card h3 {
    font-size: 0.95rem;
    color: var(--text2);
    margin-bottom: 0.75rem;
}

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem 0.75rem; text-align: left; }
th {
    color: var(--text2);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
td { border-bottom: 1px solid var(--border); font-size: 0.9rem; }
tr:last-child td { border-bottom: none; }
.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-variant-numeric: tabular-nums; }

/* Colors */
.green { color: var(--green); }
.red { color: var(--red); }
.yellow { color: var(--yellow); }
.text-muted { color: var(--text2); }

/* Signal Badges */
.signal {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.signal-strong-buy, .signal-buy { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.signal-strong-sell, .signal-sell { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.signal-hold, .signal-neutral { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow); }
.signal-bullish { background: var(--green-bg); color: var(--green); }
.signal-bearish { background: var(--red-bg); color: var(--red); }
.signal-oversold { background: var(--green-bg); color: var(--green); }
.signal-overbought { background: var(--red-bg); color: var(--red); }

/* Stock row */
.stock-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.stock-row:last-child { border-bottom: none; }
.stock-name { font-weight: 500; }
.stock-ticker { color: var(--text2); font-size: 0.85rem; }
.stock-price { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Market tabs */
.market-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
}
.market-tab {
    padding: 0.6rem 1.5rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text2);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}
.market-tab:first-child { border-radius: 6px 0 0 6px; }
.market-tab:last-child { border-radius: 0 6px 6px 0; }
.market-tab.active {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}
.market-tab:hover:not(.active) { background: var(--bg3); text-decoration: none; }

/* Hero */
.hero {
    text-align: center;
    padding: 2rem 0 1.5rem;
}
.hero h1 { font-size: 2rem; font-weight: 300; margin-bottom: 0.5rem; }
.hero p { color: var(--text2); margin-bottom: 1.5rem; }

/* Analysis header */
.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.analysis-title h1 { font-size: 1.5rem; }
.analysis-title .ticker-label { color: var(--text2); font-size: 1rem; }
.analysis-price { text-align: right; }
.analysis-price .price { font-size: 2rem; font-weight: 700; }
.analysis-price .change { font-size: 1rem; }

/* Metric grid */
.metric { text-align: center; padding: 0.75rem; }
.metric-value { font-size: 1.2rem; font-weight: 600; }
.metric-label { font-size: 0.75rem; color: var(--text2); margin-top: 0.25rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.8rem; }
.btn-danger { background: var(--red); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text2);
}
.btn-outline:hover { border-color: var(--text); color: var(--text); }

/* Timeframe tabs */
.tf-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.tf-tab {
    padding: 0.3rem 0.8rem;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text2);
    font-size: 0.8rem;
    text-decoration: none;
}
.tf-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Chart */
.chart-container {
    width: 100%;
    height: 300px;
    background: var(--bg);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text2);
    overflow: hidden;
    position: relative;
}

/* Watchlist form */
.watchlist-add {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.watchlist-add input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
}

/* Footer */
.disclaimer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text2);
    font-size: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}
