:root {
  --as-bg: #080c12;
  --as-card: #0f1622;
  --as-card-alt: #131d2c;
  --as-border: #1e2d42;
  --as-text: #e6edf6;
  --as-muted: #8ea0b8;
  --as-accent: #10b981;
  --as-blue: #3b82f6;
  --as-warn: #f59e0b;
  --as-bad: #ef4444;
}

* { box-sizing: border-box; }
body[data-page="auto-scalp"] {
  margin: 0;
  background: var(--as-bg);
  color: var(--as-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
}

.as-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: #0b111a;
  border-bottom: 1px solid var(--as-border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.as-brand-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.as-brand { color: #fff; font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -0.02em; }
.as-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(59, 130, 246, 0.16); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.35);
}
.as-px { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: 15px; color: #f8fafc; }
.as-mode-pill {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: rgba(16, 185, 129, 0.16); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4);
}
.as-mode-pill.paused { background: rgba(245, 158, 11, 0.16); color: #fcd34d; border-color: rgba(245, 158, 11, 0.4); }

.as-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.as-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 12px; border-radius: 7px; font-size: 13px; font-weight: 600;
  color: var(--as-text); background: var(--as-card-alt); border: 1px solid var(--as-border);
  text-decoration: none; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.as-btn:hover { border-color: #3b82f6; background: #172436; }
.as-btn-primary { background: #059669; border-color: #10b981; color: #fff; }
.as-btn-primary:hover { background: #047857; border-color: #34d399; }
.as-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.as-main { max-width: 1380px; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.as-hero {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 18px 20px; border-radius: 12px; background: linear-gradient(135deg, #0f1928 0%, #0d1520 100%);
  border: 1px solid var(--as-border);
}
.as-eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: #60a5fa; text-transform: uppercase; }
.as-hero h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.as-sub { margin: 0; color: var(--as-muted); max-width: 880px; font-size: 14px; }

.as-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 18px; }
.as-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
@media (max-width: 640px) { .as-grid-2 { grid-template-columns: 1fr; } }

.as-card {
  background: var(--as-card); border: 1px solid var(--as-border); border-radius: 12px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 14px;
}
.as-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.as-card-head h2 { margin: 0; font-size: 17px; }
.as-tag {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: #162234; color: var(--as-muted); border: 1px solid var(--as-border);
}
.as-tag-safe { color: #6ee7b7; border-color: rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.1); }

.as-toggle-banner {
  padding: 12px 14px; border-radius: 9px; background: #132030; border: 1px solid #243b56;
}
.as-switch-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.as-switch-row input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; accent-color: #10b981; }
.as-switch-copy { display: flex; flex-direction: column; gap: 2px; }
.as-switch-copy small { color: var(--as-muted); font-size: 12px; }

.as-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.as-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--as-muted); font-weight: 600; }
.as-field input, .as-field select {
  padding: 8px 10px; border-radius: 7px; border: 1px solid var(--as-border);
  background: #0a1018; color: var(--as-text); font-size: 13px; font-family: inherit;
}
.as-form-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.as-msg { font-size: 13px; color: #6ee7b7; }
.as-admin-hint { margin: 8px 0 0; font-size: 12px; color: var(--as-warn); }
.as-admin-hint a, .as-mini-note a { color: #60a5fa; }

.as-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.as-kpi {
  padding: 10px 12px; border-radius: 9px; background: var(--as-card-alt); border: 1px solid var(--as-border);
  display: flex; flex-direction: column; gap: 2px;
}
.as-kpi span { font-size: 11px; color: var(--as-muted); }
.as-kpi strong { font-size: 17px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.as-kpi small { font-size: 11px; color: var(--as-muted); }

.as-open-box { padding: 12px 14px; border-radius: 9px; background: #0b121c; border: 1px solid var(--as-border); }
.as-open-box h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: #93c5fd; }
.as-pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 13px; }
.as-pos-grid span { display: block; font-size: 11px; color: var(--as-muted); }

.as-ledger-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  padding: 10px 12px; border-radius: 9px; background: var(--as-card-alt); border: 1px solid var(--as-border);
}
.as-ledger-summary span { display: block; font-size: 11px; color: var(--as-muted); }
.as-ledger-summary strong { font-size: 15px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.as-mini-note { font-size: 12px; color: var(--as-muted); padding: 10px 12px; border-radius: 8px; background: #0c1420; border-left: 3px solid #3b82f6; }

.as-compare-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.as-cmp-card { padding: 14px 16px; border-radius: 10px; border: 1px solid var(--as-border); background: var(--as-card-alt); }
.as-cmp-good { border-color: rgba(16, 185, 129, 0.45); background: rgba(16, 185, 129, 0.07); }
.as-cmp-warn { border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.06); }
.as-cmp-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; color: var(--as-muted); }
.as-cmp-val { display: block; font-size: 24px; margin: 4px 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.as-cmp-card p { margin: 0; font-size: 12px; color: var(--as-muted); }

.as-table-wrap { overflow-x: auto; }
.as-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.as-table th, .as-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--as-border); }
.as-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--as-muted); }
.pos-r { color: #34d399; font-weight: 700; }
.neg-r { color: #f87171; font-weight: 700; }
.as-muted { color: var(--as-muted); font-size: 13px; margin: 0; }

.as-subcard { padding: 14px; border-radius: 10px; background: var(--as-card-alt); border: 1px solid var(--as-border); }
.as-subcard h3 { margin: 0 0 10px; font-size: 14px; color: #93c5fd; }
.as-dl { margin: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.as-dl div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed rgba(142, 160, 184, 0.16); padding-bottom: 5px; }
.as-dl dt { color: var(--as-muted); }
.as-dl dd { margin: 0; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
