:root {
  color-scheme: dark;
  --ink: #e7eef7;
  --muted: #8ea3b7;
  --soft: #c8d6e6;
  --line: rgba(130, 160, 190, .22);
  --line-strong: rgba(98, 215, 255, .38);
  --bg: #07101a;
  --panel: rgba(12, 23, 37, .86);
  --panel-strong: rgba(16, 30, 48, .94);
  --field: rgba(5, 15, 26, .72);
  --blue: #4aa3ff;
  --cyan: #48dfd0;
  --green: #48d889;
  --amber: #ffb454;
  --red: #ff6875;
  --violet: #9b8cff;
  --shadow: 0 18px 46px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, #081421 0%, #07101a 46%, #050b13 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(91, 153, 210, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 153, 210, .08) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .95), rgba(0, 0, 0, .32));
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--amber));
  opacity: .78;
}

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

.shell {
  position: relative;
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.topbar, .panel, .metric, .trade-table, .worker-banner, .service-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 118px;
  padding: 20px 22px;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(15, 37, 61, .92), rgba(9, 18, 31, .92)),
    repeating-linear-gradient(90deg, rgba(72, 223, 208, .08) 0 1px, transparent 1px 64px);
  border-color: rgba(91, 153, 210, .34);
  overflow: hidden;
}

.brand-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid rgba(72, 223, 208, .58);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(72, 223, 208, .18), rgba(74, 163, 255, .08)),
    #081624;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), 0 0 24px rgba(72, 223, 208, .16);
}

.brand-mark::before {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 10px;
  height: 20px;
  background:
    linear-gradient(var(--cyan), var(--cyan)) 0 9px / 5px 11px no-repeat,
    linear-gradient(var(--blue), var(--blue)) 10px 4px / 5px 16px no-repeat,
    linear-gradient(var(--amber), var(--amber)) 20px 0 / 5px 20px no-repeat;
}

.brand-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand h1 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
  margin: 0;
}

.brand p, .muted {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

.language-switch select {
  width: auto;
  min-width: 112px;
  min-height: 38px;
  padding: 7px 30px 7px 10px;
}

.system-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(72, 223, 208, .28);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(3, 13, 23, .46);
  font-weight: 750;
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(72, 223, 208, .13);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(390px, .98fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 18px;
}

.panel h2::before {
  content: "";
  width: 7px;
  height: 20px;
  border-radius: 4px;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(72, 223, 208, .34);
}

.command-panel {
  border-color: rgba(72, 223, 208, .28);
}

.result-panel {
  border-color: rgba(74, 163, 255, .3);
}

.history-panel, .json-panel {
  margin-top: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--soft);
  font-weight: 700;
  margin-bottom: 12px;
}

textarea, input, select {
  width: 100%;
  border: 1px solid rgba(135, 162, 194, .28);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  background: var(--field);
  color: var(--ink);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea:focus, input:focus, select:focus {
  border-color: rgba(72, 223, 208, .76);
  box-shadow: 0 0 0 3px rgba(72, 223, 208, .12);
  background: rgba(7, 20, 34, .94);
}

textarea {
  min-height: 205px;
  resize: vertical;
  line-height: 1.72;
}

select {
  cursor: pointer;
}

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.template-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.template-picker label {
  margin-bottom: 0;
}

button {
  border: 1px solid rgba(72, 223, 208, .32);
  border-radius: 6px;
  min-height: 42px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(72, 223, 208, .98), rgba(39, 139, 223, .98));
  color: #04111d;
  font-weight: 850;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease, border-color .16s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

button.secondary {
  background: rgba(134, 160, 190, .14);
  color: var(--ink);
  border-color: rgba(134, 160, 190, .28);
}

button.compact {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

button:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  min-height: 92px;
  padding: 13px;
  background:
    linear-gradient(180deg, rgba(20, 39, 61, .95), rgba(9, 20, 34, .94));
  border-color: rgba(91, 153, 210, .24);
  box-shadow: none;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}

.metric strong {
  font-family: "Segoe UI", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 24px;
  color: var(--ink);
}

.rule-review {
  margin: 14px 0 16px;
  padding: 14px;
  border: 1px solid rgba(91, 153, 210, .24);
  border-radius: 8px;
  background: rgba(5, 14, 24, .50);
}

.review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.review-head h3,
.review-columns h3,
.interpretation-block h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.review-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.rule-item {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 11px 12px;
  border: 1px solid rgba(130, 160, 190, .18);
  border-radius: 6px;
  background: rgba(9, 22, 36, .72);
}

.rule-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rule-item strong {
  color: var(--ink);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.source-pill {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid rgba(72, 223, 208, .22);
  border-radius: 999px;
  background: rgba(72, 223, 208, .08);
  color: var(--cyan) !important;
  font-size: 11px !important;
}

.review-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 13px;
}

.review-columns section,
.interpretation-block {
  padding: 12px;
  border: 1px solid rgba(130, 160, 190, .16);
  border-radius: 6px;
  background: rgba(6, 16, 28, .58);
}

.interpretation-block {
  margin-top: 12px;
}

.review-list {
  display: grid;
  gap: 7px;
  margin: 9px 0 0;
  padding-left: 18px;
  color: var(--soft);
  line-height: 1.58;
}

.review-list li::marker {
  color: var(--cyan);
}

.warning-list li::marker {
  color: var(--amber);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 13px 14px;
  border: 1px dashed rgba(130, 160, 190, .28);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(7, 20, 34, .54);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(139, 164, 190, .16);
  color: var(--muted);
  font-weight: 800;
  line-height: 1.25;
}

.status.done {
  background: rgba(72, 216, 137, .14);
  color: var(--green);
}

.status.running {
  background: rgba(255, 180, 84, .14);
  color: var(--amber);
}

.status.failed {
  background: rgba(255, 104, 117, .14);
  color: var(--red);
}

canvas {
  width: 100%;
  height: 238px;
  border: 1px solid rgba(91, 153, 210, .24);
  border-radius: 6px;
  background: #071421;
}

.trade-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: rgba(5, 14, 24, .55);
  box-shadow: none;
}

