/* Generated from prototype.html — do not hand-edit; edit the prototype then re-split. */
/* ── Funnel ── */
  .funnel { display: flex; flex-direction: column; }
  .step {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden; position: relative; z-index: 2;
  }
  .connector { height: 22px; width: 2px; background: var(--border); margin-left: 39px; position: relative; z-index: 1; }
  .connector::after {
    content: ""; position: absolute; left: -3px; bottom: -1px; width: 8px; height: 8px;
    border-right: 2px solid var(--border); border-bottom: 2px solid var(--border);
    transform: rotate(45deg);
  }
  .step-head {
    display: flex; align-items: center; gap: 16px; padding: 16px 18px; width: 100%;
    border: none; background: none; text-align: left; color: inherit;
  }
  .step-head:hover { background: var(--surface-2); }
  .step-idx {
    width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center;
    background: var(--accent-wash); color: var(--accent-ink); font-family: var(--mono);
    font-size: 13px; font-weight: 600;
  }
  .step-lock { background: var(--surface-2); color: var(--faint); }
  .step-titles { min-width: 0; flex: 1; }
  .step-titles h3 { font-size: 15px; }
  .step-titles p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
  .step-metric { display: flex; align-items: center; gap: 12px; flex: none; }
  .flowcount { text-align: right; }
  .flowcount .big { font-size: 17px; font-weight: 600; }
  .flowcount .lbl { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
  .flow-arrow { color: var(--faint); }
  .delta {
    font-family: var(--mono); font-size: 11.5px; padding: 3px 8px; border-radius: 20px;
    background: var(--surface-2); color: var(--muted); white-space: nowrap;
  }
  .delta.cut { background: var(--err-wash); color: var(--err); }
  .delta.pass { background: var(--ok-wash); color: var(--ok); }
  .chev { color: var(--faint); transition: transform .2s; flex: none; }
  .step.open .chev { transform: rotate(90deg); }
  .step-body {
    display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease;
  }
  .step.open .step-body { grid-template-rows: 1fr; }
  .step-body > div { overflow: hidden; }
  .step-body-inner { padding: 4px 18px 20px; border-top: 1px solid var(--border-2); }

  /* ── Rule builder ── */
  .rb-lead { display: flex; align-items: center; gap: 8px; margin: 16px 0 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
  .seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
  .seg button {
    border: none; background: none; padding: 4px 11px; border-radius: 6px; font-size: 12.5px;
    font-weight: 600; color: var(--muted);
  }
  .seg button.on { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow); }

  .cond {
    display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px dashed var(--border-2);
  }
  .cond.off { opacity: .45; }
  .cond:first-of-type { border-top: none; }
  .cond .join { width: 42px; flex: none; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
  select.field, select.op {
    appearance: none; border: 1px solid var(--border); background: var(--surface);
    color: var(--ink); border-radius: 8px; padding: 6px 26px 6px 10px; font-size: 12.5px; font-weight: 550;
    font-family: var(--sans);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A93A6' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center;
  }
  select.field { color: var(--accent-ink); }
  select.op { color: var(--muted); }
  select:focus-visible, .btn:focus-visible, .nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .valuebox {
    display: flex; align-items: center; gap: 5px; flex-wrap: wrap; flex: 1; min-width: 120px;
    border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px; min-height: 33px; background: var(--surface-2);
  }
  .vchip {
    display: inline-flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 6px; padding: 2px 4px 2px 8px; font-size: 12px;
  }
  .vchip .cnt { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
  .vchip .x { color: var(--faint); border: none; background: none; padding: 0 2px; font-size: 13px; line-height: 1; }
  .vchip .x:hover { color: var(--err); }
  .vadd { border: 1px dashed var(--border); background: none; color: var(--faint); border-radius: 6px; padding: 3px 8px; font-size: 12px; }
  .vadd:hover { color: var(--accent-ink); border-color: var(--accent); }
  .vtext { flex: 1; border: none; background: none; color: var(--ink); font-family: var(--mono); font-size: 12.5px; padding: 4px; outline: none; min-width: 80px; }
  .impact { font-family: var(--mono); font-size: 11.5px; color: var(--err); white-space: nowrap; flex: none; width: 74px; text-align: right; }
  .cond .tools { display: flex; gap: 2px; flex: none; }
  .icon-btn { border: none; background: none; color: var(--faint); border-radius: 6px; padding: 4px; display: grid; place-items: center; }
  .icon-btn svg { width: 15px; height: 15px; }
  .icon-btn:hover { background: var(--surface-2); color: var(--ink); }
  /* grouped noise builder — one card per response type */
  .cgroup { border: 1px solid var(--border); border-radius: 11px; padding: 4px 14px 10px; margin-bottom: 12px; background: var(--surface); }
  .cgroup-head { display: flex; align-items: center; gap: 10px; padding: 10px 0 8px; border-bottom: 1px solid var(--border-2); }
  .cgroup-title { font-size: 13px; font-weight: 650; color: var(--ink); }
  .cgroup-sub { font-size: 11.5px; color: var(--faint); }
  .cgroup-sub b { color: var(--muted); }
  .cgroup-rm { font-family: var(--mono); color: var(--err); }
  .cgroup-head .del-group { margin-left: auto; }
  .cgroup .conds { margin-top: 2px; }
  .cgroup .cond:first-of-type { border-top: 1px dashed var(--border-2); }
  .cgroup .cond:first-child { border-top: none; }
  .addgroup-row { flex-wrap: wrap; align-items: center; margin-top: 6px; }
  .addgroup-row .agl { font-size: 12px; color: var(--faint); padding: 6px 2px; }

  .rb-actions { display: flex; gap: 8px; margin-top: 12px; }
  .link-btn { border: none; background: none; color: var(--accent-ink); font-size: 12.5px; font-weight: 600; padding: 6px 8px; border-radius: 7px; display: inline-flex; gap: 6px; align-items: center; }
  .link-btn:hover { background: var(--accent-wash); }
  .rb-summary {
    margin-top: 14px; padding: 11px 14px; border-radius: 9px; background: var(--surface-2);
    border: 1px solid var(--border-2); font-size: 12.5px; color: var(--muted);
    display: flex; align-items: center; gap: 8px;
  }
  .rb-summary b { color: var(--ink); font-family: var(--mono); }

  /* result readout under funnel */
  .readout {
    margin-top: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px 20px;
  }
  .readout h3 { font-size: 14px; }
  .readout .grid4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-top: 14px; }
  .stat { border: 1px solid var(--border-2); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); }
  .stat .k { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
  .stat .v { font-size: 20px; font-weight: 620; margin-top: 4px; }
  .stat .v .pct { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 4px; }
  .stat.win .v { color: var(--ok); }
  .stat.loss .v { color: var(--err); }

  /* ── Strategy ── */
  .card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px;
  }
  .card > .card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
  .card-head h3 { font-size: 15px; }
  .card-head .tag { margin-left: auto; font-size: 11px; padding: 3px 9px; border-radius: 20px; background: var(--accent-wash); color: var(--accent-ink); font-weight: 600; }
  .card-desc { color: var(--muted); font-size: 12.5px; margin: 0 0 16px; }
  .weight-row { display: flex; align-items: center; gap: 16px; margin: 18px 0 4px; }
  .weight-row .wlabels { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
  .weight-row .wlabels b { font-family: var(--mono); color: var(--ink); }
  .weight-row .wgrow { flex: 1; }
  input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 5px; border-radius: 5px; background: var(--border); outline: none; }
  input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow); cursor: grab; }
  input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); cursor: grab; }
  .minrow { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-2); font-size: 13px; color: var(--muted); }
  .stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
  .stepper button { border: none; background: var(--surface); color: var(--muted); width: 30px; height: 32px; font-size: 16px; }
  .stepper button:hover { background: var(--surface-2); color: var(--ink); }
  .stepper .val { min-width: 44px; text-align: center; font-family: var(--mono); font-weight: 600; font-size: 14px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); height: 32px; display: grid; place-items: center; }

  .rule-list { display: flex; flex-direction: column; gap: 10px; }
  .srule {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px; border: 1px solid var(--border);
    border-radius: 10px; background: var(--surface-2);
  }
  .srule .grip { color: var(--faint); cursor: grab; margin-top: 1px; }
  .srule .grip svg { width: 16px; height: 16px; }
  .srule .pnum {
    width: 22px; height: 22px; border-radius: 6px; flex: none; display: grid; place-items: center;
    background: var(--surface); border: 1px solid var(--border); font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted);
  }
  .srule.default .pnum { background: var(--ink); color: var(--ground); border-color: var(--ink); }
  .srule .body { flex: 1; font-size: 13px; }
  .srule .body .lead { color: var(--faint); font-weight: 600; text-transform: uppercase; font-size: 10.5px; letter-spacing: .05em; }
  .srule .body .txt { margin-top: 2px; }
  .srule .body .txt b { background: var(--accent-wash); color: var(--accent-ink); font-family: var(--mono); padding: 1px 6px; border-radius: 5px; font-size: 12px; font-weight: 600; }
  .srule .body .txt .mid { background: var(--surface); border: 1px solid var(--border); padding: 1px 7px; border-radius: 5px; font-weight: 600; }
  .srule .rtools { display: flex; gap: 2px; }

  /* ── Overview matrix ── */
  .ov-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
  .ov-toolbar .stratsel { margin-left: auto; }
  .tbl-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
  .tbl-scroll { overflow-x: auto; }
  table.ov { border-collapse: collapse; width: 100%; font-size: 13px; }
  table.ov th, table.ov td { padding: 9px 14px; text-align: left; white-space: nowrap; }
  table.ov thead th {
    background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 11px;
    text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 600;
  }
  table.ov thead th.mid { text-align: center; }
  table.ov td.cyc { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
  table.ov td.mid { text-align: center; }
  table.ov tr.grp-end td { border-bottom: 1px solid var(--border); }
  table.ov tr.r-overall td { background: color-mix(in srgb, var(--accent-wash) 22%, transparent); }
  table.ov td.bank { font-weight: 600; }
  .pill { display: inline-flex; align-items: center; gap: 3px; font-family: var(--mono); font-size: 11.5px; padding: 1px 6px; border-radius: 6px; }
  .pill.s { background: var(--ok-wash); color: var(--ok); }
  .pill.f { background: var(--err-wash); color: var(--err); }
  .pill-pair { display: inline-flex; gap: 3px; }
  .emdash { color: var(--faint); }
  .best-cell { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ok) 45%, transparent); border-radius: 6px; }

  .sugg-cell { display: flex; align-items: center; gap: 8px; }
  th.sugg-live, td.sugg-live { color: var(--muted); }
  th.sugg-prev, td.sugg-prev { border-left: 1px solid var(--border); }
  .sugg-cell.is-changed { padding: 3px 6px; border-radius: 8px; background: color-mix(in srgb, var(--accent-wash) 60%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 35%, transparent); }
  .chg { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-ink); }
  .pub-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 11px 14px; border-radius: 10px; font-size: 13px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
  .pub-bar.active { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--accent-wash); color: var(--ink); }
  .pub-bar b { font-family: var(--mono); color: var(--accent-ink); }
  .pub-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
  .pub-check { color: var(--ok); font-weight: 700; }
  .pub-bar .pb-filter { margin-left: auto; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 7px; padding: 5px 10px; font-size: 12.5px; font-weight: 550; }
  .pub-bar .pb-filter.on { background: var(--ink); color: var(--ground); border-color: var(--ink); }
  .pub-bar .pb-publish { border: none; background: var(--accent); color: #fff; border-radius: 7px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; }
  .pub-bar .pb-publish:hover { background: var(--accent-ink); }
  .chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 20px;
    background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: 12.5px;
  }
  .chip .dot { width: 7px; height: 7px; border-radius: 50%; }
  .chip.locked { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); background: var(--warn-wash); }
  .chip .lk { width: 12px; height: 12px; color: var(--warn); }
  .why { font-size: 11px; color: var(--faint); }
  .test-pill { font-size: 10.5px; padding: 2px 7px; border-radius: 20px; background: var(--accent-wash); color: var(--accent-ink); font-weight: 600; }

  /* allocation bar */
  .alloc { display: flex; flex-direction: column; gap: 6px; min-width: 210px; }
  .alloc-bar { display: flex; gap: 3px; height: 9px; }
  .alloc-bar span { border-radius: 3px; min-width: 4px; position: relative; overflow: hidden; }
  .alloc-bar span.is-test::after {
    content: ""; position: absolute; inset: 0;
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.45) 0 3px, transparent 3px 6px);
  }
  .alloc-legend { display: flex; gap: 12px; flex-wrap: wrap; }
  .alloc-legend .li { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
  .alloc-legend .li .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
  .alloc-legend .li b { font-family: var(--mono); font-size: 11.5px; }
  .alloc-legend .li .lk { width: 11px; height: 11px; color: var(--warn); }
  .alloc-legend .li .tflag { font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-wash); padding: 0 4px; border-radius: 4px; font-weight: 700; }

  /* weight / test editors inside menu */
  .menu.wide { min-width: 262px; max-height: 78vh; overflow: auto; }
  .wedit { padding: 2px 8px 8px; }
  .wrow { display: flex; align-items: center; gap: 8px; padding: 5px 4px; font-size: 13px; }
  .wrow .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
  .wrow .nm { flex: 1; }
  .wrow .pct { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 40px; text-align: right; }
  .mstep { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
  .mstep button { border: none; background: var(--surface); color: var(--muted); width: 24px; height: 26px; font-size: 14px; padding: 0; }
  .mstep button:hover { background: var(--surface-2); color: var(--ink); }
  .mstep .v { min-width: 26px; text-align: center; font-family: var(--mono); font-size: 12.5px; font-weight: 600; height: 26px; display: grid; place-items: center; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  .wsum { font-size: 11.5px; color: var(--faint); padding: 4px 12px 2px; line-height: 1.5; }
  .guard { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--muted); padding: 8px 12px; border-top: 1px solid var(--border-2); margin-top: 4px; }
  .guard svg { width: 14px; height: 14px; color: var(--warn); flex: none; margin-top: 1px; }
  .ovr-btn { border: 1px solid transparent; background: none; color: var(--faint); border-radius: 7px; padding: 4px; margin-left: auto; }
  .ovr-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--border); }
  .ovr-btn svg { width: 15px; height: 15px; display: block; }

  /* menu */
  .menu {
    position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 210px;
  }
  .menu .mlabel { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 10px 4px; }
  .menu button.mitem {
    display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: none; color: var(--ink);
    padding: 7px 10px; border-radius: 7px; font-size: 13px; text-align: left;
  }
  .menu button.mitem:hover { background: var(--surface-2); }
  .menu button.mitem .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
  .menu button.mitem .ck { margin-left: auto; color: var(--accent); opacity: 0; }
  .menu button.mitem.sel .ck { opacity: 1; }
  .menu .sep { height: 1px; background: var(--border-2); margin: 5px 4px; }

  /* toast */
  .toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--ink); color: var(--ground); padding: 11px 18px; border-radius: 10px; font-size: 13px;
    box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .25s; z-index: 80;
    display: flex; align-items: center; gap: 9px;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  .toast svg { width: 16px; height: 16px; color: var(--ok); }

  @media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
  @media (max-width: 860px) {
    .app { grid-template-columns: 1fr; }
    .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .rail-foot { margin: 0; border: none; padding: 8px; }
    .nav-group-label { display: none; }
    .readout .grid4 { grid-template-columns: repeat(2,1fr); }
  }
