:root {
    --bg: #0f1420;
    --panel: #171d2e;
    --panel-2: #1e2740;
    --border: #2a3452;
    --text: #e6e9f2;
    --muted: #8b93a8;
    --green: #24c38a;
    --red: #f2545b;
    --blue: #5b8def;
    --amber: #e8a33d;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 24px;
}
h1 { font-size: 20px; margin: 0 0 4px; }
.subtitle { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 16px;
    max-width: 1200px;
}
@media (max-width: 900px) {
    .grid { grid-template-columns: 1fr; }
}
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}
.panel h2 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin: 0 0 12px;
}
label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin: 10px 0 4px;
}
input[type=text], input[type=password], input[type=number], select {
    width: 100%;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
}
.row { display: flex; gap: 10px; }
.row > div { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; font-size: 12px; }
button {
    cursor: pointer;
    border: none;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.15s;
}
button:disabled { opacity: 0.4; cursor: not-allowed; }
button:not(:disabled):hover { opacity: 0.85; }
.btn-primary { background: var(--blue); color: white; }
.btn-start { background: var(--green); color: #06251a; }
.btn-stop { background: var(--red); color: #2b0a0c; }
.btn-row { display: flex; gap: 8px; margin-top: 14px; }
.btn-row button { flex: 1; }
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0.03em;
}
.badge-demo { background: rgba(232,163,61,0.15); color: var(--amber); }
.badge-real { background: rgba(242,84,91,0.15); color: var(--red); }
.badge-off { background: rgba(139,147,168,0.15); color: var(--muted); }
.badge-on { background: rgba(36,195,138,0.15); color: var(--green); }
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.stat {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}
.stat .label { font-size: 11px; color: var(--muted); }
.stat .value { font-size: 18px; font-weight: 700; margin-top: 2px; }
.pl-pos { color: var(--green); }
.pl-neg { color: var(--red); }
.progress-wrap { margin-top: 12px; }
.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 5px;
}
.progress-bar {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition: width 0.3s ease;
}
.fill-green { background: var(--green); }
.fill-red { background: var(--red); }
canvas { width: 100%; height: 100px; display: block; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
.result-win { color: var(--green); font-weight: 600; }
.result-loss { color: var(--red); font-weight: 600; }
.result-pending { color: var(--amber); }
#log {
    background: #0a0e17;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    height: 180px;
    overflow-y: auto;
    font-family: "SF Mono", Menlo, monospace;
    font-size: 11px;
    color: #9fb0d0;
    white-space: pre-wrap;
}
.log-error { color: var(--red); }
.log-trade { color: var(--green); }
.warn-box {
    background: rgba(232,163,61,0.1);
    border: 1px solid rgba(232,163,61,0.35);
    color: var(--amber);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    margin-bottom: 16px;
    line-height: 1.5;
}
.hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.input-with-toggle { position: relative; }
.input-with-toggle input { padding-right: 56px; }
.toggle-visibility {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: var(--muted);
    border: none;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
}
.toggle-visibility:hover { color: var(--text); opacity: 1; }
.app-header { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.logo-badge { background: #fff; border-radius: 8px; padding: 6px 10px; display: flex; align-items: center; flex-shrink: 0; }
.logo-badge svg { height: 22px; width: auto; display: block; }
.app-header h1 { margin: 0; }