.trade-table th, .trade-table td {
  padding: 10px 11px;
  border-bottom: 1px solid rgba(130, 160, 190, .16);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

.trade-table th {
  color: var(--soft);
  background: rgba(20, 39, 61, .76);
  font-weight: 800;
}

.trade-table td {
  color: var(--muted);
}

.trade-table tr:last-child td {
  border-bottom: 0;
}

.positive { color: var(--green); font-weight: 850; }
.negative { color: var(--red); font-weight: 850; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login .panel {
  width: min(430px, 100%);
  border-color: rgba(72, 223, 208, .3);
}

.login-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.login-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 104, 117, .34);
  border-radius: 6px;
  background: rgba(255, 104, 117, .10);
  color: #ffb3ba;
  font-weight: 750;
}

.hidden {
  display: none !important;
}

.notice {
  background: rgba(255, 180, 84, .1);
  border: 1px solid rgba(255, 180, 84, .3);
  border-radius: 6px;
  padding: 10px 12px;
  color: #ffd39a;
  margin-bottom: 12px;
}

.service-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.42fr);
  gap: 18px;
  align-items: stretch;
  padding: 16px 18px;
  margin-bottom: 14px;
  border-left: 4px solid var(--cyan);
  background:
    linear-gradient(135deg, rgba(12, 27, 45, .92), rgba(8, 18, 31, .88));
}

.service-note strong {
  display: block;
  color: var(--ink);
}

.service-note > div > strong {
  font-size: 17px;
  margin-bottom: 8px;
}

.service-note p {
  margin: 0 0 7px;
  color: var(--soft);
  line-height: 1.68;
}

.service-note p:last-child {
  margin-bottom: 0;
}

.service-note ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-note li {
  display: grid;
  gap: 5px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(91, 153, 210, .24);
  border-radius: 6px;
  background: rgba(4, 14, 24, .45);
}

.service-note li span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.worker-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.worker-banner strong {
  display: block;
  margin-bottom: 3px;
}

.worker-banner span, .worker-banner p {
  color: var(--muted);
  font-size: 13px;
}

.worker-banner p {
  max-width: 460px;
  margin: 0;
}

.worker-banner.online {
  border-color: rgba(72, 216, 137, .34);
  background: rgba(18, 53, 41, .52);
}

.worker-banner.online strong { color: var(--green); }

.worker-banner.offline {
  border-color: rgba(255, 180, 84, .34);
  background: rgba(57, 39, 14, .48);
}

.worker-banner.offline strong { color: var(--amber); }

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.job-meta strong {
  color: var(--ink);
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.history-head h2 { margin: 0; }

.job-table .status {
  min-height: 24px;
  padding: 4px 8px;
  white-space: nowrap;
}

.job-table .prompt-cell {
  max-width: 420px;
  color: var(--muted);
}

.selected-row {
  background: rgba(72, 223, 208, .08);
}

pre {
  margin: 0;
  max-height: 440px;
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(91, 153, 210, .2);
  border-radius: 6px;
  background: #030a12;
  color: #aac4df;
  line-height: 1.55;
}

body.home {
  background: #04080d;
  overflow-x: hidden;
}

body.home::before {
  opacity: .72;
  background-image:
    linear-gradient(rgba(145, 169, 194, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(145, 169, 194, .05) 1px, transparent 1px);
  background-size: 56px 56px;
}

.home-nav {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100vw - 40px));
  min-height: 76px;
  margin: 0 auto;
}

