/* Search bar in navbar — visible box like TradingView */
.tf-search-bar{display:flex;align-items:center;gap:8px;padding:6px 14px;
    background:#f3f4f6;border:1px solid #e5e7eb;border-radius:8px;cursor:pointer;
    transition:background .2s,border-color .2s,box-shadow .2s;margin-right:12px;min-width:200px;max-width:280px}
.tf-search-bar:hover{background:#eef0f3;border-color:#d1d5db}
.tf-search-bar:focus-within,.tf-search-bar:active{border-color:#16a34a;box-shadow:0 0 0 2px rgba(22,163,74,.12)}
.tf-search-bar svg{width:16px;height:16px;color:#999;flex-shrink:0}
.tf-search-bar-text{flex:1;font-size:13px;color:#999;white-space:nowrap;overflow:hidden;user-select:none}
.tf-search-bar-kbd{font-size:10px;background:#e5e7eb;color:#666;padding:2px 6px;border-radius:4px;font-family:monospace;line-height:1.2;flex-shrink:0}

/* Overlay */
.tf-gs-overlay{position:fixed;inset:0;z-index:999999;display:none;align-items:flex-start;justify-content:center;
    padding-top:min(20vh,140px);background:rgba(0,0,0,.4);backdrop-filter:blur(2px);opacity:0;transition:opacity .15s}
.tf-gs-overlay.active{display:flex;opacity:1}
.tf-gs-box{width:100%;max-width:700px;background:#fff;border-radius:14px;box-shadow:0 20px 60px rgba(0,0,0,.2);
    overflow:hidden;transform:translateY(-8px);transition:transform .15s}
.tf-gs-overlay.active .tf-gs-box{transform:translateY(0)}

/* Input */
.tf-gs-input-wrap{display:flex;align-items:center;padding:14px 18px;border-bottom:1px solid #e5e7eb}
.tf-gs-input-wrap svg{width:20px;height:20px;color:#999;flex-shrink:0}
.tf-gs-input{flex:1;border:none;outline:none;font-size:16px;padding:0 12px;color:#111;font-family:inherit}
.tf-gs-input::placeholder{color:#aaa}
.tf-gs-esc{font-size:11px;background:#f3f4f6;color:#666;padding:3px 7px;border-radius:4px;font-family:monospace;cursor:pointer}

/* Results */
.tf-gs-results{max-height:400px;overflow-y:auto;padding:4px 0}
.tf-gs-results:empty{display:none}
.tf-gs-item{display:flex;align-items:center;gap:10px;padding:11px 18px;cursor:pointer;transition:background .1s;text-decoration:none;color:inherit;border-bottom:1px solid #f3f4f6}
.tf-gs-item:last-child{border-bottom:none}
.tf-gs-item:hover,.tf-gs-item.active{background:#f0fdf4}
.tf-gs-item-left{display:flex;align-items:center;gap:10px;flex:1;min-width:0}
.tf-gs-item-ticker{font-weight:700;font-size:14px;color:#111;white-space:nowrap;width:80px;flex-shrink:0}
.tf-gs-item-name{font-size:13px;color:#666;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:190px;flex-shrink:0}
.tf-gs-item-exchange{font-size:11px;color:#888;white-space:nowrap;flex-shrink:0;width:70px}
.tf-gs-item-type{font-size:11px;font-weight:600;text-transform:uppercase;padding:3px 8px;border-radius:4px;white-space:nowrap;letter-spacing:.3px}
.tf-gs-item-actions{display:flex;gap:14px;flex-shrink:0;margin-left:16px}
.tf-gs-action{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:6px;font-size:11px;font-weight:600;
    text-decoration:none;border:1px solid #e5e7eb;transition:background .15s,border-color .15s}
.tf-gs-action-bt{color:#6b7280;background:#f9fafb}
.tf-gs-action-bt:hover{background:#f3f4f6;border-color:#9ca3af;color:#374151}
.tf-gs-action-fc{color:#6b7280;background:#f9fafb}
.tf-gs-action-fc:hover{background:#f0fdf4;border-color:#16a34a;color:#16a34a}
/* Type color badges — vivid saturated backgrounds */
.tf-gs-type-stock{color:#065f46;background:#d1fae5}
.tf-gs-type-etf{color:#5b21b6;background:#ede9fe}
.tf-gs-type-index{color:#be185d;background:#fce7f3}
.tf-gs-type-forex{color:#1e40af;background:#dbeafe}
.tf-gs-type-commodity{color:#991b1b;background:#fee2e2}
.tf-gs-type-crypto{color:#c2410c;background:#ffedd5}
.tf-gs-type-default{color:#4b5563;background:#e5e7eb}

/* Hint */
.tf-gs-hint{padding:16px 18px;text-align:center;color:#999;font-size:13px}
.tf-gs-hint kbd{background:#f3f4f6;padding:2px 6px;border-radius:4px;font-size:11px;font-family:monospace}

/* Mobile: collapse to icon */
@media(max-width:768px){
    .tf-search-bar{min-width:auto;max-width:none;padding:6px;border-radius:50%;width:36px;height:36px;justify-content:center}
    .tf-search-bar-text,.tf-search-bar-kbd{display:none}
    .tf-gs-overlay{padding-top:10px;align-items:flex-start}
    .tf-gs-box{max-width:calc(100% - 20px);border-radius:12px}
}
