  :root{ --bg:#0f1419; --card:#1a2129; --line:#2a333d; --txt:#e6edf3; --mut:#8b98a5;
         --nom:#58a6ff; --rf:#3fb950; --rl:#8b98a5; --acc:#3fb950; }
  *{ box-sizing:border-box; }
  body{ margin:0; padding:24px; background:var(--bg); color:var(--txt);
        font:14px/1.5 -apple-system,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif; }
  h1{ font-size:20px; margin:0 0 4px; }
  .sub{ color:var(--mut); font-size:12px; margin-bottom:20px; }
  .wrap{ max-width:880px; margin:0 auto; }
  .card{ background:var(--card); border:1px solid var(--line); border-radius:10px;
         padding:16px 18px; margin-bottom:16px; }
  .card h2{ font-size:13px; text-transform:uppercase; letter-spacing:.04em;
            color:var(--mut); margin:0 0 12px; font-weight:600; }
  .globals{ display:flex; gap:18px; flex-wrap:wrap; }
  .fld{ display:flex; flex-direction:column; gap:4px; }
  .fld label{ font-size:12px; color:var(--mut); }
  input[type=number]{ width:110px; background:#0d1117; border:1px solid var(--line);
        color:var(--txt); border-radius:6px; padding:7px 9px; font-size:14px; }
  input[type=number]:focus{ outline:none; border-color:var(--nom); }
  input[type=radio]{ accent-color:var(--rf); }
  table{ width:100%; border-collapse:collapse; }
  th{ text-align:left; font-size:12px; color:var(--mut); font-weight:600;
      padding:6px 8px; border-bottom:1px solid var(--line); }
  td{ padding:6px 8px; border-bottom:1px solid var(--line); }
  td input{ width:90px; }
  .num{ text-align:right; font-variant-numeric:tabular-nums; }
  .cal{ color:var(--mut); font-size:11px; margin-left:6px; }
  .btn{ background:#21262d; border:1px solid var(--line); color:var(--txt);
        border-radius:6px; padding:6px 12px; cursor:pointer; font-size:13px; }
  .btn:hover{ border-color:var(--nom); }
  .btn-x{ background:transparent; border:none; color:#f85149; cursor:pointer;
          font-size:16px; padding:0 6px; }
  .btn-row{ display:flex; gap:10px; margin-top:12px; }
  .strat-head{ display:flex; align-items:center; gap:10px; margin-bottom:10px; }
  .dot{ width:12px; height:12px; border-radius:3px; display:inline-block; flex:none; }
  .sname{ background:#0d1117; border:1px solid var(--line); color:var(--txt);
          border-radius:6px; padding:6px 9px; font-size:14px; font-weight:600; width:160px; }
  .sum{ font-size:12px; color:var(--mut); margin-left:auto; }
  .sum b{ color:var(--txt); }
  .segwarn{ color:#f0a020; font-size:12px; margin-top:10px; min-height:1em; }
  .metric-sel{ display:flex; gap:16px; align-items:center; font-size:13px; margin-bottom:12px; }
  .metric-sel label{ cursor:pointer; }
  .cmp .hi-cell{ color:var(--rf); font-weight:600; }
  .diff-pos{ color:var(--rf); } .diff-neg{ color:#f85149; }
  .legend{ display:flex; gap:18px; flex-wrap:wrap; font-size:12px; margin:8px 0 0; }
  .legend i{ display:inline-block; width:14px; height:3px; vertical-align:middle; margin-right:5px; }
  canvas{ width:100%; height:auto; display:block; }
  .chart-box{ position:relative; }
  .chart-tip{ position:absolute; top:6px; pointer-events:none; z-index:5; display:none;
        transform:translateX(-50%); background:rgba(13,17,23,.94); border:1px solid var(--line);
        border-radius:6px; padding:7px 10px; font-size:12px; white-space:nowrap;
        box-shadow:0 4px 14px rgba(0,0,0,.45); }
  .chart-tip .tip-yr{ color:var(--mut); margin-bottom:5px; }
  .chart-tip .tip-row{ display:flex; align-items:center; gap:7px; line-height:1.7; }
  .chart-tip .tip-row i{ width:9px; height:9px; border-radius:2px; flex:none; }
  .chart-tip .tip-row b{ margin-left:14px; font-variant-numeric:tabular-nums; }
  .oneline{ font-size:13px; line-height:1.7; color:var(--txt); }
  .err{ border-color:#f85149 !important; }
  details summary{ cursor:pointer; color:var(--mut); font-size:13px; user-select:none; }
  .ytab-wrap{ max-height:460px; overflow:auto; }
  .ytab{ font-size:12px; } .ytab th,.ytab td{ padding:4px 8px; white-space:nowrap; }
  .ytab tbody tr:hover td{ background:#0d1117; }
  .preset-save{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
  .preset-list{ margin-top:12px; display:flex; flex-direction:column; gap:2px; }
  .preset-item{ display:flex; align-items:center; gap:10px; padding:6px 0; border-bottom:1px solid var(--line); }
  .preset-nm{ flex:1; font-weight:600; }
  .preset-meta{ font-size:12px; color:var(--mut); }
  .preset-note{ font-size:11px; color:var(--mut); margin-top:10px; }
  .rt-result{ font-size:13px; line-height:1.9; margin-top:4px; }
  .rt-note{ font-size:11px; color:var(--mut); }
  .foot{ font-size:11px; color:var(--mut); margin-top:18px; line-height:1.7; }
  .foot code{ color:var(--nom); }

  @media (max-width:600px){
    body{ padding:14px; }
    .globals{ gap:12px 14px; }
    .fld{ flex:1 1 calc(50% - 7px); }
    .fld input[type=number]{ width:100%; }
    table{ table-layout:fixed; }
    th,td{ padding:6px 2px; overflow:hidden; }
    td input{ width:100%; padding:6px 4px; }
    th:nth-child(1),td:nth-child(1){ width:8%; }
    th:nth-child(2),td:nth-child(2){ width:27%; }
    th:nth-child(3),td:nth-child(3){ width:27%; }
    th:nth-child(4),td:nth-child(4){ width:27%; }
    th:last-child,td:last-child{ width:11%; text-align:center; }
    .btn-x{ padding:0; font-size:14px; }
    .cal{ display:block; margin-left:0; font-size:10px; line-height:1.3; }
    .sname{ width:auto; flex:1; min-width:0; }
    .strat-head{ flex-wrap:wrap; row-gap:8px; }
    .sum{ margin-left:0; flex-basis:100%; }
    .btn-row{ flex-wrap:wrap; }
    .preset-save{ gap:8px; }
  }
