/* v106 stability fixes */
/* Phase 1 library filters: keep controls compact and aligned at every breakpoint. */
#tools .tool-controls{grid-template-columns:minmax(180px,2fr) repeat(4,minmax(120px,1fr));gap:8px;align-items:stretch}
#tools .tool-controls>*{min-width:0;width:100%;box-sizing:border-box}
@media(max-width:900px){#tools .tool-controls{grid-template-columns:repeat(2,minmax(0,1fr))}#tools .filter-search{grid-column:1/-1}}
@media(max-width:520px){#tools .tool-controls{grid-template-columns:1fr 1fr}#tools .filter-search{grid-column:1/-1}#tools .tool-controls select{font-size:12px;padding:10px 8px}}
#toolLibraryTitle{margin:6px 0 0}
#toolGrid .tool-card .tool-card-meta{display:flex;align-items:center;gap:7px;min-height:20px}
#toolGrid .tool-card .tool-badge{display:inline-flex;align-items:center;padding:3px 7px;border-radius:999px;font-size:10px;font-weight:800;line-height:1;border:1px solid var(--line);background:#fff}
#toolGrid .tool-card .tool-badge.new{background:#f5f2ff;color:#5c4bb7;border-color:#ddd7ff}
#toolGrid .tool-card .capability-tags{display:flex;flex-wrap:wrap;gap:5px;margin:7px 0 9px;min-height:21px}
#toolGrid .tool-card .capability-tags span{display:inline-flex;align-items:center;padding:3px 7px;border:1px solid var(--line);border-radius:999px;font-size:10px;line-height:1.1;color:#666;background:#faf9f6}
#toolGrid .tool-card .tool-top{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:12px!important}
#toolGrid .tool-card .tool-name{display:grid!important;grid-template-columns:47px minmax(0,1fr)!important;align-items:center!important;column-gap:10px!important;min-width:0!important;flex:1 1 auto!important}
#toolGrid .tool-card .tool-name>.tool-logo-img{width:22px;height:22px;object-fit:contain;border-radius:5px;display:block}.tool-logo-fallback{display:none;width:100%;height:100%;align-items:center;justify-content:center}.tool-logo{grid-column:1!important;grid-row:1!important;width:47px!important;height:47px!important;min-width:47px!important;max-width:47px!important;flex:none!important;align-self:center!important}
#toolGrid .tool-card .tool-name>div:last-child{grid-column:2!important;grid-row:1!important;min-width:0!important;width:auto!important;overflow:hidden!important;align-self:center!important}
#toolGrid .tool-card .tool-name h3{display:block!important;margin:0!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
#toolGrid .tool-card .tool-name small{display:block!important;margin-top:3px!important;line-height:1.2!important}
#toolGrid .tool-card .tool-logo img{display:block!important;width:30px!important;height:30px!important;object-fit:contain!important}
#toolGrid .tool-card .tool-logo span{display:none!important}
@media(max-width:650px){#toolGrid .tool-card .tool-name{grid-template-columns:42px minmax(0,1fr)!important;column-gap:8px!important}#toolGrid .tool-card .tool-name>.tool-logo{width:42px!important;height:42px!important;min-width:42px!important;max-width:42px!important}}
.goal-row button{width:100%;min-width:0;min-height:72px;justify-content:center;cursor:pointer}
.compare-box{width:100%;box-sizing:border-box}
.compare-picks{display:grid!important;grid-template-columns:minmax(0,1fr) 42px minmax(0,1fr)!important;align-items:center!important;gap:10px!important;width:100%}
.compare-picks select{display:block;width:100%!important;min-width:0;height:42px;box-sizing:border-box;appearance:auto}
.compare-picks strong{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#f3f1f7;color:#625d6c;font-size:10px;letter-spacing:.04em}
.compare-box>.primary-btn{display:block;width:100%;height:42px;margin-top:10px}
.compare-result{margin-top:14px}
#compareResult{margin-top:14px}
.compare-table{display:grid;grid-template-columns:minmax(130px,.7fr) minmax(0,1fr) minmax(0,1fr);border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff;font-size:13px;line-height:1.45}
.compare-table>div{padding:12px 14px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);min-width:0;box-sizing:border-box}
.compare-table>div:nth-child(3n){border-right:0}
.compare-table>div:nth-last-child(-n+3){border-bottom:0}
.compare-table>div:nth-child(3n+1){background:#faf9f6;color:#777;font-weight:700}
.compare-table>div:nth-child(2),.compare-table>div:nth-child(3){font-weight:700;color:var(--ink)}
.compare-table>div:nth-child(2) strong,.compare-table>div:nth-child(3) strong{font-size:15px}
@media(max-width:650px){.goal-row{grid-template-columns:repeat(2,1fr)}.compare-picks{grid-template-columns:1fr!important;gap:8px!important}.compare-picks strong{width:100%;height:28px;border-radius:8px}.compare-picks select{height:42px}.compare-table{grid-template-columns:1fr 1fr;font-size:12px}.compare-table>div:nth-child(3n){border-right:1px solid var(--line)}.compare-table>div:nth-child(2n){border-right:0}.compare-table>div:nth-last-child(-n+3){border-bottom:1px solid var(--line)}.compare-table>div:nth-last-child(-n+2){border-bottom:0}.compare-table>div:first-child{display:none}.compare-table>div:nth-child(3){grid-column:2;grid-row:1}.compare-table>div:nth-child(2){grid-column:1;grid-row:1}.compare-table>div:nth-child(3n+1){grid-column:1/3;background:#faf9f6}.compare-table>div:nth-child(3n+2){grid-column:1}.compare-table>div:nth-child(3n+3){grid-column:2}}