/* gStockly v4 — Scanner Editor (si appoggia a editor-v4.css, condiviso con ts-editor) */

/* ---------- barra di stato / riga info ---------- */
body.editor-shell-v2 .tab-content-area{background:var(--bg)}
body.editor-shell-v2 #pane-results{padding:18px 22px 28px!important}
body.editor-shell-v2 .qr-status-bar{padding:12px 16px;font-weight:600;color:var(--text)}

/* ---------- empty states ---------- */
body.editor-shell-v2 .empty-pane{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;min-height:260px;color:var(--muted)!important;font:500 15px var(--sans)}
body.editor-shell-v2 .empty-pane i{display:grid;place-items:center;width:64px;height:64px;border-radius:50%;background:var(--brandSoft);color:var(--brand2)!important;font-size:24px!important;opacity:1!important}
body.editor-shell-v2 .empty-pane span{max-width:36ch;text-align:center;line-height:1.5}

/* ---------- risultati ---------- */
body.editor-shell-v2 .results-toolbar{padding:10px 14px!important;border:1px solid var(--line)!important;border-radius:14px!important;background:var(--panel)!important;gap:10px!important}
body.editor-shell-v2 .results-toolbar .results-filter-input{height:36px;min-width:220px;padding:0 12px;border:1px solid var(--line2)!important;border-radius:10px!important;background:var(--panel2)!important;color:var(--text)!important;font:500 13px var(--sans)!important}
body.editor-shell-v2 .results-toolbar .results-filter-input:focus{border-color:var(--brand)!important;background:var(--panel)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 14%,transparent)!important}
body.editor-shell-v2 .results-table-wrap{border:1px solid var(--line);border-radius:14px;overflow:auto;background:var(--panel)}
body.editor-shell-v2 .res-table{font-size:13px}
body.editor-shell-v2 .res-table th{background:var(--panel2)!important;color:var(--soft)!important;font:700 11px var(--sans)!important;letter-spacing:.06em;text-transform:uppercase;border-bottom:1px solid var(--line)!important;padding:10px 12px!important}
body.editor-shell-v2 .res-table th:hover{background:color-mix(in srgb,var(--panel2) 80%,var(--brand) 8%)!important;color:var(--text)!important}
body.editor-shell-v2 .res-table td{padding:10px 12px!important;border-top:1px solid var(--line)!important;border-right:0!important;color:var(--text)!important;background:var(--panel)!important;font-variant-numeric:tabular-nums}
body.editor-shell-v2 .res-table tr:nth-child(odd) td{background:var(--panel)!important}
body.editor-shell-v2 .res-table tr:hover td{background:var(--panel2)!important}
body.editor-shell-v2 .res-table .ticker-cell,body.editor-shell-v2 .ticker-cell{font-weight:650;color:var(--text)}
body.editor-shell-v2 .res-filter-input{height:28px;border:1px solid var(--line2)!important;border-radius:8px!important;background:var(--panel)!important;color:var(--text)!important;font:500 12px var(--sans)!important}
body.editor-shell-v2 .signal-pill{border-radius:999px!important;padding:3px 10px!important;font:600 11.5px var(--sans)!important;background:var(--brandSoft)!important;color:var(--brand2)!important;border:1px solid color-mix(in srgb,var(--brand) 35%,var(--line))!important}
body.editor-shell-v2 .tab-badge{margin-left:6px;padding:1px 8px;border-radius:999px;background:var(--brand)!important;color:#fff!important;font:700 11px var(--sans)}

/* ---------- History ---------- */
body.editor-shell-v2 #pane-history{padding:18px 22px!important;max-width:1180px;margin:0 auto}
body.editor-shell-v2 #historyContent .history-item,body.editor-shell-v2 #historyContent>div:not(.empty-pane){border:1px solid var(--line);border-radius:14px;background:var(--panel)}

/* ---------- Functions: libreria a schede, clic per inserire ---------- */
body.editor-shell-v2 .functions-pane{max-width:1240px;margin:0 auto;padding:24px 24px 40px!important;overflow:auto}
body.editor-shell-v2 .fn-sidebar-header{display:flex;align-items:center;gap:12px;padding:0 0 4px!important;border:0!important;background:none!important}
body.editor-shell-v2 .fn-sidebar-header h3{margin:0;font:650 26px var(--sans)!important;letter-spacing:-.02em;color:var(--text)!important;text-transform:none!important}
body.editor-shell-v2 .fn-sidebar-header i.fa-book{display:none}
body.editor-shell-v2 .fn-sidebar-header .tb-btn{margin-left:auto;padding:0 12px!important;height:34px}
body.editor-shell-v2 .fn-hint{margin:0 0 16px;font-size:14px;color:var(--muted)}
body.editor-shell-v2 .fn-search{padding:0 0 18px!important;background:none!important;border:0!important}
body.editor-shell-v2 .fn-search input{width:100%;height:44px;padding:0 16px!important;border:1px solid var(--line2)!important;border-radius:12px!important;background:var(--panel)!important;color:var(--text)!important;font:500 14.5px var(--sans)!important}
body.editor-shell-v2 .fn-search input:focus{border-color:var(--brand)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 14%,transparent)!important;outline:0}
body.editor-shell-v2 .fn-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(330px,1fr));gap:10px;align-content:start;overflow:visible!important}
body.editor-shell-v2 .fn-category{grid-column:1/-1;margin:18px 0 2px;padding:0!important;background:none!important;border:0!important;font:700 12px var(--sans)!important;letter-spacing:.09em;text-transform:uppercase;color:var(--brand2)!important}
body.editor-shell-v2 .fn-category:first-child{margin-top:0}
body.editor-shell-v2 .fn-item{padding:14px 16px!important;gap:5px!important;border:1px solid var(--line);border-radius:14px;background:var(--panel);transition:border-color .12s,background .12s,transform .12s}
body.editor-shell-v2 .fn-item:hover{border-color:var(--brand);background:var(--panel)!important;transform:translateY(-1px)}
body.editor-shell-v2 .fn-item-name{font:650 14px ui-monospace,SFMono-Regular,Consolas,monospace!important;color:var(--text)!important}
body.editor-shell-v2 .fn-item-sig{font:500 12px ui-monospace,SFMono-Regular,Consolas,monospace!important;color:var(--brand2)!important;white-space:normal!important;overflow:visible!important;word-break:break-word}
body.editor-shell-v2 .fn-item-desc{font-size:13px!important;line-height:1.5!important;color:var(--muted)!important}
body.editor-shell-v2 .fn-group-children{display:contents}

