/* ═══════════════════════════════════════════════════════════
   LAYOUT MANAGER  (chart name button · layout dropdown rows)
   Shared menu base classes live in chart-name-menu.css.
   ═══════════════════════════════════════════════════════════ */

/* ── Layout name button ── */
.chart-name-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    flex-shrink: 1;
}

.chart-name-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 8px;
    color: var(--ui-fg);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    user-select: none;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.chart-name-btn:hover {
    background: rgba(15, 23, 42, 0.06);
    border-color: var(--ui-panel-border);
}
.chart-name-btn .symbol-caret {
    flex-shrink: 0;
}

/* ── Info icon inside menu label ── */
.cnm-info-ic {
    display: inline-flex;
    align-items: center;
    color: var(--ui-fg-muted, #787b86);
    vertical-align: middle;
}

/* ── Toggle row — push toggle to far right ── */
.cnm-item-toggle {
    cursor: default;
}
.cnm-item-toggle .cnm-lbl { pointer-events: none; }
.cnm-item-disabled {
    opacity: .45;
}
.cnm-item-disabled .lp-tog { cursor: not-allowed; }

/* ── Recently-used layout row ── */
.cnm-layout-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 6px;
    padding: 7px 8px 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
}
.cnm-layout-row:hover { background: rgba(120,120,140,.14); }
.cnm-layout-row.cnm-layout-active {
    background: var(--ui-fg, #d1d4dc);
    color: var(--ui-panel, #1e222d);
}
.cnm-layout-row.cnm-layout-active .cnm-layout-sub {
    color: var(--ui-panel, #1e222d);
    opacity: .65;
}
.cnm-layout-row.cnm-layout-active .cnm-star-btn {
    color: var(--ui-panel, #1e222d);
}

.cnm-layout-info { flex: 1; min-width: 0; }

.cnm-layout-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cnm-layout-sub {
    font-size: 11px;
    color: var(--ui-fg-muted, #787b86);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Star / favourite button inside layout row ── */
.cnm-star-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--ui-fg-muted, #787b86);
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.1s, background 0.1s;
}
.cnm-star-btn:hover {
    background: rgba(120,120,140,.18);
    color: var(--ui-fg, #d1d4dc);
}

/* ── Empty state ── */
.cnm-empty {
    padding: 8px 14px;
    font-size: 12px;
    color: var(--ui-fg-muted, #787b86);
    font-style: italic;
}

/* ── Light theme overrides (layout-specific only) ── */
.cnm-info-ic { color: var(--ui-muted); }
.cnm-layout-row:hover { background: var(--ui-button); }
.cnm-layout-row.cnm-layout-active {
    background: var(--ui-fg);
    color: var(--ui-panel);
}
.cnm-layout-row.cnm-layout-active .cnm-layout-sub { color: var(--ui-panel); opacity: .65; }
.cnm-layout-name { color: var(--ui-fg); }
.cnm-layout-sub  { color: var(--ui-muted); }
.cnm-star-btn    { color: var(--ui-muted); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES
   ═══════════════════════════════════════════════════════════ */

/* Desktop large: normal sizing */
@media (min-width: 1440px) {
    .chart-name-btn {
        padding: 0 8px;
        font-size: 13px;
    }
}

/* Desktop medium */
@media (min-width: 1200px) and (max-width: 1439px) {
    .chart-name-btn {
        padding: 0 6px;
        font-size: 12px;
    }
}

/* Desktop small */
@media (min-width: 1024px) and (max-width: 1199px) {
    .chart-name-btn {
        padding: 0 5px;
        font-size: 12px;
    }
}

/* Tablet landscape */
@media (min-width: 768px) and (max-width: 1023px) {
    .chart-name-btn {
        padding: 0 4px;
        font-size: 11px;
        max-width: 100px;
    }
}

/* Mobile */
@media (min-width: 480px) and (max-width: 767px) {
    .topbar-group-primary .chart-name-wrap {
        flex-shrink: 0;
        height: 36px;
        display: flex;
        align-items: center;
    }
}
