/* Selection configuration: explicit sequence and catalog-backed controls. */
.selection-v17{min-width:0;margin:20px 0}
.selection-flow{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 20px;padding:0;list-style:none}
.selection-flow>li{display:flex;align-items:center;gap:8px;font-size:var(--text-xs);line-height:var(--leading-help);color:#8f9ba7}
.selection-flow>li:not(:last-child)::after{content:"→";color:#667786;margin-left:2px}
.selection-flow strong{font-weight:500;color:#c3d0da}
.selection-flow [aria-current="step"] strong{color:var(--accent,#88cdb5)}
.selection-catalog-status{display:flex;align-items:center;justify-content:space-between;gap:14px;font-size:var(--text-xs);line-height:var(--leading-help);padding:12px 14px;border:1px solid #31414c;border-radius:10px;color:#96a3af;background:#111a23}
.selection-catalog-status[data-state="error"]{border-color:#655045;color:#cbb59e}
.selection-catalog-status .button{flex:none;min-height:var(--control-height-compact);font-size:var(--text-xs);padding:0 10px;height:var(--control-height-compact);box-sizing:border-box;line-height:1.5;}
.selection-v17-section{padding:20px;border:1px solid #31404a;background:#111a23;border-radius:12px;margin-top:14px;min-width:0}
.selection-v17-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}
.selection-v17-heading h3{font-size:var(--text-lg);font-weight:500;margin:0;color:#c5d3de;line-height:var(--leading-heading);}
.selection-v17-heading p{font-size:var(--text-xs);line-height:var(--leading-help);color:#8e9aa6;margin:6px 0 0}
.selection-v17-heading .check-field{gap:8px;font-size:var(--text-xs);white-space:nowrap}
.selection-rule-list{display:grid;gap:12px;margin-top:16px}
.selection-rule{min-width:0;padding:16px;border:1px solid #2c3a46;border-radius:10px;background:#0e161f}
.selection-rule[data-enabled="false"]{border-style:dashed}
.selection-rule-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}
.selection-rule-heading .check-field{font-size:var(--text-sm);color:#bdcbd6;gap:8px;min-width:0}
.selection-rule-heading .icon-button{width:28px;height:28px;min-height:28px;border:0;background:transparent}
.selection-rule-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--form-gap);min-width:0}
.selection-rule-fields .field{min-width:0}
.selection-rule-fields .field>label{font-size:var(--text-xs);margin-bottom:0;line-height:var(--leading-help);}
.selection-rule-fields .field>input,.selection-rule-fields .field>select{font-size:var(--text-sm);min-height:var(--control-height);width:100%;min-width:0;height:var(--control-height);box-sizing:border-box;line-height:1.5;}
.selection-rule-fields .field.full{grid-column:1/-1}
.selection-rule-note{margin:12px 0 0;color:#8b99a6;font-size:var(--text-xs);line-height:var(--leading-help);overflow-wrap:anywhere}
.selection-pattern-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.selection-pattern-actions .button{min-height:var(--control-height-compact);padding:0 10px;font-size:var(--text-sm);height:var(--control-height-compact);box-sizing:border-box;line-height:1.5;}
.selection-rule-error{margin:10px 0 0;color:#dfaaa2;font-size:var(--text-xs);line-height:var(--leading-help)}
.selection-rule-add{display:flex;flex-wrap:wrap;gap:var(--form-gap);align-items:center;margin-top:16px}
.selection-rule-add>select{flex:1;max-width:360px;min-width:150px;min-height:var(--control-height);font-size:var(--text-xs);height:var(--control-height);box-sizing:border-box;line-height:1.5;}
.selection-rule-add>.button{min-height:var(--control-height);font-size:var(--text-xs);height:var(--control-height);box-sizing:border-box;line-height:1.5;}
.selection-summary-note{font-size:var(--text-xs);color:#8e9da9;line-height:var(--leading-help);margin:12px 0 0}
.selection-v17 [hidden]{display:none!important}
@media(max-width:1000px){.selection-rule-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.selection-v17-section{padding:16px}.selection-rule{padding:14px}.selection-v17-heading{flex-direction:column;gap:12px}.selection-rule-fields{grid-template-columns:minmax(0,1fr)}.selection-rule-add>select{max-width:none;flex-basis:100%}.selection-rule-add>.button{width:100%}.selection-catalog-status{align-items:flex-start}.selection-flow{gap:6px}.selection-flow>li{font-size:var(--text-xs)}}

/* Native keyboard behavior, with a themed popup where customizable selects are supported. */
.selection-rule-add [data-new-pattern]{color-scheme:dark;color:var(--text,#c5d3de);background-color:#0e161f;border:1px solid #31414c;border-radius:8px;padding:8px 12px;font-family:var(--font,system-ui);line-height:1.5;cursor:pointer}
.selection-rule-add [data-new-pattern]:hover:not(:disabled){border-color:#527b6d}
.selection-rule-add [data-new-pattern]:focus-visible{outline:2px solid var(--accent,#88cdb5);outline-offset:2px;border-color:var(--accent,#88cdb5)}
.selection-rule-add [data-new-pattern]:disabled{opacity:.55;cursor:not-allowed}
.selection-rule-add [data-new-pattern] option{color:#c5d3de;background-color:#111a23}
.selection-rule-add [data-new-pattern] option:checked{color:#c4f0de;background-color:#234337}
@supports (appearance:base-select){
  #selection-v17 .selection-rule-add select[data-new-pattern],#selection-v17 .selection-rule-add select[data-new-pattern]::picker(select){-webkit-appearance:base-select;appearance:base-select;background-image:none!important}
  #selection-v17 .selection-rule-add select[data-new-pattern]::picker(select){color-scheme:dark;color:#c5d3de;background:#111a23;border:1px solid #3b5149;border-radius:10px;padding:5px;box-shadow:0 12px 28px #0006;max-height:min(320px,60vh);overflow-y:auto}
  #selection-v17 .selection-rule-add select[data-new-pattern] option{padding:9px 12px;border-radius:6px;line-height:1.5}
  #selection-v17 .selection-rule-add select[data-new-pattern] option:hover,#selection-v17 .selection-rule-add select[data-new-pattern] option:focus-visible{color:#def4e9;background:#243b32;outline:none}
  #selection-v17 .selection-rule-add select[data-new-pattern] option:checked{color:#c4f0de;background:#234337}
  #selection-v17 .selection-rule-add select[data-new-pattern] option::checkmark{color:var(--accent,#88cdb5)}
  #selection-v17 .selection-rule-add select[data-new-pattern]::picker-icon{color:#91ab9f}
}

/* Exact factor endpoints: one shared field per boundary, 40px controls. */
#selection-v17 .selection-factor-bound{gap:8px}
#selection-v17 .selection-bound-input{display:grid;grid-template-columns:minmax(96px,auto) minmax(0,1fr);gap:8px;min-width:0}
#selection-v17 .selection-bound-input>input,#selection-v17 .selection-bound-input>select{min-width:0;width:100%;height:var(--control-height);min-height:var(--control-height);box-sizing:border-box;font-size:var(--text-sm);line-height:1.5}
#selection-v17 .selection-bound-input>select{padding-left:10px;padding-right:24px}
