@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --bg: #0a0e1a;
    --panel: #10192b;
    --panel-2: #141f36;
    --border: #1f2c47;
    --text: #e7ecf5;
    --text-dim: #8592ac;
    --buy: #33d17a;
    --sell: #ff5470;
    --hold: #f2b84b;
    --accent: #f2b84b;
    --idx-red: #c6425e;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

button {
    font-family: var(--font-body);
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Ticker marquee (signature element) ---------- */
.ticker-wrap {
    background: #05070d;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    white-space: nowrap;
    padding: 8px 0;
}

.ticker-track {
    display: inline-block;
    padding-left: 100%;
    animation: ticker-scroll 32s linear infinite;
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--text-dim);
}

.ticker-track span { margin-right: 48px; }
.ticker-track .up { color: var(--buy); }
.ticker-track .down { color: var(--sell); }

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
    .ticker-track { animation: none; padding-left: 16px; }
}

/* ---------- Layout ---------- */
.wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 28px 20px 64px;
}

.top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--idx-red), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    color: #0a0e1a;
    font-size: 15px;
}

.brand h1 {
    font-family: var(--font-display);
    font-size: 20px;
    margin: 0;
    font-weight: 700;
}

.brand p {
    margin: 2px 0 0;
    color: var(--text-dim);
    font-size: 13px;
}

.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.status-pill {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 999px;
}

.btn {
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.15s ease, transform 0.1s ease;
}

.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--accent);
    color: #1a1305;
    border-color: var(--accent);
    font-weight: 600;
}

.btn-primary:hover { filter: brightness(1.08); }

/* ---------- Hero signal card ---------- */
.hero {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 160px at 15% 0%, rgba(242, 184, 75, 0.08), transparent 60%);
    pointer-events: none;
}

.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.signal-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 34px;
    padding: 6px 4px;
}

.signal-badge .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.signal-badge.buy { color: var(--buy); }
.signal-badge.sell { color: var(--sell); }
.signal-badge.hold { color: var(--hold); }
.signal-badge .dot.buy { background: var(--buy); box-shadow: 0 0 12px var(--buy); }
.signal-badge .dot.sell { background: var(--sell); box-shadow: 0 0 12px var(--sell); }
.signal-badge .dot.hold { background: var(--hold); box-shadow: 0 0 12px var(--hold); }

.price-block { text-align: right; font-family: var(--font-mono); }
.price-block .price { font-size: 22px; font-weight: 600; }
.price-block .time { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.sparkline { width: 100%; height: 60px; display: block; margin: 18px 0 4px; }

.reasons {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: grid;
    gap: 8px;
}

.reasons li {
    font-size: 14px;
    color: var(--text-dim);
    padding-left: 18px;
    position: relative;
}

.reasons li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.empty-state {
    color: var(--text-dim);
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

/* ---------- Indicator grid ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
}

.card .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.card .value {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 600;
}

.card .sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.card .value.up { color: var(--buy); }
.card .value.down { color: var(--sell); }

/* ---------- Sections ---------- */
.section {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 20px;
}

.section h2 {
    font-family: var(--font-display);
    font-size: 16px;
    margin: 0 0 14px;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 500; text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em; }
td.mono, th.mono { font-family: var(--font-mono); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; font-family: var(--font-mono); }
.tag.buy { background: rgba(51, 209, 122, 0.15); color: var(--buy); }
.tag.sell { background: rgba(255, 84, 112, 0.15); color: var(--sell); }
.tag.hold { background: rgba(242, 184, 75, 0.15); color: var(--hold); }

/* ---------- Settings form ---------- */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px 16px;
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.field input[type=text],
.field input[type=number],
.field input[type=password] {
    width: 100%;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-mono);
}

.field.checkbox { display: flex; align-items: center; gap: 8px; flex-direction: row; }
.field.checkbox label { margin: 0; color: var(--text); font-size: 14px; }

.settings-footer { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-msg { font-size: 13px; color: var(--text-dim); }
.form-msg.ok { color: var(--buy); }
.form-msg.err { color: var(--sell); }

details.section summary {
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 16px;
    list-style: none;
}
details.section summary::-webkit-details-marker { display: none; }
details.section summary::before { content: '▸ '; color: var(--accent); }
details.section[open] summary::before { content: '▾ '; }
details.section summary ~ * { margin-top: 14px; }

/* ---------- Login overlay ---------- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 13, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}

.overlay.hidden { display: none; }

.login-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    width: 100%;
    max-width: 340px;
    text-align: center;
}

.login-box h2 { font-family: var(--font-display); margin: 0 0 6px; font-size: 18px; }
.login-box p { color: var(--text-dim); font-size: 13px; margin: 0 0 16px; }
.login-box input { width: 100%; margin-bottom: 12px; }

footer.disclaimer {
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 24px;
    line-height: 1.6;
}
