
  #model-config-modal.custom-modal-overlay {
    display: none; position: fixed !important; top: 0; left: 0;
    width: 100vw; height: 100vh; background: rgba(15,23,42,0.55);
    backdrop-filter: blur(3px); z-index: 85000 !important;
    align-items: center !important; justify-content: center !important;
  }
  #model-config-modal .kwa-box {
    position: relative; width: min(760px, 94vw); height: min(720px, 88vh);
    display: flex; flex-direction: column; background: #fff; border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15,23,42,.25); overflow: hidden; text-align: left;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #0f172a;
    animation: kwaIn .2s ease-out;
  }
  @keyframes kwaIn { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
  #model-config-modal * { box-sizing: border-box; }
  .kwa-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px 16px; border-bottom: 1px solid #e2e8f0; }
  .kwa-head-ic { width: 32px; height: 32px; border-radius: 9px; background: #e4e9f2; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
  .kwa-head-ic svg { width: 18px; height: 18px; fill: #1e2a44; }
  .kwa-title { font-size: 18px; font-weight: 800; line-height: 1.15; margin: 0; }
  .kwa-sub { font-size: 11px; color: #64748b; font-weight: 500; margin-top: 1px; }
  .kwa-grow { flex: 1 1 auto; min-width: 0; }
  .kwa-x { width: 34px; height: 34px; min-width: 34px; border-radius: 50%; background: #e11d48; border: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 6px rgba(225,29,72,.35); padding: 0; }
  .kwa-x:hover { background: #be123c; }
  .kwa-x svg { width: 20px; height: 20px; fill: #fff; }
  .kwa-refresh { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px 0 10px; border: 1px solid #cbd5e1; border-radius: 16px; background: #fff; color: #1e2a44; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; flex: 0 0 auto; }
  .kwa-refresh:hover { background: #f1f5f9; }
  .kwa-refresh svg { width: 16px; height: 16px; fill: currentColor; }
  .kwa-refresh.spin svg { animation: kwaSpin .8s linear infinite; } @keyframes kwaSpin { to { transform: rotate(360deg); } }
  .kwa-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px 8px; }
  .kwa-search { position: relative; flex: 1 1 auto; }
  .kwa-search svg { position: absolute; left: 9px; top: 8px; width: 15px; height: 15px; fill: #94a3b8; }
  .kwa-in { width: 100%; height: 32px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 0 10px; font-size: 12px; font-family: inherit; color: #0f172a; background: #fff; outline: none; }
  .kwa-in:focus { border-color: #1e2a44; box-shadow: 0 0 0 3px rgba(30,42,68,.12); }
  .kwa-in.bad { border-color: #e11d48; box-shadow: 0 0 0 3px rgba(225,29,72,.12); }
  .kwa-search .kwa-in { padding-left: 30px; }
  .kwa-count { font-size: 11px; font-weight: 700; color: #475569; background: #f1f5f9; border-radius: 12px; padding: 5px 10px; white-space: nowrap; }
  .kwa-add { margin: 0 16px 8px; padding: 8px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; }
  .kwa-add-row { display: grid; grid-template-columns: 110px 1fr 1fr auto; gap: 6px; align-items: center; }
  .kwa-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #64748b; margin: 0 0 5px 2px; }
  .kwa-btn { height: 32px; padding: 0 14px; border: none; border-radius: 8px; background: #1e2a44; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; }
  .kwa-btn:hover { background: #283552; }
  .kwa-btn:disabled { opacity: .55; cursor: default; }
  .kwa-msgs { margin-top: 6px; display: none; }
  .kwa-msgs.on { display: block; }
  .kwa-msg { font-size: 11px; line-height: 1.4; padding: 5px 8px; border-radius: 7px; margin-top: 4px; }
  .kwa-msg.err { background: #fef2f2; color: #b91c1c; }
  .kwa-msg.warn { background: #fffbeb; color: #92400e; }
  .kwa-msg.info { background: #eff6ff; color: #1e40af; }
  .kwa-list { flex: 1 1 auto; overflow: auto; margin: 0 16px; border: 1px solid #e2e8f0; border-radius: 12px; }
  .kwa-r { display: grid; grid-template-columns: 150px 1fr 1fr 56px 96px; align-items: center; gap: 0; min-height: 34px; border-bottom: 1px solid #f1f5f9; }
  .kwa-r:last-child { border-bottom: none; }
  .kwa-r > div { padding: 5px 8px; font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kwa-hr { position: sticky; top: 0; z-index: 2; background: #f8fafc; min-height: 30px; border-bottom: 1px solid #e2e8f0; }
  .kwa-hr > div { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #475569; }
  .kwa-body .kwa-r:nth-child(even) { background: #fafbfd; }
  .kwa-body .kwa-r:hover { background: #f1f5f9; }
  .kwa-r.editing, .kwa-body .kwa-r.editing:hover { background: #eff6ff; }
  .kwa-r.flash { animation: kwaFlash 1.4s ease-out; } @keyframes kwaFlash { from { background: #dcfce7; } to { background: transparent; } }
  .kwa-cell { cursor: text; }
  .kwa-pfx { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; color: #1e2a44; }
  .kwa-num { text-align: right; color: #475569; font-variant-numeric: tabular-nums; }
  .kwa-num.zero { color: #cbd5e1; }
  .kwa-act { display: flex; gap: 4px; justify-content: flex-end; }
  .kwa-ib { width: 26px; height: 26px; border-radius: 7px; border: 1px solid transparent; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
  .kwa-ib svg { width: 15px; height: 15px; fill: #64748b; }
  .kwa-ib:hover { background: #e4e9f2; } .kwa-ib:hover svg { fill: #1e2a44; }
  .kwa-ib.del:hover { background: #fef2f2; } .kwa-ib.del:hover svg { fill: #e11d48; }
  .kwa-ib.ok { background: #1e2a44; } .kwa-ib.ok svg { fill: #fff; } .kwa-ib.ok:hover { background: #283552; } .kwa-ib.ok:hover svg { fill: #fff; }
  .kwa-chip { display: inline-block; font-size: 9.5px; font-weight: 700; border-radius: 6px; padding: 1px 5px; margin-left: 5px; vertical-align: 1px; font-family: Inter, sans-serif; cursor: help; }
  .kwa-chip.ov { background: #fffbeb; color: #b45309; }
  .kwa-chip.bad { background: #fef2f2; color: #be123c; }
  .kwa-dim { color: #94a3b8; }
  .kwa-chip.sus { background: #fef2f2; color: #be123c; }
  .kwa-fixb { height: 24px; padding: 0 8px; border-radius: 7px; border: 1px solid #fecdd3; background: #fff1f2; color: #be123c; font-size: 11px; font-weight: 700; cursor: pointer; font-family: inherit; }
  .kwa-fixb:hover { background: #ffe4e6; }
  .kwa-recheck { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px 0 10px; border: 1px solid #cbd5e1; border-radius: 16px; background: #fff; color: #1e2a44; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; flex: 0 0 auto; }
  .kwa-recheck:hover { background: #f1f5f9; }
  .kwa-recheck:disabled { opacity: .6; cursor: default; }
  .kwa-recheck svg { width: 15px; height: 15px; fill: currentColor; }
  .kwa-ra { position: absolute; inset: 0; z-index: 5; background: rgba(15,23,42,.35); display: none; align-items: center; justify-content: center; padding: 16px; }
  .kwa-ra.on { display: flex; }
  .kwa-ra-card { width: min(560px, 100%); max-height: 100%; display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: 0 16px 40px rgba(15,23,42,.25); overflow: hidden; }
  .kwa-ra-head { padding: 14px 16px 6px; }
  .kwa-ra-title { font-size: 16px; font-weight: 800; color: #0f172a; margin: 0; }
  .kwa-ra-sub { font-size: 12px; color: #64748b; line-height: 1.45; margin-top: 4px; }
  .kwa-ra-list { flex: 1 1 auto; overflow: auto; margin: 6px 16px; border: 1px solid #e2e8f0; border-radius: 10px; min-height: 0; }
  .kwa-ra-row { display: grid; grid-template-columns: 92px 64px 1fr; gap: 6px; padding: 6px 9px; border-bottom: 1px solid #f1f5f9; font-size: 11.5px; align-items: baseline; }
  .kwa-ra-row:last-child { border-bottom: none; }
  .kwa-ra-row .t { font-weight: 700; color: #1e2a44; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kwa-ra-row .d { color: #64748b; font-variant-numeric: tabular-nums; }
  .kwa-ra-row .m { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kwa-ra-row .c { grid-column: 1 / -1; color: #0f172a; }
  .kwa-ra-row .c s { color: #94a3b8; }
  .kwa-ra-more { padding: 6px 9px; font-size: 11px; color: #64748b; }
  .kwa-ra-btns { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 16px 14px; flex-wrap: wrap; }
  .kwa-btn.ghost { background: #fff; color: #1e2a44; border: 1px solid #cbd5e1; }
  .kwa-btn.ghost:hover { background: #f1f5f9; }
  .kwa-btn.danger { background: #e11d48; } .kwa-btn.danger:hover { background: #be123c; }
  .kwa-r .kwa-in { height: 28px; font-size: 12px; padding: 0 7px; }
  .kwa-empty { padding: 28px 12px; text-align: center; color: #94a3b8; font-size: 12px; }
  .kwa-test { margin: 8px 16px 12px; padding: 8px 10px; background: #eff6ff; border: 1px solid #dbeafe; border-radius: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .kwa-test .kwa-lbl { margin: 0; color: #1e40af; white-space: nowrap; }
  .kwa-test .kwa-in { flex: 0 1 200px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
  .kwa-tres { flex: 1 1 240px; font-size: 11.5px; color: #334155; min-width: 0; line-height: 1.45; }
  .kwa-tres b { color: #0f172a; }
  .kwa-tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: #fff; border: 1px solid #cbd5e1; color: #475569; margin-left: 3px; font-family: ui-monospace, Menlo, monospace; }
  .kwa-ac { position: fixed; z-index: 86000; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 10px 24px rgba(15,23,42,.14); padding: 3px; max-height: 220px; overflow-y: auto; display: none; font-family: Inter, -apple-system, sans-serif; }
  .kwa-ac.on { display: block; }
  .kwa-opt { padding: 6px 9px; font-size: 12px; color: #334155; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
  .kwa-opt.hi, .kwa-opt:hover { background: #e4e9f2; color: #1e2a44; }
  .kwa-opt small { color: #94a3b8; font-size: 10px; }
  @media (max-width: 640px) {
    #model-config-modal .kwa-box { width: 100vw; height: 100%; height: 100dvh; border-radius: 0; }
    .kwa-refresh span { display: none; } .kwa-refresh { padding: 0 8px; }
    .kwa-bar, .kwa-add, .kwa-list, .kwa-test { margin-left: 10px; margin-right: 10px; }
    .kwa-bar { padding: 8px 10px 6px; margin: 0; }
    .kwa-add-row { grid-template-columns: 1fr 1fr; }
    .kwa-add-row > :first-child { grid-column: 1 / -1; }
    .kwa-add-row .kwa-btn { grid-column: 1 / -1; }
    .kwa-hr { display: none; }
    .kwa-r { grid-template-columns: 1fr auto; grid-template-areas: "p a" "b a" "t a" "n a"; padding: 4px 0; }
    .kwa-r > div { padding: 1px 10px; }
    .kwa-r > .c-p { grid-area: p; font-size: 13px; } .kwa-r > .c-b { grid-area: b; } .kwa-r > .c-t { grid-area: t; }
    .kwa-r > .c-n { grid-area: n; text-align: left; font-size: 11px; } .kwa-r > .c-a { grid-area: a; align-self: center; }
    .kwa-r > .c-b::before { content: "Brand · "; color: #94a3b8; font-size: 10.5px; }
    .kwa-r > .c-t::before { content: "Type · "; color: #94a3b8; font-size: 10.5px; }
    .kwa-r > .c-n::after { content: " jobs"; }
    .kwa-r.editing > .c-b::before, .kwa-r.editing > .c-t::before { content: none; }
    .kwa-r.editing > div { padding: 2px 10px; }
    .kwa-test .kwa-in { flex: 1 1 100%; }
    .kwa-recheck span { display: none; } .kwa-recheck { padding: 0 9px; }
    .kwa-ra { padding: 10px; }
  }