.home-brand,
.home-links,
.home-actions,
.home-cta-row {
  display: flex;
  align-items: center;
}

.home-brand {
  gap: 12px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.home-links {
  gap: 24px;
}

.home-links a,
.home-login {
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.home-links a:hover,
.home-login:hover {
  color: var(--ink);
}

.home-actions {
  gap: 14px;
}

.home-language select {
  min-width: 104px;
  min-height: 34px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.home-login {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid rgba(130, 160, 190, .24);
  border-radius: 6px;
  background: rgba(7, 18, 30, .58);
}

.home-hero {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  height: calc(100vh - 160px);
  min-height: 520px;
  max-height: 720px;
  margin-top: -2px;
  background:
    linear-gradient(90deg, rgba(4, 8, 13, .96) 0%, rgba(4, 8, 13, .86) 31%, rgba(4, 8, 13, .44) 58%, rgba(4, 8, 13, .12) 100%),
    linear-gradient(180deg, rgba(4, 8, 13, .20), rgba(4, 8, 13, .88)),
    url("/static/assets/backtestalpha-hero.webp?v=20260531a") center right / cover no-repeat;
  border-top: 1px solid rgba(130, 160, 190, .12);
  border-bottom: 1px solid rgba(130, 160, 190, .16);
}

.home-hero-shade {
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(4, 8, 13, .88));
}

.home-hero-inner {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 38px 0 54px;
}

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.home-hero h1 {
  margin: 12px 0 10px;
  color: #f3f7fb;
  font-size: 64px;
  line-height: .98;
}

.home-subtitle {
  max-width: 680px;
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.18;
  font-weight: 820;
}

.home-copy {
  max-width: 640px;
  margin: 18px 0 0;
  color: #a9bacb;
  font-size: 17px;
  line-height: 1.75;
}

.home-cta-row {
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid rgba(72, 223, 208, .34);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(72, 223, 208, .98), rgba(48, 151, 229, .98));
  color: #04111d;
  font-weight: 880;
  text-decoration: none;
}

.home-button.secondary {
  color: var(--ink);
  background: rgba(9, 21, 34, .76);
  border-color: rgba(130, 160, 190, .28);
}

.home-risk-line {
  margin: 16px 0 0;
  color: #8fa2b5;
  font-size: 13px;
  font-weight: 720;
}

.home-strip {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  width: min(1180px, calc(100vw - 40px));
  margin: -24px auto 0;
  border: 1px solid rgba(130, 160, 190, .20);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(130, 160, 190, .16);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .34);
}

.home-strip div {
  min-height: 88px;
  padding: 16px 18px;
  background: rgba(7, 16, 26, .94);
}

.home-strip span,
.preview-metrics span,
.rule-preview span,
.alpha-facts span,
.report-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 830;
}

.home-strip strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 17px;
}

.home-section {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 86px 0 0;
}

.section-head {
  max-width: 720px;
  margin-bottom: 28px;
}

.section-head h2,
.transparency-copy h2 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.14;
}

.section-head p,
.transparency-copy p {
  margin: 13px 0 0;
  color: #9fb0c0;
  font-size: 16px;
  line-height: 1.75;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.process-card,
.faq-grid article,
.report-preview,
.rule-preview,
.transparency-section,
.alpha-facts div {
  border: 1px solid rgba(130, 160, 190, .20);
  border-radius: 8px;
  background: rgba(9, 19, 31, .78);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .26);
}

.process-card {
  min-height: 210px;
  padding: 18px;
}

.process-card > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 30px;
  border: 1px solid rgba(72, 223, 208, .26);
  border-radius: 6px;
  color: var(--cyan);
  background: rgba(72, 223, 208, .08);
  font-family: "Segoe UI", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 850;
}

.process-card h3,
.rule-preview h3,
.faq-grid h3 {
  margin: 18px 0 9px;
  color: var(--ink);
  font-size: 17px;
}

.process-card p,
.rule-preview p,
.faq-grid p {
  margin: 0;
  color: #9fb0c0;
  line-height: 1.68;
}

.sample-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(310px, .72fr);
  gap: 18px;
  align-items: stretch;
}

.report-preview,
.rule-preview {
  padding: 18px;
}

.report-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.report-head h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 20px;
}