/* ---------- pannelli laterali (Params / Scripts) ---------- */
body.editor-shell-v2 .floating-panel{background:var(--panel)!important;border-color:var(--line)!important;box-shadow:0 24px 60px rgba(20,23,28,.22)!important}
body.editor-shell-v2 .fp-header{padding:16px 20px!important;border-bottom:1px solid var(--line)!important;background:var(--panel)!important;font:650 15px var(--sans)!important;color:var(--text)!important}
body.editor-shell-v2 .fp-header h3,body.editor-shell-v2 .fp-header .fp-title{font:650 15px var(--sans)!important;letter-spacing:0!important;text-transform:none!important;color:var(--text)!important}
body.editor-shell-v2 .fp-close{width:32px;height:32px;border:1px solid transparent!important;border-radius:9px!important;background:none!important;color:var(--muted)!important}
body.editor-shell-v2 .fp-close:hover{border-color:var(--line2)!important;color:var(--text)!important}
body.editor-shell-v2 .fp-body{padding:18px 20px!important}
body.editor-shell-v2 .fp-body label{display:block;margin:12px 0 5px;font:600 12px var(--sans)!important;letter-spacing:0!important;text-transform:none!important;color:var(--muted)!important}
body.editor-shell-v2 .fp-body input,body.editor-shell-v2 .fp-body select,body.editor-shell-v2 .fp-body textarea{height:38px;width:100%;padding:0 12px!important;border:1px solid var(--line2)!important;border-radius:10px!important;background:var(--panel)!important;color:var(--text)!important;font:500 13.5px var(--sans)!important}
body.editor-shell-v2 .fp-body input:focus,body.editor-shell-v2 .fp-body select:focus{border-color:var(--brand)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 14%,transparent)!important;outline:0}
body.editor-shell-v2 .fp-body h4,body.editor-shell-v2 .fp-body .fp-section{margin:22px 0 4px;font:700 11.5px var(--sans)!important;letter-spacing:.09em;text-transform:uppercase;color:var(--brand2)!important}
body.editor-shell-v2 .fp-backdrop.open{background:rgba(20,23,28,.32)!important;backdrop-filter:blur(2px)}

/* ---------- finestre (AI, login, cartelle) ---------- */
body.editor-shell-v2 .ai-box,body.editor-shell-v2 .modal-box{border:1px solid var(--line)!important;border-radius:20px!important;background:var(--panel)!important;box-shadow:0 28px 70px rgba(20,23,28,.28)!important;overflow:hidden}
body.editor-shell-v2 .ai-box-header,body.editor-shell-v2 .modal-box h3{padding:18px 22px!important;background:var(--panel)!important;border-bottom:1px solid var(--line)!important;font:650 16px var(--sans)!important;color:var(--text)!important}
body.editor-shell-v2 .ai-box-body{padding:18px 22px!important}
body.editor-shell-v2 .ai-box-body textarea{width:100%;min-height:150px;padding:14px 16px;border:1px solid var(--line2)!important;border-radius:14px!important;background:var(--panel2)!important;color:var(--text)!important;font:500 14.5px/1.55 var(--sans)!important}
body.editor-shell-v2 .ai-box-body textarea:focus{border-color:var(--brand)!important;background:var(--panel)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 14%,transparent);outline:0}
body.editor-shell-v2 .ai-box-footer{padding:14px 22px 20px!important;background:var(--panel)!important;border-top:0!important;display:flex;gap:10px}
body.editor-shell-v2 .ai-option{font-size:13px!important}
body.editor-shell-v2 .modal-overlay,body.editor-shell-v2 .ai-overlay.active{background:rgba(20,23,28,.4)!important;backdrop-filter:blur(3px)}
body.editor-shell-v2 .modal-box input{height:40px;border:1px solid var(--line2)!important;border-radius:10px!important;background:var(--panel)!important;color:var(--text)!important}
body.editor-shell-v2 .btn-modal{height:38px;padding:0 18px!important;border-radius:10px!important;font:600 13.5px var(--sans)!important}

/* ---------- console ---------- */
body.editor-shell-v2 .console-header{padding:0 18px!important}
body.editor-shell-v2 .console-bar .tb-btn{height:28px;padding:0 10px!important;font-size:12px}
body.editor-shell-v2 .log-console{font:500 12.5px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace!important;background:var(--panel2)!important;color:var(--text)!important}

@media(max-width:900px){
  body.editor-shell-v2 .functions-pane{padding:16px 14px 32px!important}
  body.editor-shell-v2 .fn-list{grid-template-columns:1fr}
  body.editor-shell-v2 #pane-results{padding:12px!important}
}
