/* ============================================
   TICKER SELECTION MODAL + setup-bar trigger button
   Inline modal (reuses the app's live ticker-search state). Styled to match
   the model-settings modal. Loaded eagerly because the trigger button lives
   in the always-visible setup bar.
   ============================================ */

/* Setup-bar trigger button (replaces the old inline ticker controls).
   Matches the adjacent Model Settings / Random buttons (accent-primary,
   toolbar height, 11px). */
.ticker-select-btn {
    padding: 5px 16px;
    background: var(--accent-primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    height: var(--toolbar-btn-height);
    transition: background 0.2s;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticker-select-btn:hover:not(:disabled) {
    background: var(--accent-primary-hover);
}

.ticker-select-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Overlay */
.ticker-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Modal box — compact, content-driven height, not too wide */
.ticker-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-2xl, 16px);
    width: 340px;
    max-width: 92vw;
    max-height: 88vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: tickerModalIn 0.2s ease-out;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

@keyframes tickerModalIn {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.ticker-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Extra left padding leaves room for the "⋮⋮" grip that draggable-modal.css
       (.modal-drag-handle) renders at left:8px. */
    padding: 12px 18px 12px 26px;
    border-bottom: 1px solid var(--border-secondary);
    flex-shrink: 0;
}

.ticker-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.ticker-modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s ease;
}

.ticker-modal-close:hover {
    color: var(--text-primary);
}

/* Body */
.ticker-modal-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

/* Ticker input full-width inside the modal */
.ticker-modal .ticker-search-wrapper {
    position: relative;
    width: 100%;
}

.ticker-modal .ticker-input {
    width: 100%;
    box-sizing: border-box;
}

/* Labelled rows: a fixed-width label on the left, the selector flexes to fill
   the rest — so the modal width is unchanged, only the selector narrows. */
.ticker-modal-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticker-modal-label {
    flex: 0 0 auto;
    width: 46px;
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.ticker-modal-field .ticker-search-wrapper {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

/* Period + Load + info row */
.ticker-modal-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.ticker-modal-row .period-select {
    flex: 1;
}

.ticker-modal-row .load-ticker-btn,
.ticker-modal-row .info-ticker-btn {
    flex: 0 0 auto;
}

/* Magnificent 7 quick picks */
.ticker-mag7 {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ticker-mag7-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.ticker-mag7-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.ticker-mag7-btn {
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.ticker-mag7-btn:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.ticker-mag7-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* S&P 500 note */
.ticker-modal-note {
    margin: 2px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-secondary);
    text-align: center;
}
