/* スクリーニング（サーバ側絞り込み版）
   配色はサイト既存のトーン（slate + #2563eb）に合わせている。 */

.scr-wrap{max-width:1180px;margin:16px auto 40px;padding:0 14px}
.scr-card{background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 1px 4px rgba(15,23,42,.05)}

/* ---- 見出し ---- */
.scr-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin:0 0 10px}
.scr-head h1{font-size:1.2rem;font-weight:800;color:#0f172a;margin:0}
.scr-head .scr-uni{font-size:.8rem;color:#2563eb;font-weight:700}
.scr-asof{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 12px}
.scr-asof span{font-size:.68rem;color:#64748b;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:999px;padding:2px 9px;white-space:nowrap}
.scr-asof span.warn{color:#92400e;background:#fef3c7;border-color:#fde68a}

/* ---- 入口タブ ---- */
.scr-tabs{display:flex;gap:6px;margin:0 0 12px}
.scr-tabs button{flex:1;max-width:260px;padding:10px 14px;border:1px solid #e2e8f0;background:#fff;border-radius:10px;
  font-size:.88rem;font-weight:700;color:#64748b;cursor:pointer;transition:all .15s;font-family:inherit}
.scr-tabs button .sub{display:block;font-size:.68rem;font-weight:400;color:#94a3b8;margin-top:2px}
.scr-tabs button[aria-selected="true"]{background:#2563eb;border-color:#2563eb;color:#fff}
.scr-tabs button[aria-selected="true"] .sub{color:rgba(255,255,255,.75)}

/* ---- プリセット ---- */
.scr-pcat{font-size:.72rem;font-weight:700;color:#94a3b8;margin:14px 0 6px;letter-spacing:.04em}
.scr-pcat:first-child{margin-top:2px}
.scr-pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(238px,1fr));gap:8px}
.scr-preset{display:flex;gap:9px;text-align:left;padding:11px 12px;border:1px solid #e2e8f0;border-radius:11px;background:#fff;
  cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .15s;font-family:inherit;width:100%}
.scr-preset:hover{border-color:#93c5fd;box-shadow:0 3px 12px rgba(37,99,235,.10);transform:translateY(-1px)}
.scr-preset[aria-pressed="true"]{border-color:#2563eb;background:#eff6ff;box-shadow:inset 0 0 0 1px #2563eb}
.scr-preset .ic{font-size:1.1rem;line-height:1.2;flex-shrink:0}
.scr-preset .bd{min-width:0;flex:1}
.scr-preset .nm{font-size:.83rem;font-weight:700;color:#0f172a;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.scr-preset .cnt{font-size:.68rem;font-weight:700;color:#2563eb;background:#dbeafe;border-radius:999px;padding:1px 7px}
.scr-preset .cnt.rank{color:#5b21b6;background:#ede9fe}
.scr-preset .ds{font-size:.72rem;color:#64748b;line-height:1.65;margin-top:3px}

/* ---- 条件ビルダー ---- */
.scr-build{padding:12px 14px}
.scr-addrow{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.scr-addrow select,.scr-addrow input{font-family:inherit;font-size:.82rem;padding:7px 10px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#1e293b}
.scr-addrow select{cursor:pointer;max-width:100%}
.scr-hint{font-size:.72rem;color:#94a3b8;margin-top:8px;line-height:1.7}

.scr-cond{border:1px solid #e2e8f0;border-radius:10px;padding:10px 12px 6px;margin-top:10px;background:#fcfdff}
.scr-cond-h{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.scr-cond-h .t{font-size:.82rem;font-weight:700;color:#0f172a}
.scr-cond-h .hl{font-size:.7rem;color:#94a3b8;flex:1;min-width:120px}
.scr-cond-h .rm{border:0;background:transparent;color:#94a3b8;cursor:pointer;font-size:1rem;line-height:1;padding:2px 4px;font-family:inherit}
.scr-cond-h .rm:hover{color:#ef4444}

.scr-hist{position:relative;height:52px;margin:6px 0 0}
.scr-hist svg{display:block;width:100%;height:52px}
.scr-hist .bar{fill:#cbd5e1}
.scr-hist .bar.in{fill:#2563eb}
.scr-range{position:relative;height:26px;margin-top:-2px}
.scr-range input[type=range]{position:absolute;left:0;top:6px;width:100%;margin:0;pointer-events:none;-webkit-appearance:none;appearance:none;background:transparent;height:14px}
.scr-range input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;pointer-events:auto;width:16px;height:16px;border-radius:50%;
  background:#fff;border:2px solid #2563eb;box-shadow:0 1px 3px rgba(15,23,42,.3);cursor:pointer}
.scr-range input[type=range]::-moz-range-thumb{pointer-events:auto;width:16px;height:16px;border-radius:50%;background:#fff;border:2px solid #2563eb;box-shadow:0 1px 3px rgba(15,23,42,.3);cursor:pointer}
.scr-range .track{position:absolute;left:0;right:0;top:12px;height:3px;border-radius:2px;background:#e2e8f0}
.scr-range .sel{position:absolute;top:12px;height:3px;border-radius:2px;background:#2563eb}
.scr-nums{display:flex;align-items:center;gap:6px;margin-top:2px;flex-wrap:wrap}
.scr-nums input{width:88px;font-family:inherit;font-size:.8rem;padding:5px 8px;border:1px solid #cbd5e1;border-radius:7px;text-align:right;color:#1e293b}
.scr-nums .sep{color:#94a3b8;font-size:.8rem}
.scr-nums .unit{font-size:.74rem;color:#64748b}
.scr-nums .mid{margin-left:auto;font-size:.7rem;color:#94a3b8}

/* ---- 適用中の条件チップ ---- */
.scr-chips{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin:12px 0 0}
.scr-chip{display:inline-flex;align-items:center;gap:6px;font-size:.75rem;font-weight:600;color:#1e40af;background:#dbeafe;
  border:1px solid #bfdbfe;border-radius:999px;padding:3px 6px 3px 11px}
.scr-chip.ind{color:#5b21b6;background:#ede9fe;border-color:#ddd6fe}
.scr-chip.pre{color:#065f46;background:#d1fae5;border-color:#a7f3d0}
.scr-chip button{border:0;background:transparent;color:inherit;opacity:.65;cursor:pointer;font-size:.95rem;line-height:1;padding:0 2px;font-family:inherit}
.scr-chip button:hover{opacity:1}
.scr-chips .clr{font-size:.74rem;color:#64748b;background:transparent;border:1px solid #e2e8f0;border-radius:999px;padding:3px 11px;cursor:pointer;font-family:inherit}

/* ---- 件数バー（スティッキー） ---- */
.scr-count{position:sticky;top:0;z-index:40;display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  margin:12px 0 0;padding:9px 14px;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);
  border:1px solid #e2e8f0;border-radius:11px;box-shadow:0 2px 10px rgba(15,23,42,.06)}
.scr-count .big{font-size:1.25rem;font-weight:800;color:#2563eb;line-height:1;font-variant-numeric:tabular-nums}
.scr-count .of{font-size:.74rem;color:#94a3b8}
.scr-count .meter{flex:1;min-width:80px;height:5px;border-radius:3px;background:#e2e8f0;overflow:hidden;max-width:220px}
.scr-count .meter i{display:block;height:100%;background:linear-gradient(90deg,#60a5fa,#2563eb);border-radius:3px;transition:width .25s}
.scr-count.zero .big{color:#ef4444}
.scr-count .acts{margin-left:auto;display:flex;gap:6px;flex-wrap:wrap}
.scr-count .acts button{font-family:inherit;font-size:.74rem;font-weight:600;padding:5px 11px;border-radius:8px;border:1px solid #e2e8f0;background:#fff;color:#475569;cursor:pointer}
.scr-count .acts button[aria-pressed="true"]{background:#2563eb;border-color:#2563eb;color:#fff}
.scr-count .acts button:hover:not([aria-pressed="true"]){border-color:#93c5fd;color:#1e40af}
.scr-busy{width:12px;height:12px;border-radius:50%;border:2px solid #bfdbfe;border-top-color:#2563eb;animation:scrspin .7s linear infinite;display:none}
.scr-count.busy .scr-busy{display:block}
@keyframes scrspin{to{transform:rotate(360deg)}}

/* ---- 結果 ---- */
.scr-res{margin-top:12px;overflow:hidden}
.scr-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:9px 12px;border-bottom:1px solid #f1f5f9;background:#f8fafc}
.scr-toolbar select,.scr-toolbar input{font-family:inherit;font-size:.76rem;padding:5px 8px;border:1px solid #e2e8f0;border-radius:7px;background:#fff;color:#475569}
.scr-toolbar label{font-size:.72rem;color:#94a3b8;font-weight:600}

table.scr-tbl{width:100%;border-collapse:collapse;font-size:.79rem}
table.scr-tbl th{background:#f8fafc;color:#475569;font-weight:700;font-size:.72rem;padding:8px 8px;text-align:right;white-space:nowrap;border-bottom:1px solid #e2e8f0;position:sticky;top:0}
table.scr-tbl th:first-child,table.scr-tbl th:nth-child(2){text-align:left}
table.scr-tbl th.s{cursor:pointer;user-select:none}
table.scr-tbl th.s:hover{color:#2563eb}
table.scr-tbl th.on{color:#2563eb}
table.scr-tbl td{padding:7px 8px;text-align:right;border-bottom:1px solid #f1f5f9;color:#334155;font-variant-numeric:tabular-nums;white-space:nowrap}
table.scr-tbl td:first-child,table.scr-tbl td:nth-child(2){text-align:left}
table.scr-tbl tr:hover td{background:#f8fbff}
table.scr-tbl a{color:#2563eb;text-decoration:none;font-weight:700}
table.scr-tbl .nm{color:#0f172a;font-weight:500;max-width:190px;overflow:hidden;text-overflow:ellipsis;display:inline-block;vertical-align:bottom}
table.scr-tbl .ind{font-size:.68rem;color:#64748b;background:#f1f5f9;border-radius:5px;padding:1px 6px;white-space:nowrap}
table.scr-tbl .nil{color:#cbd5e1}
/* 数値セルの背景バー: 文字だけにしない */
.scr-cell{position:relative;display:inline-block;min-width:52px;padding:1px 5px;border-radius:4px}
.scr-cell i{position:absolute;left:0;top:0;bottom:0;border-radius:4px;z-index:0}
.scr-cell b{position:relative;z-index:1;font-weight:600}
.scr-good i{background:rgba(22,163,74,.16)}
.scr-bad i{background:rgba(220,38,38,.14)}
.scr-neu i{background:rgba(100,116,139,.13)}
.scr-good b{color:#15803d}
.scr-bad b{color:#b91c1c}

.scr-pager{display:flex;align-items:center;gap:10px;justify-content:center;padding:11px;font-size:.78rem;color:#64748b;flex-wrap:wrap}
.scr-pager button{font-family:inherit;font-size:.78rem;padding:5px 14px;border:1px solid #e2e8f0;border-radius:8px;background:#fff;color:#475569;cursor:pointer}
.scr-pager button:disabled{opacity:.4;cursor:default}
.scr-empty{padding:30px 16px;text-align:center;color:#94a3b8;font-size:.85rem;line-height:1.9}
.scr-empty b{color:#475569}

/* ---- 散布図 ---- */
.scr-scatter{padding:12px}
.scr-scatter .axes{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:8px}
.scr-scatter .axes select{font-family:inherit;font-size:.78rem;padding:5px 8px;border:1px solid #e2e8f0;border-radius:7px;background:#fff;color:#475569}
.scr-scatter .cv{position:relative;height:420px}
.scr-legend{display:flex;gap:5px;flex-wrap:wrap;margin-top:8px}
.scr-legend span{font-size:.66rem;color:#475569;display:inline-flex;align-items:center;gap:4px;background:#f8fafc;border:1px solid #eef2f7;border-radius:999px;padding:1px 8px 1px 5px}
.scr-legend i{width:8px;height:8px;border-radius:50%;display:inline-block}

/* ---- モバイル ---- */
@media (max-width:760px){
  .scr-wrap{padding:0 10px;margin-top:10px}
  .scr-head h1{font-size:1.05rem}
  .scr-tabs button{padding:9px 8px;font-size:.82rem}
  .scr-pgrid{grid-template-columns:1fr}
  .scr-count{padding:8px 11px}
  .scr-count .meter{display:none}
  .scr-count .acts{width:100%;margin-left:0}
  /* 表を横スクロールさせない。1銘柄=1カードに積む。 */
  table.scr-tbl,table.scr-tbl tbody,table.scr-tbl tr,table.scr-tbl td{display:block;width:100%}
  table.scr-tbl thead{display:none}
  table.scr-tbl tr{width:auto;border:1px solid #e2e8f0;border-radius:10px;margin:8px 10px;padding:9px 11px;background:#fff}
  table.scr-tbl tr:hover td{background:transparent}
  table.scr-tbl td{border:0;padding:3px 0;text-align:right;display:flex;justify-content:space-between;align-items:center;gap:10px;white-space:normal}
  table.scr-tbl td::before{content:attr(data-l);font-size:.7rem;color:#94a3b8;font-weight:600;text-align:left;flex-shrink:0}
  table.scr-tbl td:first-child,table.scr-tbl td:nth-child(2){text-align:left}
  table.scr-tbl td.tk{border-bottom:1px solid #f1f5f9;padding-bottom:6px;margin-bottom:4px}
  table.scr-tbl td.tk::before{content:none}
  table.scr-tbl .nm{max-width:none;white-space:normal}
  .scr-scatter .cv{height:320px}
}