.report-head strong {
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 6px;
  color: var(--cyan);
  background: rgba(72, 223, 208, .10);
  border: 1px solid rgba(72, 223, 208, .24);
  white-space: nowrap;
}

.preview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid rgba(130, 160, 190, .18);
  border-radius: 6px;
  overflow: hidden;
}

.preview-metrics div {
  min-height: 82px;
  padding: 13px;
  background: rgba(4, 12, 22, .48);
  border-right: 1px solid rgba(130, 160, 190, .14);
}

.preview-metrics div:last-child {
  border-right: 0;
}

.preview-metrics strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-family: "Segoe UI", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 25px;
}

.equity-preview {
  margin-top: 16px;
  border: 1px solid rgba(130, 160, 190, .16);
  border-radius: 6px;
  background: rgba(3, 10, 18, .62);
  overflow: hidden;
}

.equity-preview svg {
  display: block;
  width: 100%;
  height: auto;
}

.rule-preview ul {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.rule-preview li {
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(130, 160, 190, .14);
}

.rule-preview li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.rule-preview strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  line-height: 1.5;
}

.transparency-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .58fr);
  gap: 22px;
  align-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(11, 24, 38, .92), rgba(6, 13, 22, .90));
}

.alpha-facts {
  display: grid;
  gap: 10px;
}

.alpha-facts div {
  min-height: 74px;
  padding: 13px 15px;
  box-shadow: none;
}

.alpha-facts strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 18px;
}

.faq-section {
  padding-bottom: 70px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.faq-grid article {
  min-height: 172px;
  padding: 18px;
}

.faq-grid h3 {
  margin-top: 0;
}

.home-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0 34px;
  border-top: 1px solid rgba(130, 160, 190, .16);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

@media (max-width: 980px) {
  .grid, .row, .metrics, .template-picker, .service-note, .rule-grid, .review-columns { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { justify-content: flex-start; }
  .worker-banner { align-items: flex-start; flex-direction: column; }
  .job-table { display: block; overflow-x: auto; white-space: nowrap; }
  .review-head { flex-direction: column; }
  .review-head span { text-align: left; }
  .home-nav { align-items: flex-start; flex-direction: column; padding: 16px 0; }
  .home-links { order: 3; width: 100%; justify-content: space-between; gap: 10px; }
  .home-actions { width: 100%; justify-content: space-between; }
  .home-hero { height: auto; min-height: 560px; background-position: center right 30%; }
  .home-hero h1 { font-size: 46px; }
  .home-subtitle { font-size: 25px; }
  .home-strip, .process-grid, .sample-layout, .transparency-section, .faq-grid { grid-template-columns: 1fr; }
  .home-strip { margin-top: -18px; }
  .preview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-metrics div:nth-child(2) { border-right: 0; }
  .preview-metrics div:nth-child(-n+2) { border-bottom: 1px solid rgba(130, 160, 190, .14); }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 20px, 1280px); padding-top: 14px; }
  .brand-head { align-items: flex-start; }
  .brand-mark { width: 38px; height: 38px; }
  .brand h1 { font-size: 24px; }
  .panel, .service-note, .topbar { padding: 14px; }
  button { width: 100%; }
  .home-nav, .home-hero-inner, .home-strip, .home-section, .home-footer { width: min(100% - 24px, 1180px); }
  .home-links { overflow-x: auto; justify-content: flex-start; }
  .home-actions { align-items: stretch; flex-direction: column; }
  .home-language { justify-content: space-between; width: 100%; }
  .home-language select { width: 150px; }
  .home-login { text-align: center; }
  .home-hero {
    min-height: 600px;
    background:
      linear-gradient(90deg, rgba(4, 8, 13, .98), rgba(4, 8, 13, .78)),
      linear-gradient(180deg, rgba(4, 8, 13, .34), rgba(4, 8, 13, .92)),
      url("/static/assets/backtestalpha-hero.webp?v=20260531a") center right 35% / cover no-repeat;
  }
  .home-hero h1 { font-size: 38px; }
  .home-subtitle { font-size: 22px; }
  .home-copy { font-size: 15px; }
  .home-button { width: 100%; }
  .home-section { padding-top: 64px; }
  .section-head h2, .transparency-copy h2 { font-size: 27px; }
  .preview-metrics { grid-template-columns: 1fr; }
  .preview-metrics div { border-right: 0; border-bottom: 1px solid rgba(130, 160, 190, .14); }
  .preview-metrics div:last-child { border-bottom: 0; }
  .transparency-section, .report-preview, .rule-preview, .faq-grid article { padding: 16px; }
  .home-footer { flex-direction: column; }
}
